Package opennlp.ccg.hylo

Examples of opennlp.ccg.hylo.ModeLabel


    }
  }

  @Test
  public void testAddAttribute() {
    Mode num = new ModeLabel("num");
    Proposition prop = new Proposition("pl");
   
    assertFalse(word.addAttribute(num, new Proposition("sg")));
    assertTrue(word.addAttribute(num, prop));
    assertFalse(word.addAttribute(num, prop));
View Full Code Here


    assertTrue(nonword.containsAttribute(num));
  }
 
  @Test
  public void testSetAttribute() {
    Mode num = new ModeLabel("num");
    Proposition prop = new Proposition("pl");
   
    assertEquals(attrs.get(num), word.setAttribute(num, prop));
    assertEquals(prop, word.getAttributeValue(num));
   
View Full Code Here

    assertEquals(prop, nonword.getAttributeValue(num));
  }
 
  @Test
  public void testRemoveAttribute() {
    Mode num = new ModeLabel("num");
   
    assertEquals(attrs.get(num), word.removeAttribute(num));
    assertNull(nonword.removeAttribute(num));
  }
View Full Code Here

    catch(UnsupportedOperationException expected) {
      // do nothing
    }
   
    try {
      m.put(new ModeLabel("foo"), new Proposition("bar"));
      fail("able to put into attribute map");
    }
    catch(UnsupportedOperationException expected) {
      // do nothing
    }
View Full Code Here

   
    graph = LFGraphFactory.newGraphFrom(testLF);
   
    expected = new LFGraph(LFGraphFactory.DEFAULT_EDGE_FACTORY);
    LFVertex w7 = new LFVertex(new NominalAtom("w7"), new Proposition("be"));
    w7.setAttribute(new ModeLabel("mood"), new Proposition("dcl"));
    w7.setAttribute(new ModeLabel("tense"), new Proposition("past"));
    expected.addVertex(w7);
   
    LFVertex w0 = new LFVertex(new NominalAtom("w0"), new Proposition("bank"));
    w0.setAttribute(new ModeLabel("det"), new Proposition("nil"));
    expected.addVertex(w0);
   
    LFVertex w1 = new LFVertex(new NominalAtom("w1"), new Proposition("of"));
    expected.addVertex(w1);
   
    LFVertex w2 = new LFVertex(new NominalAtom("w2"), new Proposition("holland"));
    w2.setAttribute(new ModeLabel("det"), new Proposition("nil"));
    w2.setAttribute(new ModeLabel("num"), new Proposition("sg"));
    expected.addVertex(w2);
   
    LFVertex w5 = new LFVertex(new NominalAtom("w5"), new Proposition("office"));
    w5.setAttribute(new ModeLabel("det"), new Proposition("nil"));
    w5.setAttribute(new ModeLabel("num"), new Proposition("sg"));
    expected.addVertex(w5);
   
    LFVertex w4 = new LFVertex(new NominalAtom("w4"), new Proposition("wuhan"));
    w4.setAttribute(new ModeLabel("num"), new Proposition("sg"));
    expected.addVertex(w4);
   
    LFVertex w9 = new LFVertex(new NominalAtom("w9"), new Proposition("officially"));
    expected.addVertex(w9);
   
    LFVertex w8 = new LFVertex(new NominalAtom("w8"), new Proposition("also"));
    expected.addVertex(w8);
   
    LFVertex w10 = new LFVertex(new NominalAtom("w10"), new Proposition("establish"));
    w10.setAttribute(new ModeLabel("tense"), new Proposition("past"));
    expected.addVertex(w10);
   
    LFVertex w11 = new LFVertex(new NominalAtom("w11"), new Proposition("just"));
    expected.addVertex(w11);
   
    LFVertex w12 = new LFVertex(new NominalAtom("w12"), new Proposition("recently"));
    expected.addVertex(w12);
   
    expected.addLabeledEdge(w7, w0, LFEdgeLabel.forMode(new ModeLabel("Arg0")));
    expected.addLabeledEdge(w0, w1, LFEdgeLabel.forMode(new ModeLabel("Mod")));
    expected.addLabeledEdge(w1, w2, LFEdgeLabel.forMode(new ModeLabel("Arg1")));
    expected.addLabeledEdge(w2, w5, LFEdgeLabel.forMode(new ModeLabel("ApposRel")));
    expected.addLabeledEdge(w5, w4, LFEdgeLabel.forMode(new ModeLabel("Mod")));
   
    expected.addLabeledEdge(w7, w9, LFEdgeLabel.forMode(new ModeLabel("Arg1")));
    expected.addLabeledEdge(w9, w0, LFEdgeLabel.forMode(new ModeLabel("Arg0")));
   
    expected.addLabeledEdge(w7, w8, LFEdgeLabel.forMode(new ModeLabel("Mod")));
    expected.addLabeledEdge(w7, w10, LFEdgeLabel.forMode(new ModeLabel("GenRel")));
    expected.addLabeledEdge(w10, w0, LFEdgeLabel.forMode(new ModeLabel("Arg1")));
    expected.addLabeledEdge(w10, w11, LFEdgeLabel.forMode(new ModeLabel("Mod")));
    expected.addLabeledEdge(w10, w12, LFEdgeLabel.forMode(new ModeLabel("Mod")));   
  }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
   
    source = new LFVertex(new NominalAtom("w3"), new Proposition("prop1"));
    target = new LFVertex(new NominalAtom("w9"), new Proposition("prop2"));
    label = new LFEdgeLabel(new ModeLabel("Arg0"));
   
    edge = new LFEdge(source, target, label);
  }
View Full Code Here

TOP

Related Classes of opennlp.ccg.hylo.ModeLabel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.