C# 클래스 Lucene.Net.Search.Suggest.Analyzing.FuzzySuggester

Implements a fuzzy AnalyzingSuggester. The similarity measurement is based on the Damerau-Levenshtein (optimal string alignment) algorithm, though you can explicitly choose classic Levenshtein by passing false for the transpositions parameter.

At most, this query will match terms up to {@value org.apache.lucene.util.automaton.LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE} edits. Higher distances are not supported. Note that the fuzzy distance is measured in "byte space" on the bytes returned by the TokenStream's {@link TermToBytesRefAttribute}, usually UTF8. By default the analyzed bytes must be at least 3 {@link #DEFAULT_MIN_FUZZY_LENGTH} bytes before any edits are considered. Furthermore, the first 1 {@link #DEFAULT_NON_FUZZY_PREFIX} byte is not allowed to be edited. We allow up to 1 (@link #DEFAULT_MAX_EDITS} edit. If #unicodeAware parameter in the constructor is set to true, maxEdits, minFuzzyLength, transpositions and nonFuzzyPrefix are measured in Unicode code points (actual letters) instead of bytes.

NOTE: This suggester does not boost suggestions that required no edits over suggestions that did require edits. This is a known limitation.

Note: complex query analyzers can have a significant impact on the lookup performance. It's recommended to not use analyzers that drop or inject terms like synonyms to keep the complexity of the prefix intersection low for good lookup performance. At index time, complex analyzers can safely be used.

@lucene.experimental
상속: AnalyzingSuggester
파일 보기 프로젝트 열기: apache/lucenenet

Private Properties

프로퍼티 타입 설명
ToLevenshteinAutomata Lucene.Net.Util.Automaton.Automaton

공개 메소드들

메소드 설명
FuzzySuggester ( Analyzer analyzer ) : Lucene.Net.Analysis

Creates a FuzzySuggester instance initialized with default values.

FuzzySuggester ( Analyzer indexAnalyzer, Analyzer queryAnalyzer ) : Lucene.Net.Analysis

Creates a FuzzySuggester instance with an index & a query analyzer initialized with default values.

FuzzySuggester ( Analyzer indexAnalyzer, Analyzer queryAnalyzer, SuggesterOptions options, int maxSurfaceFormsPerAnalyzedForm, int maxGraphExpansions, bool preservePositionIncrements, int maxEdits, bool transpositions, int nonFuzzyPrefix, int minFuzzyLength, bool unicodeAware ) : Lucene.Net.Analysis

Creates a FuzzySuggester instance.

보호된 메소드들

메소드 설명
ConvertAutomaton ( Automaton a ) : Automaton
GetFullPrefixPaths ( BytesRef>.List prefixPaths, Automaton lookupAutomaton, BytesRef>.FST fst ) : BytesRef>.Pair>>.List

비공개 메소드들

메소드 설명
ToLevenshteinAutomata ( Automaton automaton ) : Automaton

메소드 상세

ConvertAutomaton() 보호된 메소드

protected ConvertAutomaton ( Automaton a ) : Automaton
a Lucene.Net.Util.Automaton.Automaton
리턴 Lucene.Net.Util.Automaton.Automaton

FuzzySuggester() 공개 메소드

Creates a FuzzySuggester instance initialized with default values.
public FuzzySuggester ( Analyzer analyzer ) : Lucene.Net.Analysis
analyzer Lucene.Net.Analysis.Analyzer The used for this suggester.
리턴 Lucene.Net.Analysis

FuzzySuggester() 공개 메소드

Creates a FuzzySuggester instance with an index & a query analyzer initialized with default values.
public FuzzySuggester ( Analyzer indexAnalyzer, Analyzer queryAnalyzer ) : Lucene.Net.Analysis
indexAnalyzer Lucene.Net.Analysis.Analyzer /// that will be used for analyzing suggestions while building the index.
queryAnalyzer Lucene.Net.Analysis.Analyzer /// that will be used for analyzing query text during lookup
리턴 Lucene.Net.Analysis

FuzzySuggester() 공개 메소드

Creates a FuzzySuggester instance.
public FuzzySuggester ( Analyzer indexAnalyzer, Analyzer queryAnalyzer, SuggesterOptions options, int maxSurfaceFormsPerAnalyzedForm, int maxGraphExpansions, bool preservePositionIncrements, int maxEdits, bool transpositions, int nonFuzzyPrefix, int minFuzzyLength, bool unicodeAware ) : Lucene.Net.Analysis
indexAnalyzer Lucene.Net.Analysis.Analyzer The that will be used for /// analyzing suggestions while building the index.
queryAnalyzer Lucene.Net.Analysis.Analyzer The that will be used for /// analyzing query text during lookup
options SuggesterOptions see ,
maxSurfaceFormsPerAnalyzedForm int Maximum number of /// surface forms to keep for a single analyzed form. /// When there are too many surface forms we discard the /// lowest weighted ones.
maxGraphExpansions int Maximum number of graph paths /// to expand from the analyzed form. Set this to -1 for /// no limit.
preservePositionIncrements bool Whether position holes should appear in the automaton
maxEdits int must be >= 0 and <= .
transpositions bool true if transpositions should be treated as a primitive /// edit operation. If this is false, comparisons will implement the classic /// Levenshtein algorithm.
nonFuzzyPrefix int length of common (non-fuzzy) prefix (see default
minFuzzyLength int minimum length of lookup key before any edits are allowed (see default )
unicodeAware bool operate Unicode code points instead of bytes.
리턴 Lucene.Net.Analysis

GetFullPrefixPaths() 보호된 메소드

protected GetFullPrefixPaths ( BytesRef>.List prefixPaths, Automaton lookupAutomaton, BytesRef>.FST fst ) : BytesRef>.Pair>>.List
prefixPaths BytesRef>.List
lookupAutomaton Lucene.Net.Util.Automaton.Automaton
fst BytesRef>.FST
리턴 BytesRef>.Pair>>.List