Class DictionaryMetadata


  • public final class DictionaryMetadata
    extends Object
    Description of attributes, their types and default values.
    • Field Detail

      • METADATA_FILE_EXTENSION

        public static final String METADATA_FILE_EXTENSION
        Expected metadata file extension.
        See Also:
        Constant Field Values
    • Method Detail

      • getEncoding

        public String getEncoding()
      • getSeparator

        public byte getSeparator()
      • getLocale

        public Locale getLocale()
      • isFrequencyIncluded

        public boolean isFrequencyIncluded()
      • isIgnoringPunctuation

        public boolean isIgnoringPunctuation()
      • isIgnoringNumbers

        public boolean isIgnoringNumbers()
      • isIgnoringCamelCase

        public boolean isIgnoringCamelCase()
      • isIgnoringAllUppercase

        public boolean isIgnoringAllUppercase()
      • isIgnoringDiacritics

        public boolean isIgnoringDiacritics()
      • isConvertingCase

        public boolean isConvertingCase()
      • isSupportingRunOnWords

        public boolean isSupportingRunOnWords()
      • getSequenceEncoderType

        public EncoderType getSequenceEncoderType()
        Returns:
        Return sequence encoder type.
      • getSeparatorAsChar

        public char getSeparatorAsChar()
        Returns:
        Returns the separator byte converted to a single char.
        Throws:
        RuntimeException - if this conversion is for some reason impossible (the byte is a surrogate pair, FSA's encoding is not available).
      • getExpectedMetadataFileName

        public static String getExpectedMetadataFileName​(String dictionaryFile)
        Returns the expected name of the metadata file, based on the name of the dictionary file. The expected name is resolved by truncating any file extension of name and appending METADATA_FILE_EXTENSION.
        Parameters:
        dictionaryFile - The name of the dictionary (*.dict) file.
        Returns:
        Returns the expected name of the metadata file.
      • getExpectedMetadataLocation

        public static Path getExpectedMetadataLocation​(Path dictionary)
        Parameters:
        dictionary - The location of the dictionary file.
        Returns:
        Returns the expected location of a metadata file.
      • write

        public void write​(Writer writer)
                   throws IOException
        Write dictionary attributes (metadata).
        Parameters:
        writer - The writer to write to.
        Throws:
        IOException - Thrown when an I/O error occurs.