Class DictionaryBuilder


  • public class DictionaryBuilder
    extends Object
    Builder for common dictionary usage. Creates a WordListDictionary backed by an ArrayWordList from one or more files containing a list of words, one per line.
    Author:
    Middleware Services
    • Constructor Detail

      • DictionaryBuilder

        public DictionaryBuilder()
    • Method Detail

      • addFile

        public DictionaryBuilder addFile​(String path)
        Adds a word list to the dictionary to be built. The file is read using the platform default charset.
        Parameters:
        path - Path to word list, one word per line.
        Returns:
        This builder.
      • addReader

        public DictionaryBuilder addReader​(Reader reader)
        Adds a word list to the dictionary to be built.
        Parameters:
        reader - Reader which returns a word list, one word per line.
        Returns:
        This builder.
      • setCaseSensitive

        public DictionaryBuilder setCaseSensitive​(boolean flag)
        Sets the case sensitivity flag on the dictionary to be built. Dictionaries are built case insensitive by default.
        Parameters:
        flag - True for case sensitive, false otherwise.
        Returns:
        This builder.