|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
Grammar
AugmentedGrammar
HeadFeaturedGrammar
GapFeaturedGrammar
An GapFeaturedGrammar is one whose rules are HeadFeaturedGrammarRules whose constituents can contain a GAP feature.
The difference between this and a HeadFeaturedGrammar is the special expansion of rules that have a constituent with a GAP feature (and the necessity to specify what constitute lexical categories).
Nested Class Summary |
Nested classes inherited from class java.util.HashMap |
|
Nested classes inherited from class java.util.AbstractMap |
|
Field Summary | |
(package private) java.util.List |
lexicalCategories
The list of lexical categories (could be a set but...). |
(package private) Symbol |
SYMBOL_GAP
The Symbol ``GAP'', used for indicating the GAP feature. |
(package private) Symbol |
SYMBOL_PLUS
The Symbol ``+'', used for indicating the GAP feature's value. |
Fields inherited from class HeadFeaturedGrammar |
headFeatures |
Fields inherited from class Grammar |
description |
Fields inherited from class java.util.HashMap |
|
Fields inherited from class java.util.AbstractMap |
|
Constructor Summary | |
GapFeaturedGrammar()
|
Method Summary | |
void |
add(GrammarRule rule)
Adds the given HeadFeaturedGrammarRule to this GapFeaturedGrammar. |
(package private) void |
addGapForHead(HeadFeaturedGrammarRule rule)
Step 2 of the GAP feature algorithm (Figure 5.5 in NLU2). |
(package private) java.util.List |
addGapsForNonLexicalConstits(HeadFeaturedGrammarRule rule)
Step 3 of the GAP feature algorithm (Figure 5.5 in NLU2). |
(package private) java.util.List |
expandGapFeatures(HeadFeaturedGrammarRule rule)
Returns a list of rules resulting from expanding the the GAP features of the given HeadFeaturedGrammarRule. |
(package private) boolean |
hasGap(AugmentedConstituent constit)
Returns true if the given constituent specifies a GAP feature. |
(package private) boolean |
hasGap(HeadFeaturedGrammarRule rule)
Returns true if any constituent of the given rule specifies a GAP feature. |
boolean |
isLexicalCategory(Symbol category)
Returns the list of features that are head features for the given syntactic category (or null if none are defined). |
(package private) HeadFeaturedGrammarRule |
makeGapRule(HeadFeaturedGrammarRule rule,
int i)
Returns a copy of the given rule but with a GAP feature added connecting the mother and the i'th child. |
void |
readFile(java.lang.String filename)
Read the given filename and augment this GapFeaturedGrammar. |
void |
setLexicalCategories(java.util.List cats)
Sets the list of lexical categories for this GapFeaturedGrammar. |
Methods inherited from class HeadFeaturedGrammar |
addHeadFeatures, getHeadFeatures, setHeadFeatures |
Methods inherited from class AugmentedGrammar |
getRulesForConstituent |
Methods inherited from class Grammar |
dump, dump, getDescription, setDescription |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
java.util.List lexicalCategories
final Symbol SYMBOL_GAP
final Symbol SYMBOL_PLUS
Constructor Detail |
public GapFeaturedGrammar()
Method Detail |
public void setLexicalCategories(java.util.List cats)
public boolean isLexicalCategory(Symbol category)
public void add(GrammarRule rule)
add
in class HeadFeaturedGrammar
java.util.List expandGapFeatures(HeadFeaturedGrammarRule rule)
For each rule Y -> X1 ... Hi ... Xn with head constituent Hi
(Y GAP ?g) -> (X1 GAP -) ... (Hi GAP ?g) ... (Xn GAP -)
(Y GAP ?g) -> (X1 GAP -) ... (Xj GAP ?g) ... (Xn GAP -)
boolean hasGap(HeadFeaturedGrammarRule rule)
boolean hasGap(AugmentedConstituent constit)
void addGapForHead(HeadFeaturedGrammarRule rule)
(Y GAP ?g) -> (X1 GAP -) ... (Hi GAP ?g) ... (Xn GAP -)Note that (GAP -) is implied, so we don't have to add it explicitly.
java.util.List addGapsForNonLexicalConstits(HeadFeaturedGrammarRule rule)
(Y GAP ?g) -> (X1 GAP -) ... (Xj GAP ?g) ... (Xn GAP -)
HeadFeaturedGrammarRule makeGapRule(HeadFeaturedGrammarRule rule, int i)
public void readFile(java.lang.String filename) throws java.io.IOException
readFile
in class HeadFeaturedGrammar
java.io.IOException
GapFeaturedGrammarFileHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |