Class AbstractDictionaryFile

  • All Implemented Interfaces:
    DictionaryFile
    Direct Known Subclasses:
    AbstractPrincetonDictionaryFile

    public abstract class AbstractDictionaryFile
    extends java.lang.Object
    implements DictionaryFile
    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 Detail

      • _pos

        private POS _pos
      • _fileType

        private DictionaryFileType _fileType
        The type of the file. For example, the default implementation defines the types INDEX, DATA, and EXCEPTION.
      • _file

        private java.io.File _file
    • Constructor Detail

      • AbstractDictionaryFile

        public AbstractDictionaryFile()
      • AbstractDictionaryFile

        protected AbstractDictionaryFile​(java.lang.String path,
                                         POS pos,
                                         DictionaryFileType fileType)
    • Method Detail

      • makeFilename

        protected abstract java.lang.String makeFilename()
        Build a filename from the part-of-speech and the file type.
      • openFile

        protected abstract void openFile​(java.io.File file)
                                  throws java.io.IOException
        Open the file at path path
        Throws:
        java.io.IOException
      • getPOS

        public POS getPOS()
        The POS associated with this file.
        Specified by:
        getPOS in interface DictionaryFile
      • open

        public void open()
                  throws java.io.IOException
        Open the file.
        Specified by:
        open in interface DictionaryFile
        Throws:
        java.io.IOException