Builder

class Builder<T>(inputType: FST.INPUT_TYPE, outputs: Outputs<T>)

Fluent-style constructor for FST FSTCompiler.

Creates an FST/FSA builder with all the possible tuning and construction tweaks. Read parameter documentation carefully.

Constructors

Link copied to clipboard
constructor(inputType: FST.INPUT_TYPE, outputs: Outputs<T>)

Functions

Link copied to clipboard
fun allowFixedLengthArcs(allowFixedLengthArcs: Boolean): FSTCompiler.Builder<T>

Pass false to disable the fixed length arc optimization (binary search or direct addressing) while building the FST; this will make the resulting FST smaller but slower to traverse.

Link copied to clipboard

Creates a new FSTCompiler.

Link copied to clipboard

Set the DataOutput which is used for low-level writing of FST. If you want the FST to be immediately readable, you need to use FSTCompiler.getOnHeapReaderWriter.

Link copied to clipboard

Overrides the default the maximum oversizing of fixed array allowed to enable direct addressing of arcs instead of binary search.

Link copied to clipboard

Expert: Set the codec version. *

Link copied to clipboard

The approximate maximum amount of RAM (in MB) to use holding the suffix cache, which enables the FST to share common suffixes. Pass Double.POSITIVE_INFINITY to keep all suffixes and create an exactly minimal FST. In this case, the amount of RAM actually used will be bounded by the number of unique suffixes. If you pass a value smaller than the builder would use, the least recently used suffixes will be discarded, thus reducing suffix sharing and creating a non-minimal FST. In this case, the larger the limit, the closer the FST will be to its true minimal size, with diminishing returns as you increase the limit. Pass 0 to disable suffix sharing entirely, but note that the resulting FST can be substantially larger than the minimal FST.