public class SemanticGraphFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SemanticGraphFactory.Mode |
Modifier and Type | Method and Description |
---|---|
static SemanticGraph |
deepCopyFromGraphs(java.util.List<SemanticGraph> graphs,
java.util.List<java.lang.Integer> lengths)
Like makeFromGraphs, but it makes a deep copy of the graphs and
renumbers the index words.
|
static SemanticGraph |
duplicateKeepNodes(SemanticGraph sg)
This creates a new graph based off the given, but uses the existing nodes objects.
|
static SemanticGraph |
generateCCProcessedDependencies(GrammaticalStructure gs)
Deprecated.
|
static SemanticGraph |
generateCCProcessedDependencies(GrammaticalStructure gs,
GrammaticalStructure.Extras extras)
Deprecated.
|
static SemanticGraph |
generateCCProcessedDependencies(Tree tree)
Deprecated.
|
static SemanticGraph |
generateCollapsedDependencies(GrammaticalStructure gs)
Deprecated.
|
static SemanticGraph |
generateCollapsedDependencies(GrammaticalStructure gs,
GrammaticalStructure.Extras extras)
Deprecated.
|
static SemanticGraph |
generateCollapsedDependencies(Tree tree)
Deprecated.
|
static SemanticGraph |
generateEnhancedDependencies(GrammaticalStructure gs)
Produces an enhanced dependencies SemanticGraph.
|
static SemanticGraph |
generateEnhancedDependencies(Tree tree)
Produces an enhanced dependencies SemanticGraph.
|
static SemanticGraph |
generateEnhancedPlusPlusDependencies(GrammaticalStructure gs)
Produces an enhanced++ dependencies SemanticGraph.
|
static SemanticGraph |
generateEnhancedPlusPlusDependencies(Tree tree)
Produces an enhanced++ dependencies SemanticGraph.
|
static SemanticGraph |
generateUncollapsedDependencies(GrammaticalStructure gs)
Produces an Uncollapsed (basic) SemanticGraph.
|
static SemanticGraph |
generateUncollapsedDependencies(GrammaticalStructure gs,
GrammaticalStructure.Extras extras)
Deprecated.
|
static SemanticGraph |
generateUncollapsedDependencies(Tree tree)
Produces an Uncollapsed (basic) SemanticGraph.
|
static SemanticGraph |
makeFromEdges(java.lang.Iterable<SemanticGraphEdge> edges)
Given a list of edges, attempts to create and return a rooted SemanticGraph.
|
static SemanticGraph |
makeFromGraphs(java.util.Collection<SemanticGraph> sgList)
Given a list of graphs, constructs a new graph combined from the
collection of graphs.
|
static SemanticGraph |
makeFromTree(GrammaticalStructure structure) |
static SemanticGraph |
makeFromTree(GrammaticalStructure tree,
SemanticGraphFactory.Mode mode,
boolean includeExtras,
java.util.function.Predicate<TypedDependency> filter)
Deprecated.
|
static SemanticGraph |
makeFromTree(GrammaticalStructure gs,
SemanticGraphFactory.Mode mode,
GrammaticalStructure.Extras includeExtras,
java.util.function.Predicate<TypedDependency> filter) |
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
boolean includeExtras)
Deprecated.
|
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
boolean includeExtras,
java.util.function.Predicate<TypedDependency> filter)
Deprecated.
|
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
GrammaticalStructure.Extras includeExtras) |
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
GrammaticalStructure.Extras includeExtras,
java.util.function.Predicate<TypedDependency> filter) |
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
GrammaticalStructure.Extras includeExtras,
java.util.function.Predicate<TypedDependency> filter,
boolean originalDependencies) |
static SemanticGraph |
makeFromTree(Tree tree,
SemanticGraphFactory.Mode mode,
GrammaticalStructure.Extras includeExtras,
java.util.function.Predicate<TypedDependency> filter,
boolean originalDependencies,
boolean includePunctuationDependencies)
Returns a new
SemanticGraph constructed from a given Tree with given options. |
static SemanticGraph |
makeFromVertices(SemanticGraph sg,
java.util.Collection<IndexedWord> nodes)
Given a set of vertices, and the source graph they are drawn from, create a path composed
of the minimum paths between the vertices.
|
public static SemanticGraph generateUncollapsedDependencies(Tree tree)
@Deprecated public static SemanticGraph generateCollapsedDependencies(Tree tree)
generateEnhancedDependencies(Tree)
or
generateEnhancedPlusPlusDependencies(Tree)
instead.@Deprecated public static SemanticGraph generateCCProcessedDependencies(Tree tree)
generateEnhancedDependencies(Tree)
or
generateEnhancedPlusPlusDependencies(Tree)
instead.public static SemanticGraph generateEnhancedDependencies(Tree tree)
public static SemanticGraph generateEnhancedPlusPlusDependencies(Tree tree)
public static SemanticGraph generateUncollapsedDependencies(GrammaticalStructure gs)
@Deprecated public static SemanticGraph generateCollapsedDependencies(GrammaticalStructure gs)
generateEnhancedDependencies(GrammaticalStructure)
or
generateEnhancedPlusPlusDependencies(GrammaticalStructure)
instead.@Deprecated public static SemanticGraph generateCCProcessedDependencies(GrammaticalStructure gs)
generateEnhancedDependencies(GrammaticalStructure)
or
generateEnhancedPlusPlusDependencies(GrammaticalStructure)
instead.public static SemanticGraph generateEnhancedDependencies(GrammaticalStructure gs)
public static SemanticGraph generateEnhancedPlusPlusDependencies(GrammaticalStructure gs)
@Deprecated public static SemanticGraph generateUncollapsedDependencies(GrammaticalStructure gs, GrammaticalStructure.Extras extras)
generateUncollapsedDependencies(GrammaticalStructure)
instead.UniversalEnglishGrammaticalStructure
.@Deprecated public static SemanticGraph generateCollapsedDependencies(GrammaticalStructure gs, GrammaticalStructure.Extras extras)
generateEnhancedDependencies(GrammaticalStructure)
or
generateEnhancedPlusPlusDependencies(GrammaticalStructure)
instead.@Deprecated public static SemanticGraph generateCCProcessedDependencies(GrammaticalStructure gs, GrammaticalStructure.Extras extras)
generateEnhancedDependencies(GrammaticalStructure)
or
generateEnhancedPlusPlusDependencies(GrammaticalStructure)
instead.public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, GrammaticalStructure.Extras includeExtras, java.util.function.Predicate<TypedDependency> filter, boolean originalDependencies)
public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, GrammaticalStructure.Extras includeExtras, java.util.function.Predicate<TypedDependency> filter, boolean originalDependencies, boolean includePunctuationDependencies)
SemanticGraph
constructed from a given Tree
with given options.
This factory method is intended to replace a profusion of highly similar
factory methods, such as
typedDependencies()
,
typedDependenciesCollapsed()
,
allTypedDependencies()
,
allTypedDependenciesCollapsed()
, etc.
For a fuller explanation of the meaning of the boolean arguments, see
GrammaticalStructure
.tree
- A tree representing a phrase structure parseincludeExtras
- Whether to include extra dependencies, which may
result in a non-treefilter
- A filter to exclude certain dependencies; ignored if nulloriginalDependencies
- generate original Stanford dependencies instead of new
Universal Dependenciespublic static SemanticGraph makeFromTree(GrammaticalStructure gs, SemanticGraphFactory.Mode mode, GrammaticalStructure.Extras includeExtras, java.util.function.Predicate<TypedDependency> filter)
@Deprecated public static SemanticGraph makeFromTree(GrammaticalStructure tree, SemanticGraphFactory.Mode mode, boolean includeExtras, java.util.function.Predicate<TypedDependency> filter)
public static SemanticGraph makeFromTree(GrammaticalStructure structure)
public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, GrammaticalStructure.Extras includeExtras, java.util.function.Predicate<TypedDependency> filter)
@Deprecated public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, boolean includeExtras, java.util.function.Predicate<TypedDependency> filter)
public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, GrammaticalStructure.Extras includeExtras)
@Deprecated public static SemanticGraph makeFromTree(Tree tree, SemanticGraphFactory.Mode mode, boolean includeExtras)
public static SemanticGraph makeFromEdges(java.lang.Iterable<SemanticGraphEdge> edges)
public static SemanticGraph makeFromVertices(SemanticGraph sg, java.util.Collection<IndexedWord> nodes)
public static SemanticGraph duplicateKeepNodes(SemanticGraph sg)
public static SemanticGraph makeFromGraphs(java.util.Collection<SemanticGraph> sgList)
public static SemanticGraph deepCopyFromGraphs(java.util.List<SemanticGraph> graphs, java.util.List<java.lang.Integer> lengths)
lengths
must be a vector containing the number of
tokens in each sentence. This is used to reindex the tokens.