|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.nlp.indices.IrregularVerbs
public class IrregularVerbs
A dictionary of irregular verbs in English. For each verb, the infinitive, simple past and past participle forms are given.
The dictionary is case-insensitive, so it does not matter whether a verb that is looked up is in upper or lower case.
| Field Summary | |
|---|---|
private static java.util.ArrayList<java.lang.String> |
inf
The infinitive forms of the irregular verbs. |
private static java.util.ArrayList<java.lang.String> |
pp
The past participle forms of the irregular verbs. |
private static java.util.ArrayList<java.lang.String> |
sp
The simple past forms of the irregular verbs. |
| Constructor Summary | |
|---|---|
IrregularVerbs()
|
|
| Method Summary | |
|---|---|
private static int |
getIndex(java.lang.String verb)
Returns the index of a verb or -1, if the verb is not in the
dictionary. |
static java.lang.String[] |
getInfinitive(java.lang.String verb)
Returns the infinitive forms of a verb or null, if the verb
is regular. |
static java.lang.String[] |
getPastParticiple(java.lang.String verb)
Returns the past participle forms of a verb or null, if the
verb is regular. |
static java.lang.String[] |
getSimplePast(java.lang.String verb)
Returns the simple past forms of a verb or null, if the verb
is regular. |
static boolean |
loadVerbs(java.lang.String filename)
Reads the irregular verbs from a text file of the following format:
infinitive_of_verb_1 simple_past_of_verb_1 past_participle_of_verb_1 |
static java.lang.String |
lookup(java.lang.String verb)
Looks up a verb in the dictionary. |
private static boolean |
matches(java.lang.String word,
java.lang.String words)
Determines whether a word is in a list of words separated by "/". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.util.ArrayList<java.lang.String> inf
private static java.util.ArrayList<java.lang.String> sp
private static java.util.ArrayList<java.lang.String> pp
| Constructor Detail |
|---|
public IrregularVerbs()
| Method Detail |
|---|
private static boolean matches(java.lang.String word,
java.lang.String words)
word - word to testwords - words separated by "/"
private static int getIndex(java.lang.String verb)
-1, if the verb is not in the
dictionary.
verb - verb to check
-1public static boolean loadVerbs(java.lang.String filename)
Reads the irregular verbs from a text file of the following format:
infinitive_of_verb_1 simple_past_of_verb_1 past_participle_of_verb_1
...
infinitive_of_verb_n simple_past_of_verb_n past_participle_of_verb_n
Equivalent forms of the same verb should be separated by "/", e.g.:
infinitive simple_past_1/simple_past_2 past_participle_1/past_participle_2
filename - name and path of the textfile
public static java.lang.String lookup(java.lang.String verb)
INF/SP/PP, if the verb is in its
infinitive/simple past/past participle form or null, if the
verb is not in the dictionary.
verb - verb to look up
INF, SP, PP or
nullpublic static java.lang.String[] getInfinitive(java.lang.String verb)
null, if the verb
is regular.
verb - verb in infinitive, simple past or past participle
nullpublic static java.lang.String[] getSimplePast(java.lang.String verb)
null, if the verb
is regular.
verb - verb in infinitive, simple past or past participle
nullpublic static java.lang.String[] getPastParticiple(java.lang.String verb)
null, if the
verb is regular.
verb - verb in infinitive, simple past or past participle
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||