Class IPADictionary
java.lang.Object
ca.phon.ipadictionary.IPADictionary
- All Implemented Interfaces:
IExtendable
API for the IPA dictionary. This class is final.
To implement custom IPADictionaries, implement the
IPADictionarySPI interface and pass the constructed
object as an argument to the constructor for this class.
Dictionaries are only required to provide the method lookup(String).
All other functionality is optional, but it is recommended
to at least implement the actions AddEntry, RemoveEntry,
and OrthoKeyIterator.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an entry to this dictionary (optional)<T> TgetExtension(Class<T> cap) Get the requested extension if available.Return all extension types supportedReturns the language handled by this dictionary.getMetadataValue(String key) Get value for a given metadata key.getName()Returns a string identifier for this dictionary.Return an iterator for the keys in this dictionary.String[]Perform a lookup for the given orthographic transcription.Get the iteator for metadata keys.String[]prefixSearch(String prefix) Return all keys which start with the given prefix.<T> TputExtension(Class<T> cap, T impl) Add a new extension.voidremoveEntry(String orthography, String ipa) Remove an entry from this dictionary.<T> TremoveExtension(Class<T> cap) Remove a capability.
-
Constructor Details
-
IPADictionary
-
-
Method Details
-
lookup
-
addEntry
Add an entry to this dictionary (optional)- Parameters:
orthography-ipa-- Throws:
IPADictionaryException- if the dictionary is not capable of adding entries or the entry was not added because it was a duplicate.
-
removeEntry
Remove an entry from this dictionary. (optional)- Parameters:
orthography-ipa-- Throws:
IPADictionaryException- if the dictionary is not capable of removing the entry.
-
keyIterator
Return an iterator for the keys in this dictionary. (optional)- Returns:
- the key iterator for the dictionary
- Throws:
IPADictionaryException- if the dictionary is not capable of iterating it's keys
-
prefixSearch
Return all keys which start with the given prefix. (optional)- Parameters:
prefix-- Returns:
- the list of keys which have the given prefix
- Throws:
IPADictionaryException- if the dictionary does not support this function
-
getLanguage
Returns the language handled by this dictionary.- Returns:
- the
LanguageEntryfor this dictionary
-
getName
Returns a string identifier for this dictionary. While not required, the name should be unique to help users identify dictionaries which handle the same language.- Returns:
- the dictionary name
-
getMetadataValue
Get value for a given metadata key.- Parameters:
key- the metadata key. Common keys are 'provider' and 'website'- Returns:
- the value for the specified key or
nullif no data is available. SeemetadataKeyIterator()
-
metadataKeyIterator
-
getExtensions
Description copied from interface:IExtendableReturn all extension types supported- Specified by:
getExtensionsin interfaceIExtendable
-
getExtension
Description copied from interface:IExtendableGet the requested extension if available.- Specified by:
getExtensionin interfaceIExtendable- Returns:
- the capability object or
nullif the cability is not available
-
putExtension
Description copied from interface:IExtendableAdd a new extension.- Specified by:
putExtensionin interfaceIExtendable- Parameters:
cap- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendableRemove a capability.- Specified by:
removeExtensionin interfaceIExtendable- Parameters:
cap- the capability to remove
-