public class TreeIO extends Object
Modifier and Type | Field and Description |
---|---|
static String |
INDENTIFIER |
static char |
LRB
The left parenthesis character within the tree
|
static char |
RRB
The right parenthesis character within the tree
|
Constructor and Description |
---|
TreeIO() |
Modifier and Type | Method and Description |
---|---|
protected TreeNode |
_parseCharniakSentence(String sentence,
TreeNode father,
Integer nodeCounter)
This recursive function allows to read the tree encoded in a string in
the parentheses form, such as (S(NP)(VP))
|
protected String |
_preprocess(String inputString)
This function cleans the input string, such as from spaces, before the
parsing phase.
|
TreeNode |
parseCharniakSentence(String sentence)
This method allows to read a tree in the form (S(NP)(VP)) and returns the TreeNode
corresponding to the root of the tree
|
protected TreeNode |
parseNode(int nodeCounter,
String nodeStr,
TreeNode father) |
public static final String INDENTIFIER
public static final char LRB
public static final char RRB
public TreeNode parseCharniakSentence(String sentence) throws TreeIOException
sentence
- The input StringTreeIOException
- his exception is thrown if any problem in the tree IO phase is
experimentedprotected TreeNode _parseCharniakSentence(String sentence, TreeNode father, Integer nodeCounter) throws TreeIOException
sentence
- father
- nodeCounter
- TreeIOException
protected TreeNode parseNode(int nodeCounter, String nodeStr, TreeNode father) throws InstantiationException
InstantiationException
Copyright © 2015 Semantic Analytics Group @ Uniroma2. All rights reserved.