|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectenumeration.conversion.Converter
public class Converter
Conversion between concise tree and parse tree or sentence.
Constructor Summary | |
---|---|
Converter()
Creates an instance of converter |
Method Summary | |
---|---|
static java.lang.String |
composeTree(java.lang.String head,
java.lang.String[] subtree)
Composes the concise tree "head{subtree[0],...,subtree[subtree.length-1]}" |
static java.lang.String |
conciseTree(int n,
int i,
int j)
Constructs the concise tree "(n,i,j)" |
static java.lang.String[] |
decomposeTree(java.lang.String tree,
int[] intHead)
Decomposes a given concise tree into intHead and tail |
static int[] |
decomposeTreeHead(java.lang.String tree,
int[] intHead)
Decomposes the head of a given concise tree into intHead |
static java.lang.String |
fromParseTree(MyGrammar grammar,
java.lang.String ptree)
Converts a parse tree to a concise tree |
static java.lang.String |
fromSentence(MyGrammar grammar,
java.lang.String sentence)
Converts a sentence to a concise tree |
static MySentence |
toMySentence(MyGrammar grammar,
java.lang.String tree)
Converts a concise tree to a sentence |
static java.lang.String |
toParseTree(MyGrammar grammar,
java.lang.String tree)
Converts a concise tree to a parse tree |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Converter()
Method Detail |
---|
public static java.lang.String conciseTree(int n, int i, int j)
n
- the hierarchy indexi
- the variable indexj
- the production sequence number whose RHS is i.
public static java.lang.String composeTree(java.lang.String head, java.lang.String[] subtree)
head
- the head part of the concise treesubtree
- the tail subtrees of the concise tree
public static java.lang.String[] decomposeTree(java.lang.String tree, int[] intHead)
tree
- the concise tree to decomposeintHead
- the head integer values
public static int[] decomposeTreeHead(java.lang.String tree, int[] intHead)
tree
- the concise tree to decomposeintHead
- the head integer valuespublic static java.lang.String toParseTree(MyGrammar grammar, java.lang.String tree)
grammar
- the grammar for enumerationtree
- the given concise tree
public static MySentence toMySentence(MyGrammar grammar, java.lang.String tree)
grammar
- the grammar for enumerationtree
- the given concise tree
public static java.lang.String fromSentence(MyGrammar grammar, java.lang.String sentence)
grammar
- the grammar for enumerationsentence
- the given sentence
public static java.lang.String fromParseTree(MyGrammar grammar, java.lang.String ptree)
grammar
- the grammar for enumerationptree
- the given parse tree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |