Package net.didion.jwnl.dictionary.file
Class AbstractDictionaryFile
java.lang.Object
net.didion.jwnl.dictionary.file.AbstractDictionaryFile
- All Implemented Interfaces:
DictionaryFile
- Direct Known Subclasses:
AbstractPrincetonDictionaryFile
Abstract implementation of
DictionaryFile
. This class
should be implemented for each file naming scheme used. It is assumed that each
file will be associated with both a POS and a file type (e.g. in the windows
naming scheme, the verb index file is called "verb.idx").-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate File
private DictionaryFileType
The type of the file.private POS
Fields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractDictionaryFile
(String path, POS pos, DictionaryFileType fileType) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
close, isOpen, newInstance
-
Field Details
-
_pos
-
_fileType
The type of the file. For example, the default implementation defines the types INDEX, DATA, and EXCEPTION. -
_file
-
-
Constructor Details
-
AbstractDictionaryFile
public AbstractDictionaryFile() -
AbstractDictionaryFile
-
-
Method Details
-
makeFilename
Build a filename from the part-of-speech and the file type. -
openFile
Open the file at pathpath
- Throws:
IOException
-
getPOS
The POS associated with this file.- Specified by:
getPOS
in interfaceDictionaryFile
-
getFile
- Specified by:
getFile
in interfaceDictionaryFile
-
getFileType
The file type associated with this file.- Specified by:
getFileType
in interfaceDictionaryFile
-
open
Open the file.- Specified by:
open
in interfaceDictionaryFile
- Throws:
IOException
-