blob: 2bd1f1554dd640dc45125f382be768b450df4089 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class SpellChecker
| Apache Lucene.NET 4.8.0-beta00010 Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class SpellChecker
| Apache Lucene.NET 4.8.0-beta00010 Documentation ">
<meta name="generator" content="docfx 2.56.0.0">
<link rel="shortcut icon" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/favicon.ico">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="suggest/toc.html">
<meta property="docfx:rel" content="https://lucenenet.apache.org/docs/4.8.0-beta00009/">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img id="logo" class="svg" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search">
<ul class="level0 breadcrumb">
<li>
<a href="https://lucenenet.apache.org/docs/4.8.0-beta00009/">API</a>
<span id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</span>
</li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Lucene.Net.Search.Spell.SpellChecker">
<h1 id="Lucene_Net_Search_Spell_SpellChecker" data-uid="Lucene.Net.Search.Spell.SpellChecker" class="text-break">Class SpellChecker
</h1>
<div class="markdown level0 summary"><p>
Spell Checker class (Main class) <br>
(initially inspired by the David Spencer code).
</p>
<p>Example Usage (C#):
<pre><code> SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
// To index a field of a user index:
spellchecker.IndexDictionary(new LuceneDictionary(my_lucene_reader, a_field));
// To index a file containing words:
spellchecker.IndexDictionary(new PlainTextDictionary(new FileInfo(&quot;myfile.txt&quot;)));
string[] suggestions = spellchecker.SuggestSimilar(&quot;misspelt&quot;, 5);</code></pre>
</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">SpellChecker</span></div>
</div>
<div classs="implements">
<h5>Implements</h5>
<div><span class="xref">System.IDisposable</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Lucene.Net.Search.Spell.html">Lucene.Net.Search.Spell</a></h6>
<h6><strong>Assembly</strong>: Lucene.Net.Suggest.dll</h6>
<h5 id="Lucene_Net_Search_Spell_SpellChecker_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class SpellChecker : IDisposable</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.%23ctor(Lucene.Net.Store.Directory)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L117">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker__ctor_" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor(Lucene.Net.Store.Directory)">SpellChecker(Directory)</h4>
<div class="markdown level1 summary"><p>Use the given directory as a spell checker index with a
<a class="xref" href="Lucene.Net.Search.Spell.LevensteinDistance.html">LevensteinDistance</a> as the default <span class="xref">StringDistance</span>. The
directory is created if it doesn&apos;t exist yet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SpellChecker(Directory spellIndex)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Lucene.Net.Store.Directory</span></td>
<td><span class="parametername">spellIndex</span></td>
<td><p>the spell index directory </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if spellchecker can not open the directory </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_Lucene_Net_Search_Spell_IStringDistance_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.%23ctor(Lucene.Net.Store.Directory%2CLucene.Net.Search.Spell.IStringDistance)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L104">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker__ctor_" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_Lucene_Net_Search_Spell_IStringDistance_" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor(Lucene.Net.Store.Directory,Lucene.Net.Search.Spell.IStringDistance)">SpellChecker(Directory, IStringDistance)</h4>
<div class="markdown level1 summary"><p>Use the given directory as a spell checker index. The directory
is created if it doesn&apos;t exist yet. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SpellChecker(Directory spellIndex, IStringDistance sd)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Lucene.Net.Store.Directory</span></td>
<td><span class="parametername">spellIndex</span></td>
<td><p>the spell index directory </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.IStringDistance.html">IStringDistance</a></td>
<td><span class="parametername">sd</span></td>
<td><p>the <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_StringDistance">StringDistance</a> measurement to use </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if Spellchecker can not open the directory </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_Lucene_Net_Search_Spell_IStringDistance_System_Collections_Generic_IComparer_Lucene_Net_Search_Spell_SuggestWord__.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.%23ctor(Lucene.Net.Store.Directory%2CLucene.Net.Search.Spell.IStringDistance%2CSystem.Collections.Generic.IComparer%7BLucene.Net.Search.Spell.SuggestWord%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L129">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker__ctor_" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker__ctor_Lucene_Net_Store_Directory_Lucene_Net_Search_Spell_IStringDistance_System_Collections_Generic_IComparer_Lucene_Net_Search_Spell_SuggestWord__" data-uid="Lucene.Net.Search.Spell.SpellChecker.#ctor(Lucene.Net.Store.Directory,Lucene.Net.Search.Spell.IStringDistance,System.Collections.Generic.IComparer{Lucene.Net.Search.Spell.SuggestWord})">SpellChecker(Directory, IStringDistance, IComparer&lt;SuggestWord&gt;)</h4>
<div class="markdown level1 summary"><p>Use the given directory as a spell checker index with the given <a class="xref" href="Lucene.Net.Search.Spell.IStringDistance.html">IStringDistance</a> measure
and the given <span class="xref">System.Collections.Generic.IComparer&lt;T&gt;</span> for sorting the results. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SpellChecker(Directory spellIndex, IStringDistance sd, IComparer&lt;SuggestWord&gt; comparer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Lucene.Net.Store.Directory</span></td>
<td><span class="parametername">spellIndex</span></td>
<td><p>The spelling index </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.IStringDistance.html">IStringDistance</a></td>
<td><span class="parametername">sd</span></td>
<td><p>The distance </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Collections.Generic.IComparer</span>&lt;<a class="xref" href="Lucene.Net.Search.Spell.SuggestWord.html">SuggestWord</a>&gt;</td>
<td><span class="parametername">comparer</span></td>
<td><p>The comparer </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if there is a problem opening the index </p>
</td>
</tr>
</tbody>
</table>
<h3 id="fields">Fields
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_DEFAULT_ACCURACY.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.DEFAULT_ACCURACY%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L54">View Source</a>
</span>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_DEFAULT_ACCURACY" data-uid="Lucene.Net.Search.Spell.SpellChecker.DEFAULT_ACCURACY">DEFAULT_ACCURACY</h4>
<div class="markdown level1 summary"><p>The default minimum score to use, if not specified by setting <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_Accuracy">Accuracy</a>
or overriding with <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</a> .</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const float DEFAULT_ACCURACY = 0.5F</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Single</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_F_WORD.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.F_WORD%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L59">View Source</a>
</span>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_F_WORD" data-uid="Lucene.Net.Search.Spell.SpellChecker.F_WORD">F_WORD</h4>
<div class="markdown level1 summary"><p>Field name for each word in the ngram index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string F_WORD = &quot;word&quot;</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_Accuracy.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.Accuracy%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L189">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_Accuracy_" data-uid="Lucene.Net.Search.Spell.SpellChecker.Accuracy*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_Accuracy" data-uid="Lucene.Net.Search.Spell.SpellChecker.Accuracy">Accuracy</h4>
<div class="markdown level1 summary"><p>Gets or sets the accuracy (minimum score) to be used, unless overridden in
<a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</a>,
to decide whether a suggestion is included or not.
Sets the accuracy 0 &lt; minScore &lt; 1; default <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_DEFAULT_ACCURACY">DEFAULT_ACCURACY</a></p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual float Accuracy { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Single</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_Comparer.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.Comparer%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L166">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_Comparer_" data-uid="Lucene.Net.Search.Spell.SpellChecker.Comparer*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_Comparer" data-uid="Lucene.Net.Search.Spell.SpellChecker.Comparer">Comparer</h4>
<div class="markdown level1 summary"><p>Gets or sets the <span class="xref">System.Collections.Generic.IComparer&lt;T&gt;</span> for the <a class="xref" href="Lucene.Net.Search.Spell.SuggestWordQueue.html">SuggestWordQueue</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual IComparer&lt;SuggestWord&gt; Comparer { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.IComparer</span>&lt;<a class="xref" href="Lucene.Net.Search.Spell.SuggestWord.html">SuggestWord</a>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_StringDistance.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.StringDistance%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L177">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_StringDistance_" data-uid="Lucene.Net.Search.Spell.SpellChecker.StringDistance*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_StringDistance" data-uid="Lucene.Net.Search.Spell.SpellChecker.StringDistance">StringDistance</h4>
<div class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="Lucene.Net.Search.Spell.IStringDistance.html">IStringDistance</a> implementation for this
<a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html">SpellChecker</a> instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual IStringDistance StringDistance { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.IStringDistance.html">IStringDistance</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_ClearIndex.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.ClearIndex%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L442">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_ClearIndex_" data-uid="Lucene.Net.Search.Spell.SpellChecker.ClearIndex*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_ClearIndex" data-uid="Lucene.Net.Search.Spell.SpellChecker.ClearIndex">ClearIndex()</h4>
<div class="markdown level1 summary"><p>Removes all terms from the spell check index. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual void ClearIndex()</code></pre>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>If there is a low-level I/O error. </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the Spellchecker is already closed </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_Dispose.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.Dispose%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L661">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_Dispose_" data-uid="Lucene.Net.Search.Spell.SpellChecker.Dispose*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_Dispose" data-uid="Lucene.Net.Search.Spell.SpellChecker.Dispose">Dispose()</h4>
<div class="markdown level1 summary"><p>Dispose the underlying IndexSearcher used by this SpellChecker </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if the close operation causes an <span class="xref">System.IO.IOException</span> </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html">SpellChecker</a> is already disposed </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_Exist_System_String_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.Exist(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L462">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_Exist_" data-uid="Lucene.Net.Search.Spell.SpellChecker.Exist*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_Exist_System_String_" data-uid="Lucene.Net.Search.Spell.SpellChecker.Exist(System.String)">Exist(String)</h4>
<div class="markdown level1 summary"><p>Check whether the word exists in the index. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool Exist(string word)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">word</span></td>
<td><p>word to check </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>true if the word exists in the index </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>If there is a low-level I/O error. </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html">SpellChecker</a> is already disposed </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_IndexDictionary_Lucene_Net_Search_Spell_IDictionary_Lucene_Net_Index_IndexWriterConfig_System_Boolean_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.IndexDictionary(Lucene.Net.Search.Spell.IDictionary%2CLucene.Net.Index.IndexWriterConfig%2CSystem.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L485">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_IndexDictionary_" data-uid="Lucene.Net.Search.Spell.SpellChecker.IndexDictionary*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_IndexDictionary_Lucene_Net_Search_Spell_IDictionary_Lucene_Net_Index_IndexWriterConfig_System_Boolean_" data-uid="Lucene.Net.Search.Spell.SpellChecker.IndexDictionary(Lucene.Net.Search.Spell.IDictionary,Lucene.Net.Index.IndexWriterConfig,System.Boolean)">IndexDictionary(IDictionary, IndexWriterConfig, Boolean)</h4>
<div class="markdown level1 summary"><p>Indexes the data from the given <a class="xref" href="Lucene.Net.Search.Spell.IDictionary.html">IDictionary</a>. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void IndexDictionary(IDictionary dict, IndexWriterConfig config, bool fullMerge)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.IDictionary.html">IDictionary</a></td>
<td><span class="parametername">dict</span></td>
<td><p>Dictionary to index </p>
</td>
</tr>
<tr>
<td><span class="xref">Lucene.Net.Index.IndexWriterConfig</span></td>
<td><span class="parametername">config</span></td>
<td><p><span class="xref">Lucene.Net.Index.IndexWriterConfig</span> to use </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">fullMerge</span></td>
<td><p>whether or not the spellcheck index should be fully merged </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html">SpellChecker</a> is already disposed </p>
</td>
</tr>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>If there is a low-level I/O error. </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_SetSpellIndex_Lucene_Net_Store_Directory_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.SetSpellIndex(Lucene.Net.Store.Directory)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L144">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_SetSpellIndex_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SetSpellIndex*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_SetSpellIndex_Lucene_Net_Store_Directory_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SetSpellIndex(Lucene.Net.Store.Directory)">SetSpellIndex(Directory)</h4>
<div class="markdown level1 summary"><p>Sets a different index as the spell checker index or re-open
the existing index if <pre><code>spellIndex</code></pre> is the same value
as given in the constructor. </p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual void SetSpellIndex(Directory spellIndexDir)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">Lucene.Net.Store.Directory</span></td>
<td><span class="parametername">spellIndexDir</span></td>
<td><p>the spell directory to use </p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the Spellchecker is already closed </p>
</td>
</tr>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if spellchecker can not open the directory </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L217">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String,System.Int32)">SuggestSimilar(String, Int32)</h4>
<div class="markdown level1 summary"><p>Suggest similar words.
<p>
As the Lucene similarity that is used to fetch the most relevant n-grammed terms
is not the same as the edit distance strategy used to calculate the best
matching spell-checked word from the hits that Lucene found, one usually has
to retrieve a couple of numSug&apos;s in order to get the true best match.
</p>
<p>
I.e. if numSug == 1, don&apos;t count on that suggestion being the best one.
Thus, you should set this value to <strong>at least</strong> 5 for a good suggestion.
</p></p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual string[] SuggestSimilar(string word, int numSug)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">word</span></td>
<td><p>the word you want a spell check done on </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">numSug</span></td>
<td><p>the number of suggested words </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span>[]</td>
<td><p>string[] the sorted list of the suggest words with these 2 criteria:
first criteria: the edit distance, second criteria (only if restricted mode): the popularity
of the suggest words in the field of the user index</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if the underlying index throws an <span class="xref">System.IO.IOException</span> </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the Spellchecker is already disposed </p>
</td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32__seealso">See Also</h5>
<div class="seealso">
<div><a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</a></div>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String%2CSystem.Int32%2CLucene.Net.Index.IndexReader%2CSystem.String%2CLucene.Net.Search.Spell.SuggestMode)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L254">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String,System.Int32,Lucene.Net.Index.IndexReader,System.String,Lucene.Net.Search.Spell.SuggestMode)">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode)</h4>
<div class="markdown level1 summary"><p>Calls <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</a>
SuggestSimilar(word, numSug, ir, suggestMode, field, this.accuracy)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual string[] SuggestSimilar(string word, int numSug, IndexReader ir, string field, SuggestMode suggestMode)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">word</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">numSug</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">Lucene.Net.Index.IndexReader</span></td>
<td><span class="parametername">ir</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">field</span></td>
<td></td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.SuggestMode.html">SuggestMode</a></td>
<td><span class="parametername">suggestMode</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span>[]</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String%2CSystem.Int32%2CLucene.Net.Index.IndexReader%2CSystem.String%2CLucene.Net.Search.Spell.SuggestMode%2CSystem.Single)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L286">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String,System.Int32,Lucene.Net.Index.IndexReader,System.String,Lucene.Net.Search.Spell.SuggestMode,System.Single)">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</h4>
<div class="markdown level1 summary"><p>Suggest similar words (optionally restricted to a field of an index).
<p>
As the Lucene similarity that is used to fetch the most relevant n-grammed terms
is not the same as the edit distance strategy used to calculate the best
matching spell-checked word from the hits that Lucene found, one usually has
to retrieve a couple of numSug&apos;s in order to get the true best match.
</p>
<p>
I.e. if numSug == 1, don&apos;t count on that suggestion being the best one.
Thus, you should set this value to <strong>at least</strong> 5 for a good suggestion.
</p></p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual string[] SuggestSimilar(string word, int numSug, IndexReader ir, string field, SuggestMode suggestMode, float accuracy)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">word</span></td>
<td><p>the word you want a spell check done on </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">numSug</span></td>
<td><p>the number of suggested words </p>
</td>
</tr>
<tr>
<td><span class="xref">Lucene.Net.Index.IndexReader</span></td>
<td><span class="parametername">ir</span></td>
<td><p>the indexReader of the user index (can be null see field param) </p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">field</span></td>
<td><p>the field of the user index: if field is not null, the suggested
words are restricted to the words present in this field. </p>
</td>
</tr>
<tr>
<td><a class="xref" href="Lucene.Net.Search.Spell.SuggestMode.html">SuggestMode</a></td>
<td><span class="parametername">suggestMode</span></td>
<td><p>(NOTE: if indexReader==null and/or field==null, then this is overridden with SuggestMode.SUGGEST_ALWAYS) </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Single</span></td>
<td><span class="parametername">accuracy</span></td>
<td><p>The minimum score a suggestion must have in order to qualify for inclusion in the results </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span>[]</td>
<td><p>string[] the sorted list of the suggest words with these 2 criteria:
first criteria: the edit distance, second criteria (only if restricted mode): the popularity
of the suggest words in the field of the user index</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if the underlying index throws an <span class="xref">System.IO.IOException</span> </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the <a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html">SpellChecker</a> is already disposed </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_System_Single_.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String%2CSystem.Int32%2CSystem.Single)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/NightOwl888/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L244">View Source</a>
</span>
<a id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar*"></a>
<h4 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_System_Single_" data-uid="Lucene.Net.Search.Spell.SpellChecker.SuggestSimilar(System.String,System.Int32,System.Single)">SuggestSimilar(String, Int32, Single)</h4>
<div class="markdown level1 summary"><p>Suggest similar words.
<p>
As the Lucene similarity that is used to fetch the most relevant n-grammed terms
is not the same as the edit distance strategy used to calculate the best
matching spell-checked word from the hits that Lucene found, one usually has
to retrieve a couple of numSug&apos;s in order to get the true best match.
</p>
<p>
I.e. if numSug == 1, don&apos;t count on that suggestion being the best one.
Thus, you should set this value to <strong>at least</strong> 5 for a good suggestion.
</p></p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual string[] SuggestSimilar(string word, int numSug, float accuracy)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">word</span></td>
<td><p>the word you want a spell check done on </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">numSug</span></td>
<td><p>the number of suggested words </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Single</span></td>
<td><span class="parametername">accuracy</span></td>
<td><p>The minimum score a suggestion must have in order to qualify for inclusion in the results </p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span>[]</td>
<td><p>string[] the sorted list of the suggest words with these 2 criteria:
first criteria: the edit distance, second criteria (only if restricted mode): the popularity
of the suggest words in the field of the user index</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.IO.IOException</span></td>
<td><p>if the underlying index throws an <span class="xref">System.IO.IOException</span> </p>
</td>
</tr>
<tr>
<td><span class="xref">System.ObjectDisposedException</span></td>
<td><p>if the Spellchecker is already disposed </p>
</td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_System_Single__seealso">See Also</h5>
<div class="seealso">
<div><a class="xref" href="Lucene.Net.Search.Spell.SpellChecker.html#Lucene_Net_Search_Spell_SpellChecker_SuggestSimilar_System_String_System_Int32_Lucene_Net_Index_IndexReader_System_String_Lucene_Net_Search_Spell_SuggestMode_System_Single_">SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)</a></div>
</div>
<h3 id="implements">Implements</h3>
<div>
<span class="xref">System.IDisposable</span>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/apache/lucenenet/new/docs/4.8.0-beta00010/websites/apidocs/apiSpec/new?filename=Lucene_Net_Search_Spell_SpellChecker.md&amp;value=---%0Auid%3A%20Lucene.Net.Search.Spell.SpellChecker%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/apache/lucenenet/blob/release/Lucene.Net_4_8_0_beta00010/src/Lucene.Net.Suggest/Spell/SpellChecker.cs/#L47" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 Licensed to the Apache Software Foundation (ASF)
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.js"></script>
</body>
</html>