Class SortingStrategy
- java.lang.Object
-
- org.apache.lucene.analysis.hunspell.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 Summary
Constructors Constructor Description SortingStrategy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SortingStrategy
inMemory()
The strategy that loads all entries asString
objects and sorts them in memory.static SortingStrategy
offline(Directory tempDir, String tempFileNamePrefix)
An "offline" strategy that creates temporary files in the given directory and uses them for sorting withOfflineSorter
.
-
-
-
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 withOfflineSorter
. It's slower thaninMemory()
, but doesn't need to load the entire dictionary into memory.
-
inMemory
public static SortingStrategy inMemory()
The strategy that loads all entries asString
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 needsO(dictionary_size)
memory.
-
-