Package edu.washington.cs.knowitall.nlp

Examples of edu.washington.cs.knowitall.nlp.OpenNlpSentenceChunker

  public void testMatcher6() throws Exception {

    String patternStr = "B-NP_np I-NP_np* from_word the_word B-NP_np I-NP_np*";
    LayeredTokenPattern pattern = new LayeredTokenPattern(patternStr);
    OpenNlpSentenceChunker chunker = new OpenNlpSentenceChunker();   
    pattern.matcher(chunker.chunkSentence("Hello, world."));
View Full Code Here

    public static void main(String[] args) throws Exception {

        String sentStr = "Michael McGinn is the mayor of Seattle.";

        // Looks on the classpath for the default model files.
        OpenNlpSentenceChunker chunker = new OpenNlpSentenceChunker();
        ChunkedSentence sent = chunker.chunkSentence(sentStr);

        // Prints out the (token, tag, chunk-tag) for the sentence
        for (int i = 0; i < sent.getLength(); i++) {
            String token = sent.getToken(i);
View Full Code Here


Related Classes of edu.washington.cs.knowitall.nlp.OpenNlpSentenceChunker

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