edu.washington.cs.knowitall.nlp
Class OpenNlpChunkedSentenceParser

java.lang.Object
  extended by edu.washington.cs.knowitall.nlp.OpenNlpChunkedSentenceParser

public class OpenNlpChunkedSentenceParser
extends java.lang.Object

A utility class for "parsing" the output of the OpenNLP command line chunker. The command line chunker returns strings in this form: [NP JFK/NNP] [VP was/VBD elected/VBN] [NP president/NN] [PP in/IN] [NP 1960/CD] ./. This class converts that String representation into a NpChunkedSentence object.

Author:
afader

Constructor Summary
OpenNlpChunkedSentenceParser()
           
 
Method Summary
 boolean attachOfs()
           
 void attachOfs(boolean attachOfs)
           
 boolean attachPossessives()
           
 void attachPossessives(boolean attachPossessives)
           
 ChunkedSentence parseSentence(java.lang.String sent)
          Converts sent into a NpChunkedSentence object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenNlpChunkedSentenceParser

public OpenNlpChunkedSentenceParser()
Method Detail

attachOfs

public boolean attachOfs()
Returns:
true if this object will attach NPs beginning with "of" with the previous NP.

attachPossessives

public boolean attachPossessives()
Returns:
true if this object will attach NPs beginning with the tag POS with the previous NP.

attachOfs

public void attachOfs(boolean attachOfs)
Parameters:
attachOfs -

attachPossessives

public void attachPossessives(boolean attachPossessives)
Parameters:
attachPossessives -

parseSentence

public ChunkedSentence parseSentence(java.lang.String sent)
                              throws java.lang.IllegalArgumentException
Converts sent into a NpChunkedSentence object.

Parameters:
sent -
Returns:
a NpChunkedSentence representation of sent.
Throws:
java.lang.IllegalArgumentException - if sent is malformed.