com.aliasi.dict
Interface Dictionary<C>

Type Parameters:
C - the type of entries in the dictionary
All Superinterfaces:
Collection<DictionaryEntry<C>>, Iterable<DictionaryEntry<C>>, Set<DictionaryEntry<C>>
All Known Implementing Classes:
AbstractDictionary, MapDictionary, TrieDictionary

public interface Dictionary<C>
extends Set<DictionaryEntry<C>>

The Dictionary interface represents a dictionary as a set of entries. Dictionary entries povide a string, a category, and a score.

Equality conditions and basic access are documented in the Set interface.

Since:
LingPipe2.1
Version:
3.8
Author:
Bob Carpenter

Method Summary
 void addEntry(DictionaryEntry<C> entry)
          Adds the specified dictionary entry to the dictionary.
 DictionaryEntry<C>[] categoryEntries(C category)
          Deprecated. Use categoryEntryList(Object) instead.
 Iterator<DictionaryEntry<C>> categoryEntryIt(C category)
          Returns an iterator over the dictionary entries with the specified category.
 List<DictionaryEntry<C>> categoryEntryList(C category)
          Returns the dictionary entries with the specified category.
 DictionaryEntry<C>[] entries()
          Deprecated. Use entryList() instead.
 List<DictionaryEntry<C>> entryList()
          Returns all of the dictionary entries for this dictionary.
 DictionaryEntry<C>[] phraseEntries(String phrase)
          Deprecated. Use phraseEntryList(String) instead.
 Iterator<DictionaryEntry<C>> phraseEntryIt(String phrase)
          Returns an iterator over the dictionary entries with the specified phrase.
 List<DictionaryEntry<C>> phraseEntryList(String phrase)
          Returns the dictionary entries with the specified phrase.
 int size()
          Returns the size of this dictionary as measured by number of dictionary entries.
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 

Method Detail

phraseEntryIt

Iterator<DictionaryEntry<C>> phraseEntryIt(String phrase)
Returns an iterator over the dictionary entries with the specified phrase.

Parameters:
phrase - The phrase to look up.
Returns:
Iterator over the entries with the specified phrase.

phraseEntries

@Deprecated
DictionaryEntry<C>[] phraseEntries(String phrase)
Deprecated. Use phraseEntryList(String) instead.

Returns the dictionary entries with the specified phrase.

Parameters:
phrase - The phrase to look up.
Returns:
The entries with the specified phrase.

phraseEntryList

List<DictionaryEntry<C>> phraseEntryList(String phrase)
Returns the dictionary entries with the specified phrase.

Parameters:
phrase - The phrase to look up.
Returns:
The entries with the specified phrase.

categoryEntryIt

Iterator<DictionaryEntry<C>> categoryEntryIt(C category)
Returns an iterator over the dictionary entries with the specified category.

Parameters:
category - Category of entries.
Returns:
Iterator over entries with specified category.

categoryEntries

@Deprecated
DictionaryEntry<C>[] categoryEntries(C category)
Deprecated. Use categoryEntryList(Object) instead.

Returns the dictionary entries with the specified category.

Parameters:
category - Category of entries.
Returns:
Entries with specified category.

categoryEntryList

List<DictionaryEntry<C>> categoryEntryList(C category)
Returns the dictionary entries with the specified category.

Parameters:
category - Category of entries.
Returns:
Entries with specified category.

size

int size()
Returns the size of this dictionary as measured by number of dictionary entries.

Specified by:
size in interface Collection<DictionaryEntry<C>>
Specified by:
size in interface Set<DictionaryEntry<C>>
Returns:
Size of this dictionary.

entries

@Deprecated
DictionaryEntry<C>[] entries()
Deprecated. Use entryList() instead.

Returns all of the dictionary entries for this dictionary.

Returns:
This dictionary's entries.

entryList

List<DictionaryEntry<C>> entryList()
Returns all of the dictionary entries for this dictionary.

Returns:
This dictionary's entries.

addEntry

void addEntry(DictionaryEntry<C> entry)
Adds the specified dictionary entry to the dictionary. If an implementation of Dictionary is immutable, then this method may throw an unsupported operation exception.

Parameters:
entry - Dictionary entry to add.
Throws:
UnsupportedOperationException - If this operation is not supported by a subclass implementation.