|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Lexicon
An interface for lexicons interfacing to lexparser.
Field Summary | |
---|---|
static String |
BOUNDARY
|
static String |
BOUNDARY_TAG
|
static String |
UNKNOWN_WORD
|
Method Summary | |
---|---|
boolean |
isKnown(int word)
Checks whether a word is in the lexicon. |
boolean |
isKnown(String word)
Checks whether a word is in the lexicon. |
void |
readData(BufferedReader in)
Read the lexicon from the BufferedReader in the format written by writeData. |
Iterator |
ruleIteratorByWord(int word,
int loc)
Get an iterator over all rules (pairs of (word, POS)) for this word. |
double |
score(IntTaggedWord iTW,
int loc)
Get the score of this word with this tag (as an IntTaggedWord) at this loc. |
void |
train(Collection trees)
Trains this lexicon on the Collection of trees. |
void |
writeData(Writer w)
Write the lexicon in human-readable format to the Writer. |
Field Detail |
---|
static final String UNKNOWN_WORD
static final String BOUNDARY
static final String BOUNDARY_TAG
Method Detail |
---|
boolean isKnown(int word)
word
- The word as an int
boolean isKnown(String word)
word
- The word as a String
Iterator ruleIteratorByWord(int word, int loc)
word
- The word, represented as an integer in Numbererloc
- The position of the word in the sentence (counting from 0).
Implementation note: The BaseLexicon class doesn't
actually make use of this position information.
tag -> word rule.)
void train(Collection trees)
double score(IntTaggedWord iTW, int loc)
iTW
- An IntTaggedWord pairing a word and POS tagloc
- The position in the sentence. In the default implementation
this is used only for unknown words to change their
probability distribution when sentence initial
void writeData(Writer w) throws IOException
w
- The writer to output to
IOException
void readData(BufferedReader in) throws IOException
in
- The BufferedReader to read from
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |