|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucot.ModuleProperties
ucot.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
|
private java.util.logging.Logger |
logger
|
static java.lang.String |
name
|
private java.util.Properties |
options
|
private boolean |
optionsChanged
|
(package private) edu.stanford.nlp.parser.lexparser.LexicalizedParser |
parser
|
static java.lang.String |
PARSER_FILE
|
Fields inherited from class ucot.ModuleProperties |
---|
properties, propertiesURL |
Constructor Summary | |
---|---|
StanfordAdapter()
|
Method Summary | |
---|---|
void |
applyProperties()
Applies current properties for the module. |
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 |
loadDefaultProperties()
Method which returns the factory default properties for the module. |
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)
|
java.lang.String |
toString()
|
private void |
updateFromOptions()
Updates internal parser field to match given options. |
Methods inherited from class ucot.ModuleProperties |
---|
getProperties, loadProperties, saveProperties, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ucot.ModulePropertyInterface |
---|
getProperties, loadProperties, saveProperties, setProperties |
Field Detail |
---|
public static final java.lang.String name
private java.util.logging.Logger logger
public static final java.lang.String PARSER_FILE
private 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
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)
ParserInterface
parse
in interface ParserInterface
useCase
- Use case to parse.
public java.util.Properties loadDefaultProperties()
ModulePropertyInterface
loadDefaultProperties
in interface ModulePropertyInterface
loadDefaultProperties
in class ModuleProperties
ModulePropertyInterface.loadDefaultProperties()
public void applyProperties() throws BadPropertyValueException
ModulePropertyInterface
applyProperties
in interface ModulePropertyInterface
applyProperties
in class ModuleProperties
BadPropertyValueException
- In this case exception
is thrown only if either the given parser or heuristic
does not exist.ModulePropertyInterface.applyProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |