|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<DictionaryEntry<C>>
com.aliasi.dict.AbstractDictionary<C>
com.aliasi.dict.MapDictionary<C>
public class MapDictionary<C>
A MapDictionary uses an underlying map from phrases to
their set of dictionary entries. Map-based dictionaries are
compilable if their underlying entries are compilable, which
requires every category object to implement either the LingPipe
interface Compilable or the Java interface Serializable
The result is a fast
implementation of addEntry(DictionaryEntry), iterator() and phraseEntryIt(String).
| Constructor Summary | |
|---|---|
MapDictionary()
Construct an empty map-based dictionary. |
|
| Method Summary | |
|---|---|
void |
addEntry(DictionaryEntry<C> entry)
Adds the specified dictionary entry to the dictionary. |
void |
compileTo(ObjectOutput out)
Compiles this dictionary to the specified object output. |
Iterator<DictionaryEntry<C>> |
iterator()
|
Iterator<DictionaryEntry<C>> |
phraseEntryIt(String phrase)
Returns an iterator over the dictionary entries with the specified phrase. |
| Methods inherited from class com.aliasi.dict.AbstractDictionary |
|---|
categoryEntries, categoryEntryIt, entries, phraseEntries, size |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public MapDictionary()
| Method Detail |
|---|
public void addEntry(DictionaryEntry<C> entry)
AbstractDictionary
addEntry in interface Dictionary<C>addEntry in class AbstractDictionary<C>entry - Dictionary entry to add.public Iterator<DictionaryEntry<C>> iterator()
iterator in interface Iterable<DictionaryEntry<C>>iterator in interface Collection<DictionaryEntry<C>>iterator in interface Set<DictionaryEntry<C>>iterator in class AbstractCollection<DictionaryEntry<C>>public Iterator<DictionaryEntry<C>> phraseEntryIt(String phrase)
AbstractDictionaryImplementation Note: This implementation filters the
result of AbstractCollection.iterator() for entries with a matching
phrase.
phraseEntryIt in interface Dictionary<C>phraseEntryIt in class AbstractDictionary<C>phrase - The phrase to look up.
public void compileTo(ObjectOutput out)
throws IOException
AbstractDictionary
compileTo in interface CompilablecompileTo in class AbstractDictionary<C>out - Object output to which this dictionary is compiled.
IOException - If there is an I/O error writing the
object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||