Esempio n. 1
0
  @Test
  public void testIsAlignmentChunkable() throws Exception {
    AMR amr = new AMR();
    AMR.Node root = amr.addNode("r", "root");
    AMR.Node child1 = amr.addNode("c1", "child1");
    AMR.Node child2 = amr.addNode("c2", "child2");
    AMR.Arc arc1 = amr.addArc(root, child1, "arc1");
    AMR.Arc arc2 = amr.addArc(root, child2, "arc2");

    child1.alignment = 0;
    root.alignment = 1;
    child2.alignment = 2;

    assertEquals(true, ParserUtils.isAlignmentChunkable(amr));

    child2.alignment = 0;
    assertEquals(false, ParserUtils.isAlignmentChunkable(amr));

    child1.alignment = 1;
    assertEquals(true, ParserUtils.isAlignmentChunkable(amr));
  }