Package net.didion.jwnl.princeton.file
Class AbstractPrincetonDictionaryFile
- java.lang.Object
-
- net.didion.jwnl.dictionary.file.AbstractDictionaryFile
-
- net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
-
- All Implemented Interfaces:
DictionaryFile
- Direct Known Subclasses:
AbstractPrincetonRandomAccessDictionaryFile
,PrincetonObjectDictionaryFile
public abstract class AbstractPrincetonDictionaryFile extends AbstractDictionaryFile
AbstractDictionaryFile
that uses file names compatible with Princeton's distribution of WordNet. The filenames associated are: WINDOWS:. MAC, UNIX: . , .exc
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AbstractPrincetonDictionaryFile.FileNames
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map
_fileTypeToFileNameMap
private static java.util.Map
_posToExtMap
private static java.lang.String
ADJECTIVE_EXT
private static java.lang.String
ADVERB_EXT
private static java.lang.String
NOUN_EXT
private static java.lang.String
VERB_EXT
-
Fields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER
-
-
Constructor Summary
Constructors Constructor Description AbstractPrincetonDictionaryFile()
AbstractPrincetonDictionaryFile(java.lang.String path, POS pos, DictionaryFileType fileType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getExtension(POS pos)
private AbstractPrincetonDictionaryFile.FileNames
getFileNames(DictionaryFileType type)
protected java.lang.String
makeFilename()
Build a filename from the part-of-speech and the file type.private java.lang.String
makeNonWindowsFilename(java.lang.String posStr, java.lang.String fileTypeStr)
private java.lang.String
makeWindowsFilename(java.lang.String posStr, java.lang.String fileTypeStr)
Makes a windows file type string.-
Methods inherited from class net.didion.jwnl.dictionary.file.AbstractDictionaryFile
getFile, getFileType, getPOS, open, openFile
-
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 Detail
-
NOUN_EXT
private static final java.lang.String NOUN_EXT
- See Also:
- Constant Field Values
-
VERB_EXT
private static final java.lang.String VERB_EXT
- See Also:
- Constant Field Values
-
ADJECTIVE_EXT
private static final java.lang.String ADJECTIVE_EXT
- See Also:
- Constant Field Values
-
ADVERB_EXT
private static final java.lang.String ADVERB_EXT
- See Also:
- Constant Field Values
-
_posToExtMap
private static final java.util.Map _posToExtMap
-
_fileTypeToFileNameMap
private static final java.util.Map _fileTypeToFileNameMap
-
-
Constructor Detail
-
AbstractPrincetonDictionaryFile
public AbstractPrincetonDictionaryFile()
-
AbstractPrincetonDictionaryFile
public AbstractPrincetonDictionaryFile(java.lang.String path, POS pos, DictionaryFileType fileType)
-
-
Method Detail
-
makeFilename
protected java.lang.String makeFilename()
Description copied from class:AbstractDictionaryFile
Build a filename from the part-of-speech and the file type.- Specified by:
makeFilename
in classAbstractDictionaryFile
-
makeWindowsFilename
private java.lang.String makeWindowsFilename(java.lang.String posStr, java.lang.String fileTypeStr)
Makes a windows file type string. Typically of the form "data.noun" or "index.noun".- Parameters:
posStr
- the part of speechfileTypeStr
- the file type, data, index, etc.- Returns:
-
makeNonWindowsFilename
private java.lang.String makeNonWindowsFilename(java.lang.String posStr, java.lang.String fileTypeStr)
-
getExtension
private java.lang.String getExtension(POS pos)
-
getFileNames
private AbstractPrincetonDictionaryFile.FileNames getFileNames(DictionaryFileType type)
-
-