|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucot.parser.StanfordAdapter
public class StanfordAdapter
Parser that uses Stanford parser to parse te sentence.
Field Summary | |
---|---|
private edu.stanford.nlp.trees.GrammaticalStructureFactory |
gsf
|
private static java.lang.String[] |
ignoreArray
|
private static java.util.Set<java.lang.String> |
ignoreInNP
|
(package private) java.util.logging.Logger |
logger
|
(package private) java.util.Properties |
options
|
private boolean |
optionsChanged
|
(package private) edu.stanford.nlp.parser.lexparser.LexicalizedParser |
parser
|
static java.lang.String |
PARSER_FILE
|
Constructor Summary | |
---|---|
StanfordAdapter()
|
Method Summary | |
---|---|
private java.lang.String |
buildNounPhrase(edu.stanford.nlp.trees.Tree leaf,
edu.stanford.nlp.trees.Tree root)
Builds noun phrase that the leaf represents. |
private edu.stanford.nlp.trees.Tree |
getFirst(java.util.Collection<java.lang.String> names,
edu.stanford.nlp.trees.Tree leaf,
edu.stanford.nlp.trees.Tree root)
Returns first branch which name exists in given collection. |
private edu.stanford.nlp.trees.Tree |
getFirst(java.lang.String[] names,
edu.stanford.nlp.trees.Tree leaf,
edu.stanford.nlp.trees.Tree root)
Returns first branch which name exists in given array. |
private edu.stanford.nlp.trees.Tree |
getHighest(java.lang.String name,
edu.stanford.nlp.trees.Tree leaf,
edu.stanford.nlp.trees.Tree root)
Returns the highest branch called by spesific name. |
java.lang.String |
getName()
Returns adapter's name |
java.util.Properties |
getOptions()
Returns adapter's options |
ParsedData |
parse(UseCase useCase)
Parses given usecase and returns parsed data as a ParsedData object. |
private void |
printTree(edu.stanford.nlp.trees.Tree startTree,
java.util.List<edu.stanford.nlp.trees.Tree> parents)
|
void |
setOptions(java.util.Properties options)
Sets options for the adapter |
java.lang.String |
toString()
|
private void |
updateFromOptions()
Updates internal parser field to match given options. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.util.logging.Logger logger
public static final java.lang.String PARSER_FILE
java.util.Properties options
private boolean optionsChanged
edu.stanford.nlp.parser.lexparser.LexicalizedParser parser
private edu.stanford.nlp.trees.GrammaticalStructureFactory gsf
private static final java.util.Set<java.lang.String> ignoreInNP
private static final java.lang.String[] ignoreArray
Constructor Detail |
---|
public StanfordAdapter()
Method Detail |
---|
public java.lang.String getName()
ParserInterface
getName
in interface ParserInterface
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Properties getOptions()
ParserInterface
getOptions
in interface ParserInterface
private void updateFromOptions()
private void printTree(edu.stanford.nlp.trees.Tree startTree, java.util.List<edu.stanford.nlp.trees.Tree> parents)
private java.lang.String buildNounPhrase(edu.stanford.nlp.trees.Tree leaf, edu.stanford.nlp.trees.Tree root)
leaf
- root
- The root of the whole tree.
private edu.stanford.nlp.trees.Tree getHighest(java.lang.String name, edu.stanford.nlp.trees.Tree leaf, edu.stanford.nlp.trees.Tree root)
name
- The name we are interested of.leaf
- The leaf we start looking from.root
- The root of the whole tree.
private edu.stanford.nlp.trees.Tree getFirst(java.lang.String[] names, edu.stanford.nlp.trees.Tree leaf, edu.stanford.nlp.trees.Tree root)
names
- The array of names we are interested in.leaf
- The leaf searching starts.root
- The root of the whole tree.
private edu.stanford.nlp.trees.Tree getFirst(java.util.Collection<java.lang.String> names, edu.stanford.nlp.trees.Tree leaf, edu.stanford.nlp.trees.Tree root)
names
- The collection of names we are interested in.leaf
- The leaf searching starts.root
- The root of the whole tree.
public ParsedData parse(UseCase useCase) throws java.lang.Exception
ParserInterface
parse
in interface ParserInterface
java.lang.Exception
public void setOptions(java.util.Properties options)
ParserInterface
setOptions
in interface ParserInterface
options
- options for the adapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |