Examples of classifyWords()


Examples of games.stendhal.common.parser.SentenceImplementation.classifyWords()

    final ConversationContext ctx = new ConversationContext();

    SentenceImplementation sentence = new SentenceImplementation(ctx, "The quick brown fox jumps over the lazy dog.");
    ConversationParser parser = new ConversationParser(sentence);
    sentence.parse(parser);
    sentence.classifyWords(parser);
    assertFalse(sentence.hasError());
    assertEquals("quick/ADJ brown/ADJ-COL fox/SUB-ANI jump/VER over/PRE lazy/ADJ dog/SUB-ANI.",
        sentence.toString());

    sentence.mergeWords();
View Full Code Here

Examples of games.stendhal.common.parser.SentenceImplementation.classifyWords()

    assertEquals(Sentence.SentenceType.STATEMENT, sentence.getType());

    sentence = new SentenceImplementation(ctx, "does it fit");
    parser = new ConversationParser(sentence);
    sentence.parse(parser);
    sentence.classifyWords(parser);
    assertFalse(sentence.hasError());
    assertEquals("do/VER it/OBJ-PRO fit/VER", sentence.toString());
    assertEquals(Sentence.SentenceType.QUESTION, sentence.evaluateSentenceType());
    assertEquals("it/OBJ-PRO fit/VER?", 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.