textmaven.dictionaries
Class XMLDictionary

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

public class XMLDictionary
extends Dictionary
implements IModifiableDictionary, Globals

XML backed dictionary.

Author:
krebtho

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
XMLDictionary()
           
 
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()
          Returns the name of the file backing the dictionary.
 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
 void setFileName(java.lang.String fileName)
           
 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.
 void write(Translation t)
           
 
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.IDictionary
keys
 
Methods inherited from interface textmaven.dictionaries.IBaseDictionary
getDescription, getId, getLanguage, setDescription, setId, setLanguage
 

Constructor Detail

XMLDictionary

public XMLDictionary()
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

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

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

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

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

write

public void write(Translation t)
Specified by:
write in interface IDictionaryWriter

setFileName

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

getFileName

public java.lang.String getFileName()
Returns the name of the file backing the dictionary.

Returns:
file name


Copyright © 2002-2005 Sourceforge. All Rights Reserved.