textmaven.dictionaries
Class DictOrgDictionary

java.lang.Object
  extended bytextmaven.dictionaries.BaseDictionary
      extended bytextmaven.dictionaries.Dictionary
          extended bytextmaven.dictionaries.DictOrgDictionary
All Implemented Interfaces:
Globals, IBaseDictionary, IDictionary, IDictionarySource

public class DictOrgDictionary
extends Dictionary
implements Globals

Implements a wormagic ISource with a dictionary file as backend. The dictionary file is expected to be in the format that is used for the files accompanying the free dict daemon available at http://www.dict.org. Parsing for synonyms etc. is specific to the dictionary sub type e.g. WordNet, GCide etc. is not currently performed.

Author:
Peter Kolloch

Field Summary
 
Fields inherited from interface textmaven.Globals
C_ATTR_CLASSNAME, C_DICT_BASE_TYPE, C_DICT_TYPE, C_SERVER_BASE_TYPE, C_STEMMER_BASE_TYPE, C_WRITER_BASE_TYPE, CONFIG_FILE, DEFAULT_SENTENCES, DEFAULT_SEPARATOR, NEW_PARA, T_COL_DICTIONARY, T_COL_HOMONYMID, T_COL_ID, T_COL_LEXKEY, T_COL_TRANSLATION, T_COL_WORDCLASS, VERBOSE
 
Constructor Summary
DictOrgDictionary()
           
 
Method Summary
 void close()
          Performs close operations on the source.
 boolean containsKey(java.lang.String key)
          Checks whether a key is contained in the dictionary.
 java.lang.String getFileName()
           
 boolean isCompressed()
           
 java.util.Iterator keys()
          Returns all keys as specified in dictionary.
 java.util.Iterator keysWithPrefix(java.lang.String prefix)
          Returns all keys starting with the specified prefix
 void open()
          Opens connection to datasource
static void printWords(java.util.Iterator translations)
           
 void setCompressed(boolean compressed)
           
 void setCompressed(java.lang.String compressed)
          Support setting the compressed property with a string representing a boolean.
 void setFileName(java.lang.String fileBaseName)
           
 java.util.Iterator translations()
          Returns all translations available in the dictionary.
 java.util.Iterator translations(java.lang.String word)
          Retrieves available translations for a given word.
 
Methods inherited from class textmaven.dictionaries.Dictionary
getStemmer, keys, setStemmer
 
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.IBaseDictionary
getDescription, getId, getLanguage, setDescription, setId, setLanguage
 

Constructor Detail

DictOrgDictionary

public DictOrgDictionary()
Method Detail

translations

public 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
Specified by:
translations in class Dictionary

translations

public java.util.Iterator translations()
Description copied from interface: IDictionary
Returns all translations available in the dictionary.

Specified by:
translations in interface IDictionary
Returns:
Iterator returning translations Translation

containsKey

public 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
Specified by:
containsKey in class Dictionary

keys

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

Specified by:
keys in interface IDictionary
Specified by:
keys in class Dictionary

keysWithPrefix

public java.util.Iterator keysWithPrefix(java.lang.String prefix)
Description copied from interface: IDictionary
Returns all keys starting with the specified prefix

Specified by:
keysWithPrefix in interface IDictionary
Parameters:
prefix -
Returns:
Iterator returning all keys (String) starting with prefix

open

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

Specified by:
open in interface IBaseDictionary
Specified by:
open in class Dictionary

close

public 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
Specified by:
close in class Dictionary

isCompressed

public boolean isCompressed()
Returns:
Returns the compressed.

setCompressed

public void setCompressed(boolean compressed)
Parameters:
compressed - The compressed to set.

setCompressed

public void setCompressed(java.lang.String compressed)
Support setting the compressed property with a string representing a boolean. This is required by the current implementation of the Configuration class.

Parameters:
compressed - true or flase.

getFileName

public java.lang.String getFileName()
Returns:
Returns the fileBaseName.

setFileName

public void setFileName(java.lang.String fileBaseName)
Parameters:
fileBaseName - The fileBaseName to set.

printWords

public static void printWords(java.util.Iterator translations)


Copyright © 2002-2005 Sourceforge. All Rights Reserved.