Class SortingStrategy
- java.lang.Object
-
- org.apache.lucene.analysis.hunspell.SortingStrategy
-
public abstract class SortingStrategy extends java.lang.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()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
SortingStrategy.EntryAccumulator
(package private) static interface
SortingStrategy.EntrySupplier
-
Constructor Summary
Constructors Constructor Description SortingStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract 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, java.lang.String tempFileNamePrefix)
An "offline" strategy that creates temporary files in the given directory and uses them for sorting withOfflineSorter
.(package private) abstract SortingStrategy.EntryAccumulator
start()
-
-
-
Method Detail
-
start
abstract SortingStrategy.EntryAccumulator start() throws java.io.IOException
- Throws:
java.io.IOException
-
offline
public static SortingStrategy offline(Directory tempDir, java.lang.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.
-
-