Examples of parseSentence()


Examples of edu.washington.cs.knowitall.nlp.OpenNlpChunkedSentenceParser.parseSentence()

        expectedRanges.add(new Range(16, 2)); // the wake
        expectedRanges.add(new Range(19, 3)); // this unthinkable tragedy

        OpenNlpChunkedSentenceParser reader = new OpenNlpChunkedSentenceParser();
        reader.attachOfs(false);
        ChunkedSentence sent = reader.parseSentence(sentStr);

        ArrayList<Range> gotRanges = new ArrayList<Range>();
        Iterables.addAll(gotRanges, sent.getNpChunkRanges());

        assertEquals(expectedLength, sent.getLength());
View Full Code Here

Examples of games.stendhal.common.parser.ExpressionMatcher.parseSentence()

   */
  @Test
  public final void testParsing() {
    final ExpressionMatcher matcher = new ExpressionMatcher();

    Sentence sentence = matcher.parseSentence("", new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("", sentence.toString());

    String str = matcher.readMatchingFlags("Lazy dog");
    assertEquals("Lazy dog", str);
View Full Code Here

Examples of games.stendhal.common.parser.ExpressionMatcher.parseSentence()

    String str = matcher.readMatchingFlags("Lazy dog");
    assertEquals("Lazy dog", str);
    assertTrue(matcher.isEmpty());
    assertEquals("", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("lazy dog/SUB-ANI", sentence.toString());

    str = matcher.readMatchingFlags("|TYPE|abcdef/OBJ");
    assertEquals("abcdef/OBJ", str);
View Full Code Here

Examples of games.stendhal.common.parser.ExpressionMatcher.parseSentence()

    assertTrue(matcher.isAnyFlagSet());
    assertFalse(matcher.getExactMatching());
    assertTrue(matcher.getTypeMatching());
    assertEquals("|TYPE", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("|TYPE|abcdef/OBJ", sentence.toString());

    str = matcher.readMatchingFlags("|EXACT|Hello world!");
    assertEquals("Hello world!", str);
View Full Code Here

Examples of games.stendhal.common.parser.ExpressionMatcher.parseSentence()

    assertTrue(matcher.isAnyFlagSet());
    assertTrue(matcher.getExactMatching());
    assertFalse(matcher.getTypeMatching());
    assertEquals("|EXACT", matcher.toString());

    sentence = matcher.parseSentence(str, new ConversationContext());
    assertFalse(sentence.hasError());
    assertEquals("|EXACT|Hello world!", sentence.toString());
  }

  /**
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.