public class CoNLLDependencyExtractor extends Object implements DependencyExtractor
DependencyTreeNode
innstances. The nodes contain relations between each word in the sentence.
The nodes in the returned array are ordered by the ordering of word
occurrences.
This class optionally supports filtering sentences to remove words. The
nodes for those removed words will still remain in the parse tree.
Similarly, the relations connecting the removed words will also existing.
However, the DependencyTreeNode.word()
method will return IteratorFactory.EMPTY_TOKEN
to indicate that the node's text was filtered
out. Note that the node will still have the original part of speech.Constructor and Description |
---|
CoNLLDependencyExtractor()
Creates a new
CoNLLDependencyExtractor that assumes the default
ordering for Malt dependency parses. |
CoNLLDependencyExtractor(String configFile)
Creates a new
CoNLLDependencyExtractor by parsing a Malt
configuration file, which specifies the order in which the output is
formatted. |
CoNLLDependencyExtractor(String configFile,
TokenFilter filter,
Stemmer stemmer)
Creates a new
CoNLLDependencyExtractor by parsing a Malt
configuration file, which specifies the order in which the output is
formatted and uses the given TokenFilter and Stemmer . |
CoNLLDependencyExtractor(TokenFilter filter,
Stemmer stemmer)
Creates a new
CoNLLDependencyExtractor that assumes the default
ordering for Malt dependency parses and uses the given TokenFilter and Stemmer . |
CoNLLDependencyExtractor(TokenFilter filter,
Stemmer stemmer,
int idIndex,
int formIndex,
int lemmaIndex,
int posIndex,
int parentIndex,
int relationIndex)
Creates a new
CoNLLDependencyExtractor that assumes the default
ordering for Malt dependency parses and uses the given TokenFilter and Stemmer and the given indices for each feature. |
Modifier and Type | Method and Description |
---|---|
DependencyTreeNode[] |
readNextTree(BufferedReader reader)
Extracts a dependency parse tree from the provided reader.
|
public CoNLLDependencyExtractor()
CoNLLDependencyExtractor
that assumes the default
ordering for Malt
dependency parses.public CoNLLDependencyExtractor(TokenFilter filter, Stemmer stemmer)
CoNLLDependencyExtractor
that assumes the default
ordering for Malt
dependency parses and uses the given TokenFilter
and Stemmer
.public CoNLLDependencyExtractor(TokenFilter filter, Stemmer stemmer, int idIndex, int formIndex, int lemmaIndex, int posIndex, int parentIndex, int relationIndex)
CoNLLDependencyExtractor
that assumes the default
ordering for Malt
dependency parses and uses the given TokenFilter
and Stemmer
and the given indices for each feature.public CoNLLDependencyExtractor(String configFile)
CoNLLDependencyExtractor
by parsing a Malt
configuration file, which specifies the order in which the output is
formatted.public CoNLLDependencyExtractor(String configFile, TokenFilter filter, Stemmer stemmer)
CoNLLDependencyExtractor
by parsing a Malt
configuration file, which specifies the order in which the output is
formatted and uses the given TokenFilter
and Stemmer
.public DependencyTreeNode[] readNextTree(BufferedReader reader) throws IOException
readNextTree
in interface DependencyExtractor
reader
- a reader containing one or more parse trees in the CoNLL
formatDependencyTreeNode
s that compose a dependency
tree, or null
if no tree is present in the reader.IOException
- when errors are encountered during readingCopyright © 2012. All Rights Reserved.