Class BaseTokenStreamTestCase
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Inheritance
BaseTokenStreamTestCase
Assembly: Lucene.Net.TestFramework.dll
Syntax
public abstract class BaseTokenStreamTestCase : LuceneTestCase
Methods
AssertAnalyzesTo(Analyzer, string, string[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] posIncrements)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
posIncrements |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets, int[] posIncrements)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| int[] |
posIncrements |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[], string[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements)
Parameters
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[], string[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths)
Parameters
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[], string[], int[], int[], bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, bool offsetsAreCorrect)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| bool |
offsetsAreCorrect |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], int[], int[], string[], int[], int[], bool, byte[][])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, bool graphOffsetsAreCorrect, byte[][] payloads)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| bool |
graphOffsetsAreCorrect |
|
| byte[][] |
payloads |
|
See Also
AssertAnalyzesTo(Analyzer, string, string[], string[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesTo(Analyzer a, string input, string[] output, string[] types)
Parameters
See Also
AssertAnalyzesToPositions(Analyzer, string, string[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertAnalyzesToPositions(Analyzer a, string input, string[] output, int[] posIncrements, int[] posLengths)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string[] |
output |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
See Also
AssertTokenStreamContents(TokenStream, string[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] posIncrements)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
posIncrements |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, int[] posIncrements)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| int[] |
posIncrements |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], int[], int[], int?)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, int[] posIncrements, int[] posLengths, int? finalOffset)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| int? |
finalOffset |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], int[], int?)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, int[] posIncrements, int? finalOffset)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| int[] |
posIncrements |
|
| int? |
finalOffset |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], int?)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, int? finalOffset)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| int? |
finalOffset |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[], int[], int?)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, int? finalOffset)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| int? |
finalOffset |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[], int[], int?, bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, int? finalOffset, bool offsetsAreCorrect)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| int? |
finalOffset |
|
| bool |
offsetsAreCorrect |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[], int[], int?, bool[], bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, int? finalOffset, bool[] keywordAtts, bool offsetsAreCorrect)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| int? |
finalOffset |
|
| bool[] |
keywordAtts |
|
| bool |
offsetsAreCorrect |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[], int[], int?, int?, bool[], bool, byte[][])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int[] posLengths, int? finalOffset, int? finalPosInc, bool[] keywordAtts, bool offsetsAreCorrect, byte[][] payloads)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int[] |
posLengths |
|
| int? |
finalOffset |
|
| int? |
finalPosInc |
|
| bool[] |
keywordAtts |
|
| bool |
offsetsAreCorrect |
|
| byte[][] |
payloads |
|
See Also
AssertTokenStreamContents(TokenStream, string[], int[], int[], string[], int[], int?)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, int[] startOffsets, int[] endOffsets, string[] types, int[] posIncrements, int? finalOffset)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| int[] |
startOffsets |
|
| int[] |
endOffsets |
|
| string[] |
types |
|
| int[] |
posIncrements |
|
| int? |
finalOffset |
|
See Also
AssertTokenStreamContents(TokenStream, string[], string[])
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void AssertTokenStreamContents(TokenStream ts, string[] output, string[] types)
Parameters
| Type |
Name |
Description |
| TokenStream |
ts |
|
| string[] |
output |
|
| string[] |
types |
|
See Also
CheckAnalysisConsistency(Random, Analyzer, bool, string)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void CheckAnalysisConsistency(Random random, Analyzer a, bool useCharFilter, string text)
Parameters
See Also
CheckAnalysisConsistency(Random, Analyzer, bool, string, bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void CheckAnalysisConsistency(Random random, Analyzer a, bool useCharFilter, string text, bool offsetsAreCorrect)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| bool |
useCharFilter |
|
| string |
text |
|
| bool |
offsetsAreCorrect |
|
See Also
CheckOneTerm(Analyzer, string, string)
Simple utility method for testing stemmers
Declaration
public static void CheckOneTerm(Analyzer a, string input, string expected)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
input |
|
| string |
expected |
|
See Also
CheckRandomData(Random, Analyzer, int)
Utility method for blasting tokenstreams with data to make sure they don't do anything crazy
Declaration
public static void CheckRandomData(Random random, Analyzer a, int iterations)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| int |
iterations |
|
See Also
CheckRandomData(Random, Analyzer, int, bool)
Utility method for blasting tokenstreams with data to make sure they don't do anything crazy
Declaration
public static void CheckRandomData(Random random, Analyzer a, int iterations, bool simple)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| int |
iterations |
|
| bool |
simple |
true if only ascii strings will be used (try to avoid)
|
See Also
CheckRandomData(Random, Analyzer, int, int)
Utility method for blasting tokenstreams with data to make sure they don't do anything crazy
Declaration
public static void CheckRandomData(Random random, Analyzer a, int iterations, int maxWordLength)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| int |
iterations |
|
| int |
maxWordLength |
|
See Also
CheckRandomData(Random, Analyzer, int, int, bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void CheckRandomData(Random random, Analyzer a, int iterations, int maxWordLength, bool simple)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| int |
iterations |
|
| int |
maxWordLength |
|
| bool |
simple |
|
See Also
CheckRandomData(Random, Analyzer, int, int, bool, bool)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static void CheckRandomData(Random random, Analyzer a, int iterations, int maxWordLength, bool simple, bool offsetsAreCorrect)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
| Analyzer |
a |
|
| int |
iterations |
|
| int |
maxWordLength |
|
| bool |
simple |
|
| bool |
offsetsAreCorrect |
|
See Also
Escape(string)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
public static string Escape(string s)
Parameters
| Type |
Name |
Description |
| string |
s |
|
Returns
See Also
NewAttributeFactory()
Returns a random Lucene.Net.Util.AttributeSource.AttributeFactory impl
Declaration
public static AttributeSource.AttributeFactory NewAttributeFactory()
Returns
| Type |
Description |
| AttributeSource.AttributeFactory |
|
See Also
NewAttributeFactory(Random)
Returns a random Lucene.Net.Util.AttributeSource.AttributeFactory impl
Declaration
public static AttributeSource.AttributeFactory NewAttributeFactory(Random random)
Parameters
| Type |
Name |
Description |
| Random |
random |
|
Returns
| Type |
Description |
| AttributeSource.AttributeFactory |
|
See Also
ToDot(Analyzer, string)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
protected virtual string ToDot(Analyzer a, string inputText)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
inputText |
|
Returns
See Also
ToDotFile(Analyzer, string, string)
Base class for all Lucene unit tests that use Lucene.Net.Analysis.TokenStreams.
When writing unit tests for analysis components, its highly recommended
to use the helper methods here (especially in conjunction with
MockAnalyzer or
MockTokenizer), as they contain many assertions and checks to
catch bugs.
Declaration
protected virtual void ToDotFile(Analyzer a, string inputText, string localFileName)
Parameters
| Type |
Name |
Description |
| Analyzer |
a |
|
| string |
inputText |
|
| string |
localFileName |
|
See Also
See Also