|
| static String[] | find (@SuppressWarnings("SameParameterValue") final String regExp, final String negativeRegExp, final String... annotations) |
| |
| static List< String > | findAnnotationValues (final String annotationName, final String... annotations) |
| |
| static String[] | makeWordAnnotations (@SuppressWarnings("SameParameterValue") final String... annotations) |
| |
| static List< String > | makeTokens (final String... annotations) |
| |
| static List< String > | makePoses (final String... annotations) |
| |
| static int | indexLeaves (final Tree node, final int startIndex0, final Map< Tree, Integer > indices) |
| |
| static int | indexNodes (final Tree node, final int startIndex0, final Map< Tree, Integer > indices) |
| |
| static int | indexLeaves (final TreeGraphNode node, final int startIndex0) |
| |
| static int | indexNodes (final TreeGraphNode node, final int startIndex0) |
| |
Helpers
- Author
- Bernard Bou
◆ IOHelpers()
| grammarscope.server.io.readwrite.IOHelpers.IOHelpers |
( |
| ) |
|
|
private |
◆ find()
| static String [] grammarscope.server.io.readwrite.IOHelpers.find |
( |
@SuppressWarnings("SameParameterValue") final String |
regExp, |
|
|
final String |
negativeRegExp, |
|
|
final String... |
annotations |
|
) |
| |
|
staticprivate |
Find
- Parameters
-
| regExp | positive regexpr |
| negativeRegExp | negative regexpr |
| annotations | annotation source strings |
- Returns
- strings matching positive regexpr and not matching negative regexpr
◆ findAnnotationValues()
| static List<String> grammarscope.server.io.readwrite.IOHelpers.findAnnotationValues |
( |
final String |
annotationName, |
|
|
final String... |
annotations |
|
) |
| |
|
staticprivate |
Find annotation values
- Parameters
-
| annotationName | annotation name |
| annotations | annotation source strings |
- Returns
- list of values
◆ indexLeaves() [1/2]
| static int grammarscope.server.io.readwrite.IOHelpers.indexLeaves |
( |
final Tree |
node, |
|
|
final int |
startIndex0, |
|
|
final Map< Tree, Integer > |
indices |
|
) |
| |
|
staticprivate |
Helper (private function) Assign sequential integer indices to the leaves of the subtree rooted at this Tree, beginning with startIndex, and traversing the leaves from left to right. If node is already indexed, then it uses the existing index.
- Parameters
-
| node | node |
| startIndex0 | index for this node |
| indices | index map |
- Returns
- the next index still unassigned
◆ indexLeaves() [2/2]
| static int grammarscope.server.io.readwrite.IOHelpers.indexLeaves |
( |
final TreeGraphNode |
node, |
|
|
final int |
startIndex0 |
|
) |
| |
|
staticprivate |
Helper (private function) Assign sequential integer indices to the leaves of the subtree rooted at this TreeGraphNode, beginning with startIndex, and traversing the leaves from left to right. If node is already indexed, then it uses the existing index.
- Parameters
-
| node | node |
| startIndex0 | index for this node |
- Returns
- the next index still unassigned
◆ indexNodes() [1/4]
| static int grammarscope.server.io.readwrite.IOHelpers.indexNodes |
( |
final Tree |
node, |
|
|
final int |
startIndex0, |
|
|
final Map< Tree, Integer > |
indices |
|
) |
| |
|
staticprivate |
Assign sequential integer indices to all nodes of the subtree rooted at this TreeGraphNode, beginning with startIndex, and doing a pre-order tree traversal. Any node which already has an index will not be re-indexed — this is so that we can index the leaves first, and then index the rest.
- Parameters
-
| node | node |
| startIndex0 | index for this node |
| indices | index map |
- Returns
- the next index still unassigned
◆ indexNodes() [2/4]
| static void grammarscope.server.io.readwrite.IOHelpers.indexNodes |
( |
final Tree |
node, |
|
|
final Map< Tree, Integer > |
indices |
|
) |
| |
|
static |
Assign sequential integer indices (starting with 0) to all nodes of the subtree rooted at this TreeGraphNode. The leaves are indexed first, from left to right. Then the internal nodes are indexed, using a pre-order tree traversal.
- Parameters
-
| node | node |
| indices | index map |
◆ indexNodes() [3/4]
| static void grammarscope.server.io.readwrite.IOHelpers.indexNodes |
( |
final TreeGraphNode |
node | ) |
|
|
static |
Assign sequential integer indices (starting with 0) to all nodes of the subtree rooted at this TreeGraphNode. The leaves are indexed first, from left to right. Then the internal nodes are indexed, using a pre-order tree traversal.
- Parameters
-
◆ indexNodes() [4/4]
| static int grammarscope.server.io.readwrite.IOHelpers.indexNodes |
( |
final TreeGraphNode |
node, |
|
|
final int |
startIndex0 |
|
) |
| |
|
staticprivate |
Assign sequential integer indices to all nodes of the subtree rooted at this TreeGraphNode, beginning with startIndex, and doing a pre-order tree traversal. Any node which already has an index will not be re-indexed — this is so that we can index the leaves first, and then index the rest.
- Parameters
-
| node | node |
| startIndex0 | index for this node |
- Returns
- the next index still unassigned
◆ main()
| static void grammarscope.server.io.readwrite.IOHelpers.main |
( |
final String[] |
args | ) |
|
|
static |
◆ makeAllAnnotations()
| static String [] grammarscope.server.io.readwrite.IOHelpers.makeAllAnnotations |
( |
@SuppressWarnings("SameParameterValue") final String... |
annotations | ) |
|
|
staticpackage |
Extract all annotations
- Parameters
-
| annotations | annotation source strings |
- Returns
- list of annotation strings
◆ makeNodeAnnotations()
| static Map<String, String> grammarscope.server.io.readwrite.IOHelpers.makeNodeAnnotations |
( |
final String... |
annotations | ) |
|
|
static |
Extract node annotations
- Parameters
-
| annotations | annotation source string |
- Returns
- node-indexed annotation strings
◆ makePoses()
| static List<String> grammarscope.server.io.readwrite.IOHelpers.makePoses |
( |
final String... |
annotations | ) |
|
|
staticprivate |
Make parts-of-speech
- Parameters
-
| annotations | annotation string |
- Returns
- list of parts-of-speech tags
◆ makeProjectiveDependencies()
| static List<TypedDependency> grammarscope.server.io.readwrite.IOHelpers.makeProjectiveDependencies |
( |
final String |
str | ) |
|
|
static |
Make projective dependencies
- Parameters
-
| str | source string for typed dependencies |
- Returns
- typed dependencies
◆ makeTokens()
| static List<String> grammarscope.server.io.readwrite.IOHelpers.makeTokens |
( |
final String... |
annotations | ) |
|
|
staticprivate |
Make tokens
- Parameters
-
| annotations | annotation string |
- Returns
- list of string tokens
◆ makeWordAnnotations()
| static String [] grammarscope.server.io.readwrite.IOHelpers.makeWordAnnotations |
( |
@SuppressWarnings("SameParameterValue") final String... |
annotations | ) |
|
|
staticprivate |
Extract words
- Parameters
-
| annotations | annotation source string |
- Returns
- list of words
◆ nameValuesToString()
| static String grammarscope.server.io.readwrite.IOHelpers.nameValuesToString |
( |
final String |
nameValues[][] | ) |
|
|
staticpackage |
Array of name values to String
- Parameters
-
| nameValues | name-value array |
- Returns
- string
◆ stripAnnotations()
| static String grammarscope.server.io.readwrite.IOHelpers.stripAnnotations |
( |
final String |
annotationString | ) |
|
|
static |
Strip annotation string
- Parameters
-
| annotationString | annotation string |
- Returns
- string without annotation
◆ annotationsRegExp
| final String grammarscope.server.io.readwrite.IOHelpers.annotationsRegExp = "\\{([^\\}]*)" |
|
staticprivate |
Regexpr matching all annotations attached to node
◆ idRegExp
| final String grammarscope.server.io.readwrite.IOHelpers.idRegExp = "([^\\]\\{]*)" |
|
staticprivate |
◆ simpleValueRegExp
| final String grammarscope.server.io.readwrite.IOHelpers.simpleValueRegExp = "[a-zA-Z\\-0-9]*" |
|
staticprivate |
Regexpr matching annotation value
The documentation for this class was generated from the following file:
- grammarscope/server/src/main/java/grammarscope/server/io/readwrite/IOHelpers.java