public abstract class Dictionary extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FAIL_PARSE |
protected int |
numTerminals
Number of terminal types
|
Constructor and Description |
---|
Dictionary()
Creates a new instance of Dictionary with a fixed set of words
|
Modifier and Type | Method and Description |
---|---|
int |
lookup(String token)
Looks up a word in the dictionary and returns its part of speech
|
void |
put(String key,
int value)
Places a terminal value / mapped value (integer) into the hash table
¶m key terminal value being placed into the hash table
¶m value integer value of the CNF production rule variable to which key maps
|
public static final int FAIL_PARSE
protected int numTerminals
public Dictionary()
public void put(String key, int value)
key
- value
- public int lookup(String token)
token
- to be looked upFAIL_PARSE