SpellChecker.Net.Search.Spell.SpellChecker.SetAccuracy C# (CSharp) Method

SetAccuracy() public method

Set the accuracy 0 < min < 1; default 0.5
public SetAccuracy ( float minScore ) : void
minScore float
return void
        virtual public void SetAccuracy(float minScore)
        {
            this.minScore = minScore;
        }

Usage Example

Example #1
0
		private static void Main(string[] args)
		{
		    var ramDirectory = new RAMDirectory();
		    var spellChecker = new SpellChecker.Net.Search.Spell.SpellChecker(ramDirectory);
		    var ms = new MemoryStream();
		    var sw = new StreamWriter(ms);
            sw.WriteLine("Book");
            sw.WriteLine("Bath");
            sw.WriteLine("Bed");
            sw.WriteLine("Make");
            sw.WriteLine("Model");
            sw.WriteLine("Vacum");
            sw.WriteLine("Wending machine");
            sw.Flush();
		    ms.Position = 0;
            spellChecker.setStringDistance(new JaroWinklerDistance());
            spellChecker.SetAccuracy(0.3f);
            spellChecker.IndexDictionary(new PlainTextDictionary(ms), CancellationToken.None);

		    var indexReader = IndexReader.Open(ramDirectory, true);
		    var termEnum = indexReader.Terms();
		    while (termEnum.Next())
		    {
		        Console.WriteLine(termEnum.Term);
		    }

		    var suggestSimilar = spellChecker.SuggestSimilar("both", 10);
		    foreach (var s in suggestSimilar)
		    {
		        Console.WriteLine(s);
		    }
		}
All Usage Examples Of SpellChecker.Net.Search.Spell.SpellChecker::SetAccuracy