textmaven.dictionaries
Class Dictionary

java.lang.Object
  extended bytextmaven.dictionaries.BaseDictionary
      extended bytextmaven.dictionaries.Dictionary
All Implemented Interfaces:
IBaseDictionary, IDictionary, IDictionarySource
Direct Known Subclasses:
CompositeDictionary, DBDictionary, DictOrgDictionary, LuceneDictionary, XMLDictionary

public abstract class Dictionary
extends BaseDictionary
implements IDictionary

Author:
krebtho

Constructor Summary
Dictionary()
           
 
Method Summary
abstract  void close()
          Performs close operations on the source.
abstract  boolean containsKey(java.lang.String key)
          Checks whether a key is contained in the dictionary.
protected  IStemmer getStemmer()
           
abstract  java.util.Iterator keys()
          Returns all keys as specified in dictionary.
 java.util.Iterator keys(java.lang.String word)
          Returns the keys which would be looked up when accessing the dictionary with the specified word.
abstract  void open()
          Opens connection to datasource
 void setStemmer(IStemmer stemmer)
          Sets stemmer to be used for lookup operations.
abstract  java.util.Iterator translations(java.lang.String word)
          Retrieves available translations for a given word.
 
Methods inherited from class textmaven.dictionaries.BaseDictionary
getDescription, getId, getLanguage, setDescription, setId, setLanguage, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface textmaven.dictionaries.IDictionary
keysWithPrefix, translations
 
Methods inherited from interface textmaven.dictionaries.IBaseDictionary
getDescription, getId, getLanguage, setDescription, setId, setLanguage
 

Constructor Detail

Dictionary

public Dictionary()
Method Detail

translations

public abstract java.util.Iterator translations(java.lang.String word)
Description copied from interface: IDictionary
Retrieves available translations for a given word.

The word is retrieved from the dictionary as passed in as parameter. If no translation is found, an empty iterator.

Specified by:
translations in interface IDictionary
Parameters:
word - word to retrieve
Returns:
Iterator returning translations Translation

containsKey

public abstract boolean containsKey(java.lang.String key)
Description copied from interface: IDictionary
Checks whether a key is contained in the dictionary.

Specified by:
containsKey in interface IDictionary
Parameters:
key - word to lookup
Returns:
boolean true if key is contained in dictionary

keys

public abstract java.util.Iterator keys()
Description copied from interface: IDictionary
Returns all keys as specified in dictionary.

Specified by:
keys in interface IDictionary
Returns:
iterator returning all keys as String

open

public abstract void open()
Description copied from interface: IBaseDictionary
Opens connection to datasource

Specified by:
open in interface IBaseDictionary

close

public abstract void close()
Description copied from interface: IBaseDictionary
Performs close operations on the source. The source cannot be used after closing it.

Specified by:
close in interface IBaseDictionary

keys

public java.util.Iterator keys(java.lang.String word)
Description copied from interface: IDictionary
Returns the keys which would be looked up when accessing the dictionary with the specified word.

Specified by:
keys in interface IDictionary
Parameters:
word - word to be used for lookup
Returns:
Iterator returning all keys (String) associated with the specified word.

setStemmer

public void setStemmer(IStemmer stemmer)
Sets stemmer to be used for lookup operations. Before looking up words their stem is determined using the specified stemmer.

Parameters:
stemmer - stemmer to be used

getStemmer

protected IStemmer getStemmer()


Copyright © 2002-2005 Sourceforge. All Rights Reserved.