public class HeadRule extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HeadRule.HeadRuleEntry
Entry of head rule.
|
static class |
HeadRule.ScanDirection |
| Modifier and Type | Method and Description |
|---|---|
void |
addEntry(String category,
HeadRule.ScanDirection direction,
List<String> priorityList)
Adds rule entry
|
void |
apply(ParseTreeNode tree)
Applys head rule and sets head index each node in the parse tree.
|
static HeadRule |
createDefaultRule()
Creates
HeadRule |
static HeadRule |
getDefaultRule()
Returns default rule instance.
|
int |
getHead(ParseTreeNode node)
Returns head element's index in node's children.
|
static HeadRule |
getRule(File file)
Returns rule instance which is read from file.
|
static HeadRule |
getRule(Reader in)
Returns rule instance which is read from
java.io.Reader object. |
public static HeadRule createDefaultRule()
HeadRule which has default rules.public static HeadRule getDefaultRule()
public static HeadRule getRule(Reader in) throws IOException, InvalidFormatException
java.io.Reader object.in - IOExceptionInvalidFormatExceptionpublic static HeadRule getRule(File file) throws IOException, InvalidFormatException
file - IOExceptionInvalidFormatExceptionpublic int getHead(ParseTreeNode node)
node - target parse tree nodepublic void apply(ParseTreeNode tree)
tree - public void addEntry(String category, HeadRule.ScanDirection direction, List<String> priorityList)
category - target categorydirection - scan directionpriorityList - head priority listCopyright © 2016 New York University. All rights reserved.