Class SortingStrategy

  • public abstract class SortingStrategy
    extends Object
    The strategy defining how a Hunspell dictionary should be loaded, with different tradeoffs. The entries should be sorted in a special way, and this can be done either in-memory (faster, but temporarily allocating more memory) or using disk (slower, but not needing much memory).
    See Also:
    offline(Directory, String), inMemory()
    • Constructor Detail

      • SortingStrategy

        public SortingStrategy()
    • Method Detail

      • offline

        public static SortingStrategy offline​(Directory tempDir,
                                              String tempFileNamePrefix)
        An "offline" strategy that creates temporary files in the given directory and uses them for sorting with OfflineSorter. It's slower than inMemory(), but doesn't need to load the entire dictionary into memory.
      • inMemory

        public static SortingStrategy inMemory()
        The strategy that loads all entries as String objects and sorts them in memory. The entries are then stored in a more compressed way, and the strings are gc-ed, but the loading itself needs O(dictionary_size) memory.