TableDiscreteFunction Class
Represents the fuzzy search algorithm that contains correspondences between word lengths and the number of allowed mistakes. This algorithm can be specified by a table of output values or by a step function.
Inheritance Hierarchy

Namespace: GroupDocs.Search.Options
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 21.8.1
public class TableDiscreteFunction : FuzzyAlgorithm

The TableDiscreteFunction type exposes the following members.

Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetMaxMistakeCount
Gets a maximum allowed number of mistakes for specified term length.
(Overrides FuzzyAlgorithmGetMaxMistakeCount(Int32).)
Public methodGetSimilarityLevel
Gets a similarity level for specified term length.
(Overrides FuzzyAlgorithmGetSimilarityLevel(Int32).)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Learn more
The example demonstrates a typical usage of the class.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
string query = "Einstein";

Index index = new Index(indexFolder); // Creating an index in the specified folder
index.Add(documentsFolder); // Indexing documents from the specified folder

SearchOptions options = new SearchOptions();
options.FuzzySearch.Enabled = true; // Enabling the fuzzy search
options.FuzzySearch.FuzzyAlgorithm = new TableDiscreteFunction(1, new Step(5, 2), new Step(8, 3)); // Creating the fuzzy search algorithm
// This function specifies 1 as the maximum number of mistakes for words from 1 to 4 characters.
// It specifies 2 as the maximum number of mistakes for words from 5 to 7 characters.
// It specifies 3 as the maximum number of mistakes for words from 8 and more characters.

SearchResult result = index.Search(query, options); // Search in index
See Also