Package opennlp.ccg.hylo

Examples of opennlp.ccg.hylo.ModeLabel


  public void setUp() throws Exception {
    super.setUp();
   
    edge = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w1"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase")));
   
    filter = new EdgeMatchFilter(edge, MatchType.LABEL_MISMATCH, MatchType.SOURCE_PREDICATE_MISMATCH,
        MatchType.TARGET_PREDICATE_MATCH);
  }
View Full Code Here


 
  @Test
  public void testAllows() {
    LFEdge test = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("blah blah")),
        new LFVertex(new NominalAtom("w1"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("boring")));
   
    assertTrue(filter.allows(test));
   
    test = new LFEdge(test.getSource(), test.getTarget(), edge.getLabel());
    assertFalse(filter.allows(test));
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
   
    one = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w1"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase")));
    two = new LFEdge(new LFVertex(new NominalAtom("w2"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w3"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blurg")));
   
    label = new LFEdgeLabel(new ModeLabel("blase"));
   
    filter = new LabelMatchFilter(label);
  }
View Full Code Here

    }
  }

  @Test
  public void testSetBasis() {
    filter.setBasis(new LFEdgeLabel(new ModeLabel("boo")));
   
    assertFalse(filter.allows(one));
    assertFalse(filter.allows(two));
   
    try {
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void testAllows() {
    LFEdge one = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w1"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase"))),
      two = new LFEdge(new LFVertex(new NominalAtom("w2"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w3"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase")));
   
    assertTrue(filter.allows(one));
    assertFalse(filter.allows(two));
   
    filter.setAlignmentIndices(Collections.EMPTY_SET);
View Full Code Here

    aGraph.addVertex(aw0);
    aGraph.addVertex(aw1);
    aGraph.addVertex(aw2);
    aGraph.addVertex(aw3);
       
    aDet = aGraph.addLabeledEdge(aw1, aw0, LFEdgeLabel.forMode(new ModeLabel("Det")));
    aArg0 = aGraph.addLabeledEdge(aw2, aw1, LFEdgeLabel.forMode(new ModeLabel("Arg0")));
    aMod = aGraph.addLabeledEdge(aw2, aw3, LFEdgeLabel.forMode(new ModeLabel("Mod")));
   
    bGraph = new LFGraph();
   
    LFVertex bw0 = new LFVertex(new NominalAtom("w0"), new Proposition("he")),
      bw1 = new LFVertex(new NominalAtom("w1"), new Proposition("move"));
   
    bGraph.addVertex(bw0);
    bGraph.addVertex(bw1);
       
    bArg0 = bGraph.addLabeledEdge(bw1, bw0, LFEdgeLabel.forMode(new ModeLabel("Arg0")));
   
    diff = new LFGraphDifference(aGraph, bGraph, alignment);
  }
View Full Code Here

    one = new LFVertex(new NominalAtom("w0"), new Proposition("blah"));
    two = new LFVertex(new NominalAtom("w1"), new Proposition("blah"));
   
    edge = new LFEdge(two,
        new LFVertex(new NominalAtom("w2"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase")));
   
    filter = new VertexMatchFilter(two, MatchType.SOURCE_MATCH);
  }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
   
    one = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w1"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("blase")));
    two = new LFEdge(new LFVertex(new NominalAtom("w2"), new Proposition("blah")),
        new LFVertex(new NominalAtom("w3"), new Proposition("blah blah")),
        new LFEdgeLabel(new ModeLabel("bored")));
    three = new LFEdge(new LFVertex(new NominalAtom("w0"), new Proposition("zzz")),
        new LFVertex(new NominalAtom("w2"), new Proposition("snooze")),
        new LFEdgeLabel(new ModeLabel("blase")));
   
    edges = new LinkedHashSet<LFEdge>();
    edges.add(one);
    edges.add(two);
    edges.add(three);
View Full Code Here

   
    wordIndex = Integer.valueOf(7);
    nonwordIndex = Integer.valueOf(1);
   
    attrs = new HashMap<Mode, Proposition>();
    attrs.put(new ModeLabel("num"), new Proposition("sg"));
    attrs.put(new ModeLabel("det"), new Proposition("nil"));
    attrs.put(new ModeLabel("tense"), new Proposition("past"));
   
    word = new LFVertex(wordNominal, proposition, attrs);
    nonword = new LFVertex(nonwordNominal, proposition);
  }
View Full Code Here

    }
  }
 
  @Test
  public void testContainsAttribute() {
    Mode num = new ModeLabel("num");
    assertTrue(word.containsAttribute(num));
    word.removeAttribute(num);
    assertFalse(word.containsAttribute(num));
  }
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.