Class HyphenationCompoundWordTokenFilter
A Token
"Donaudampfschiff" becomes Donau, dampf, schiff so that you can find "Donaudampfschiff" even when you only enter "schiff". It uses a hyphenation grammar and a word dictionary to achieve this.
You must specify the required Lucene
- As of 3.1, CompoundWordTokenFilterBase correctly handles Unicode 4.0 supplementary characters in strings and char arrays provided as compound word dictionaries.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Compound
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class HyphenationCompoundWordTokenFilter : CompoundWordTokenFilterBase, IDisposable
Constructors
| Improve this Doc View SourceHyphenationCompoundWordTokenFilter(LuceneVersion, TokenStream, HyphenationTree)
Create a Hyphenation
Calls Hyphenation
Declaration
public HyphenationCompoundWordTokenFilter(LuceneVersion matchVersion, TokenStream input, HyphenationTree hyphenator)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
matchVersion | |
Token |
input | |
Hyphenation |
hyphenator |
HyphenationCompoundWordTokenFilter(LuceneVersion, TokenStream, HyphenationTree, CharArraySet)
Creates a new Hyphenation
Declaration
public HyphenationCompoundWordTokenFilter(LuceneVersion matchVersion, TokenStream input, HyphenationTree hyphenator, CharArraySet dictionary)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
matchVersion | Lucene version to enable correct Unicode 4.0 behavior in the dictionaries if Version > 3.0. See CompoundWordTokenFilterBase for details. |
Token |
input | the Token |
Hyphenation |
hyphenator | the hyphenation pattern tree to use for hyphenation |
Char |
dictionary | the word dictionary to match against. |
HyphenationCompoundWordTokenFilter(LuceneVersion, TokenStream, HyphenationTree, CharArraySet, Int32, Int32, Int32, Boolean)
Creates a new Hyphenation
Declaration
public HyphenationCompoundWordTokenFilter(LuceneVersion matchVersion, TokenStream input, HyphenationTree hyphenator, CharArraySet dictionary, int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
matchVersion | Lucene version to enable correct Unicode 4.0 behavior in the dictionaries if Version > 3.0. See CompoundWordTokenFilterBase for details. |
Token |
input | the Token |
Hyphenation |
hyphenator | the hyphenation pattern tree to use for hyphenation |
Char |
dictionary | the word dictionary to match against. |
System. |
minWordSize | only words longer than this get processed |
System. |
minSubwordSize | only subwords longer than this get to the output stream |
System. |
maxSubwordSize | only subwords shorter than this get to the output stream |
System. |
onlyLongestMatch | Add only the longest matching subword to the stream |
HyphenationCompoundWordTokenFilter(LuceneVersion, TokenStream, HyphenationTree, Int32, Int32, Int32)
Create a Hyphenation
Declaration
public HyphenationCompoundWordTokenFilter(LuceneVersion matchVersion, TokenStream input, HyphenationTree hyphenator, int minWordSize, int minSubwordSize, int maxSubwordSize)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
matchVersion | |
Token |
input | |
Hyphenation |
hyphenator | |
System. |
minWordSize | |
System. |
minSubwordSize | |
System. |
maxSubwordSize |
Methods
| Improve this Doc View SourceDecompose()
Declaration
protected override void Decompose()
Overrides
| Improve this Doc View SourceGetHyphenationTree(FileInfo)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(FileInfo hyphenationFile)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationFile | the file of the XML grammar to load |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |
GetHyphenationTree(FileInfo, Encoding)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(FileInfo hyphenationFile, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationFile | the file of the XML grammar to load |
System. |
encoding | The character encoding to use |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |
GetHyphenationTree(Stream)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(Stream hyphenationSource)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationSource | the InputSource pointing to the XML grammar |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |
GetHyphenationTree(Stream, Encoding)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(Stream hyphenationSource, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationSource | the InputSource pointing to the XML grammar |
System. |
encoding | The character encoding to use |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |
GetHyphenationTree(String)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(string hyphenationFilename)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationFilename | the filename of the XML grammar to load |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |
GetHyphenationTree(String, Encoding)
Create a hyphenator tree
Declaration
public static HyphenationTree GetHyphenationTree(string hyphenationFilename, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System. |
hyphenationFilename | the filename of the XML grammar to load |
System. |
encoding | The character encoding to use |
Returns
Type | Description |
---|---|
Hyphenation |
An object representing the hyphenation patterns |
Exceptions
Type | Condition |
---|---|
System. |
If there is a low-level I/O error. |