public class ChineseGrammaticalStructure extends GrammaticalStructure
Modifier and Type | Class and Description |
---|---|
static class |
ChineseGrammaticalStructure.FromDependenciesFactory |
allTypedDependencies, CoNLLX_FieldCount, CoNLLX_GovField, CoNLLX_POSField, CoNLLX_RelnField, CoNLLX_WordField, DEFAULT_PARSER_FILE, puncFilter, root, typedDependencies
Constructor and Description |
---|
ChineseGrammaticalStructure(List<TypedDependency> projectiveDependencies,
TreeGraphNode root)
Used for postprocessing CoNLL X dependencies
|
ChineseGrammaticalStructure(Tree t)
Construct a new
GrammaticalStructure from an
existing parse tree. |
ChineseGrammaticalStructure(Tree t,
HeadFinder hf) |
ChineseGrammaticalStructure(Tree t,
java.util.function.Predicate<String> puncFilter) |
ChineseGrammaticalStructure(Tree t,
java.util.function.Predicate<String> puncFilter,
HeadFinder hf) |
Modifier and Type | Method and Description |
---|---|
static ChineseGrammaticalStructure |
buildCoNLLXGrammaticalStructure(List<List<String>> tokenFields) |
protected void |
collapseDependencies(List<TypedDependency> list,
boolean CCprocess,
boolean includeExtras)
Destructively modify the
Collection<TypedDependency> to collapse
language-dependent transitive dependencies. |
static void |
main(String[] args)
Tests generation of Chinese grammatical relations from a file.
|
static List<GrammaticalStructure> |
readCoNLLXGrammaticalStructureCollection(String fileName) |
allTypedDependencies, buildCoNLLXGrammaticalStructure, collapseDependenciesTree, correctDependencies, dependenciesToString, extraTreeDepFilter, fromStringReps, getExtras, getGrammaticalRelation, getGrammaticalRelation, getRoots, isConnected, postProcessDependencies, printDependencies, readCoNLLXGrammaticalStructureCollection, root, toString, typedDependencies, typedDependencies, typedDependenciesCCprocessed, typedDependenciesCCprocessed, typedDependenciesCollapsed, typedDependenciesCollapsed, typedDependenciesCollapsedTree
public ChineseGrammaticalStructure(Tree t)
GrammaticalStructure
from an
existing parse tree. The new GrammaticalStructure
has the same tree structure and label values as the given tree
(but no shared storage). As part of construction, the parse tree
is analyzed using definitions from GrammaticalRelation
to populate the new
GrammaticalStructure
with as many labeled
grammatical relations as it can.t
- Tree to processpublic ChineseGrammaticalStructure(Tree t, java.util.function.Predicate<String> puncFilter)
public ChineseGrammaticalStructure(Tree t, HeadFinder hf)
public ChineseGrammaticalStructure(Tree t, java.util.function.Predicate<String> puncFilter, HeadFinder hf)
public ChineseGrammaticalStructure(List<TypedDependency> projectiveDependencies, TreeGraphNode root)
protected void collapseDependencies(List<TypedDependency> list, boolean CCprocess, boolean includeExtras)
GrammaticalStructure
Collection<TypedDependency>
to collapse
language-dependent transitive dependencies.
Default is no-op; to be over-ridden in subclasses.collapseDependencies
in class GrammaticalStructure
list
- A list of dependencies to process for possible collapsingCCprocess
- apply CC process?public static void main(String[] args)
java edu.stanford.nlp.trees.international.pennchinese.ChineseGrammaticalStructure -treeFile [treeFile]
java edu.stanford.nlp.trees.international.pennchinese.ChineseGrammaticalStructure -sentFile [sentenceFile]
args
- Command line args as abovepublic static List<GrammaticalStructure> readCoNLLXGrammaticalStructureCollection(String fileName) throws IOException
IOException
public static ChineseGrammaticalStructure buildCoNLLXGrammaticalStructure(List<List<String>> tokenFields)