public class FSTCompletion
extends java.lang.Object
FSTCompletionBuilder| Modifier and Type | Class and Description |
|---|---|
static class |
FSTCompletion.Completion
A single completion for a given key.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUCKETS
Default number of buckets.
|
| Constructor and Description |
|---|
FSTCompletion(<any> automaton)
Defaults to higher weights first and exact first.
|
FSTCompletion(<any> automaton,
boolean higherWeightsFirst,
boolean exactFirst)
Constructs an FSTCompletion, specifying higherWeightsFirst and exactFirst.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBucket(java.lang.CharSequence key)
Returns the bucket assigned to a given key (if found) or
-1 if
no exact match exists. |
int |
getBucketCount()
Returns the bucket count (discretization thresholds).
|
<any> |
getFST()
Returns the internal automaton.
|
java.util.List<FSTCompletion.Completion> |
lookup(java.lang.CharSequence key,
int num)
Lookup suggestions to
key. |
public static final int DEFAULT_BUCKETS
public FSTCompletion(<any> automaton,
boolean higherWeightsFirst,
boolean exactFirst)
automaton - Automaton with completions. See FSTCompletionBuilder.higherWeightsFirst - Return most popular suggestions first. This is the default
behavior for this implementation. Setting it to false
has no effect (use constant term weights to sort alphabetically
only).exactFirst - Find and push an exact match to the first position of the result
list if found.public FSTCompletion(<any> automaton)
#FSTCompletion(FST, boolean, boolean)public java.util.List<FSTCompletion.Completion> lookup(java.lang.CharSequence key, int num)
key.key - The prefix to which suggestions should be sought.num - At most this number of suggestions will be returned.public int getBucketCount()
public int getBucket(java.lang.CharSequence key)
-1 if
no exact match exists.public <any> getFST()
Data In Motion GmbH all rights reserved