edu.washington.cs.knowitall.nlp
Class OpenNlpChunkedSentenceParser
java.lang.Object
edu.washington.cs.knowitall.nlp.OpenNlpChunkedSentenceParser
public class OpenNlpChunkedSentenceParser
- extends 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 ChunkedSentence
object.
- Author:
- afader
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OpenNlpChunkedSentenceParser
public OpenNlpChunkedSentenceParser()
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(String sent)
throws ParseException
- Converts sent into a
ChunkedSentence object.
- Parameters:
sent -
- Returns:
- the chunked representation
- Throws:
ParseException - if sent is malformed.
Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.