Class ReverseStringFilter
Reverse token string, for example "country" => "yrtnuoc".
If Lucene.Net.Analysis.Reverse.ReverseStringFilter.marker is supplied, then tokens will be also prepended by that character. For example, with a marker of \u0001, "country" => "\u0001yrtnuoc". This is useful when implementing efficient leading wildcards search.
You must specify the required LuceneVersion compatibility when creating ReverseStringFilter, or when using any of its static methods:
- As of 3.1, supplementary characters are handled correctly
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Reverse
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class ReverseStringFilter : TokenFilter, IDisposable
Constructors
| Improve this Doc View SourceReverseStringFilter(LuceneVersion, TokenStream)
Create a new ReverseStringFilter that reverses all tokens in the supplied TokenStream.
The reversed tokens will not be marked.
Declaration
public ReverseStringFilter(LuceneVersion matchVersion, TokenStream in)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
TokenStream | in | TokenStream to filter |
ReverseStringFilter(LuceneVersion, TokenStream, Char)
Create a new ReverseStringFilter that reverses and marks all tokens in the supplied TokenStream.
The reversed tokens will be prepended (marked) by the marker
character.
Declaration
public ReverseStringFilter(LuceneVersion matchVersion, TokenStream in, char marker)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
TokenStream | in | TokenStream to filter |
System.Char | marker | A character used to mark reversed tokens |
Fields
| Improve this Doc View SourceINFORMATION_SEPARATOR_MARKER
Example marker character: U+001F (INFORMATION SEPARATOR ONE)
Declaration
public const char INFORMATION_SEPARATOR_MARKER = '\u001f'
Field Value
Type | Description |
---|---|
System.Char |
PUA_EC00_MARKER
Example marker character: U+EC00 (PRIVATE USE AREA: EC00)
Declaration
public const char PUA_EC00_MARKER = ''
Field Value
Type | Description |
---|---|
System.Char |
RTL_DIRECTION_MARKER
Example marker character: U+200F (RIGHT-TO-LEFT MARK)
Declaration
public const char RTL_DIRECTION_MARKER = ''
Field Value
Type | Description |
---|---|
System.Char |
START_OF_HEADING_MARKER
Example marker character: U+0001 (START OF HEADING)
Declaration
public const char START_OF_HEADING_MARKER = '\u0001'
Field Value
Type | Description |
---|---|
System.Char |
Methods
| Improve this Doc View SourceIncrementToken()
Declaration
public override bool IncrementToken()
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceReverse(LuceneVersion, Char[])
Reverses the given input buffer in-place
Declaration
public static void Reverse(LuceneVersion matchVersion, char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
System.Char[] | buffer | the input char array to reverse |
Reverse(LuceneVersion, Char[], Int32)
Partially reverses the given input buffer in-place from offset 0 up to the given length.
Declaration
public static void Reverse(LuceneVersion matchVersion, char[] buffer, int len)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
System.Char[] | buffer | the input char array to reverse |
System.Int32 | len | the length in the buffer up to where the buffer should be reversed |
Reverse(LuceneVersion, Char[], Int32, Int32)
Partially reverses the given input buffer in-place from the given offset up to the given length.
Declaration
public static void Reverse(LuceneVersion matchVersion, char[] buffer, int start, int len)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
System.Char[] | buffer | the input char array to reverse |
System.Int32 | start | the offset from where to reverse the buffer |
System.Int32 | len | the length in the buffer up to where the buffer should be reversed |
Reverse(LuceneVersion, String)
Reverses the given input string
Declaration
public static string Reverse(LuceneVersion matchVersion, string input)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version |
System.String | input | the string to reverse |
Returns
Type | Description |
---|---|
System.String | the given input string in reversed order |