Class FSTCompletion
Finite state automata based implementation of "autocomplete" functionality.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search.Suggest.Fst
Assembly: Lucene.Net.Suggest.dll
Syntax
public class FSTCompletion
Constructors
| Improve this Doc View SourceFSTCompletion(FST<Object>)
Defaults to higher weights first and exact first.
Declaration
public FSTCompletion(FST<object> automaton)
Parameters
Type | Name | Description |
---|---|---|
FST<System.Object> | automaton |
See Also
| Improve this Doc View SourceFSTCompletion(FST<Object>, Boolean, Boolean)
Constructs an FSTCompletion, specifying higherWeightsFirst and exactFirst.
Declaration
public FSTCompletion(FST<object> automaton, bool higherWeightsFirst, bool exactFirst)
Parameters
Type | Name | Description |
---|---|---|
FST<System.Object> | automaton | Automaton with completions. See FSTCompletionBuilder. |
System.Boolean | higherWeightsFirst | Return most popular suggestions first. This is the default
behavior for this implementation. Setting it to |
System.Boolean | exactFirst | Find and push an exact match to the first position of the result list if found. |
Fields
| Improve this Doc View SourceDEFAULT_BUCKETS
Default number of buckets.
Declaration
public const int DEFAULT_BUCKETS = 10
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceBucketCount
Returns the bucket count (discretization thresholds).
Declaration
public virtual int BucketCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FST
Returns the internal automaton.
Declaration
public virtual FST<object> FST { get; }
Property Value
Type | Description |
---|---|
FST<System.Object> |
Methods
| Improve this Doc View SourceDoLookup(String, Int32)
Lookup suggestions to key
.
Declaration
public virtual IList<FSTCompletion.Completion> DoLookup(string key, int num)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The prefix to which suggestions should be sought. |
System.Int32 | num | At most this number of suggestions will be returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<FSTCompletion.Completion> | Returns the suggestions, sorted by their approximated weight first (decreasing) and then alphabetically (UTF-8 codepoint order). |
GetBucket(String)
Returns the bucket assigned to a given key (if found) or -1
if
no exact match exists.
Declaration
public virtual int GetBucket(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.Int32 |