本文整理汇总了C#中MockTokenizer类的典型用法代码示例。如果您正苦于以下问题:C# MockTokenizer类的具体用法?C# MockTokenizer怎么用?C# MockTokenizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MockTokenizer类属于命名空间,在下文中一共展示了MockTokenizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestCaseInsensitive
public virtual void TestCaseInsensitive()
{
TextReader reader = new StringReader("L'avion");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = TokenFilterFactory("Elision", "articles", "frenchArticles.txt", "ignoreCase", "true").Create(stream);
AssertTokenStreamContents(stream, new string[] { "avion" });
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestElisionFilterFactory.cs
示例2: testStemming
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testStemming() throws Exception
public virtual void testStemming()
{
Reader reader = new StringReader("cariñosa");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("GalicianStem").create(stream);
assertTokenStreamContents(stream, new string[] {"cariñ"});
}
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestGalicianStemFilterFactory.cs
示例3: TestStemming
public virtual void TestStemming()
{
TextReader reader = new StringReader("questões");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = TokenFilterFactory("PortugueseMinimalStem").Create(stream);
AssertTokenStreamContents(stream, new string[] { "questão" });
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestPortugueseMinimalStemFilterFactory.cs
示例4: testTrimming
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testTrimming() throws Exception
public virtual void testTrimming()
{
Reader reader = new StringReader("trim me ");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
stream = tokenFilterFactory("Trim").create(stream);
assertTokenStreamContents(stream, new string[] {"trim me"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestTrimFilterFactory.cs
示例5: testNormalization
/// <summary>
/// Ensure the filter actually lowercases (and a bit more) greek text.
/// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testNormalization() throws Exception
public virtual void testNormalization()
{
Reader reader = new StringReader("Μάϊος ΜΆΪΟΣ");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("GreekLowerCase").create(stream);
assertTokenStreamContents(stream, new string[] {"μαιοσ", "μαιοσ"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestGreekLowerCaseFilterFactory.cs
示例6: testConsumeAllTokens
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testConsumeAllTokens() throws Exception
public virtual void testConsumeAllTokens()
{
Reader reader = new StringReader("A1 B2 C3 D4 E5 F6");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("LimitTokenPosition", "maxTokenPosition", "3", "consumeAllTokens", "true").create(stream);
assertTokenStreamContents(stream, new string[] {"A1", "B2", "C3"});
}
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestLimitTokenPositionFilterFactory.cs
示例7: testCapitalization12
/// <summary>
/// test with numbers </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testCapitalization12() throws Exception
public virtual void testCapitalization12()
{
Reader reader = new StringReader("1st 2nd third");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "okPrefix", "McK", "forceFirstLetter", "false").create(stream);
assertTokenStreamContents(stream, new string[] {"1st", "2nd", "Third"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:11,代码来源:TestCapitalizationFilterFactory.cs
示例8: testFiltering
/// <summary>
/// Ensure the filter actually normalizes text (numerics, stopwords)
/// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testFiltering() throws Exception
public virtual void testFiltering()
{
Reader reader = new StringReader("this 1234 Is such a silly filter");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("Chinese").create(stream);
assertTokenStreamContents(stream, new string[] {"Is", "silly", "filter"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestChineseFilterFactory.cs
示例9: testASCIIFolding
/// <summary>
/// Ensure the ASCIIFoldingFilterFactory works
/// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testASCIIFolding() throws Exception
public virtual void testASCIIFolding()
{
Reader reader = new StringReader("Česká");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("ASCIIFolding").create(stream);
assertTokenStreamContents(stream, new string[] {"Ceska"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestStandardFactories.cs
示例10: testCapitalization
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testCapitalization() throws Exception
public virtual void testCapitalization()
{
Reader reader = new StringReader("kiTTEN");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true").create(stream);
assertTokenStreamContents(stream, new string[] {"Kitten"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestCapitalizationFilterFactory.cs
示例11: testStemming
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testStemming() throws Exception
public virtual void testStemming()
{
Reader reader = new StringReader("äpplen äpple");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("SwedishLightStem").create(stream);
assertTokenStreamContents(stream, new string[] {"äppl", "äppl"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestSwedishLightStemFilterFactory.cs
示例12: testStemming
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testStemming() throws Exception
public virtual void testStemming()
{
Reader reader = new StringReader("abc");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("HunspellStem", "dictionary", "simple.dic", "affix", "simple.aff").create(stream);
assertTokenStreamContents(stream, new string[] {"ab"});
}
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestHunspellStemFilterFactory.cs
示例13: TestStemmingInflectional
public virtual void TestStemmingInflectional()
{
TextReader reader = new StringReader("dibukukannya");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = TokenFilterFactory("IndonesianStem", "stemDerivational", "false").Create(stream);
AssertTokenStreamContents(stream, new string[] { "dibukukan" });
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestIndonesianStemFilterFactory.cs
示例14: testStemming
/// <summary>
/// Ensure the filter actually stems and normalizes text.
/// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testStemming() throws Exception
public virtual void testStemming()
{
Reader reader = new StringReader("Brasília");
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
TokenStream stream = tokenFilterFactory("BrazilianStem").create(tokenizer);
assertTokenStreamContents(stream, new string[] {"brasil"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestBrazilianStemFilterFactory.cs
示例15: testPositionIncrements
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testPositionIncrements() throws Exception
public virtual void testPositionIncrements()
{
Reader reader = new StringReader("foo foobar super-duper-trooper");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("CodepointCount", "min", "4", "max", "10").create(stream);
assertTokenStreamContents(stream, new string[] {"foobar"}, new int[] {2});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestCodepointCountFilterFactory.cs
示例16: testApostropheFilter
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testApostropheFilter() throws Exception
public virtual void testApostropheFilter()
{
TokenStream stream = new MockTokenizer(new StringReader("Türkiye'de 2003'te Van Gölü'nü gördüm"), MockTokenizer.WHITESPACE, false);
stream = new TurkishLowerCaseFilter(stream);
stream = new ApostropheFilter(stream);
assertTokenStreamContents(stream, new string[]{"türkiye", "2003", "van", "gölü", "gördüm"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestApostropheFilter.cs
示例17: testOffsets
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testOffsets() throws Exception
public virtual void testOffsets()
{
string input = "abc- def geh 1234- 5678-";
TokenStream ts = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
ts = new HyphenatedWordsFilter(ts);
assertTokenStreamContents(ts, new string[] {"abcdef", "geh", "12345678-"}, new int[] {0, 9, 13}, new int[] {8, 12, 24});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestHyphenatedWordsFilter.cs
示例18: TestPositionIncrements
public virtual void TestPositionIncrements()
{
Reader reader = new StringReader("foo foobar super-duper-trooper");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = TokenFilterFactory("Length", LengthFilterFactory.MIN_KEY, "4", LengthFilterFactory.MAX_KEY, "10").Create(stream);
AssertTokenStreamContents(stream, new string[] { "foobar" }, new int[] { 2 });
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestLengthFilterFactory.cs
示例19: TestLongestOnly
public virtual void TestLongestOnly()
{
MockTokenizer tokenizer = new MockTokenizer(new StringReader("lucene is awesome"));
tokenizer.EnableChecks = true;
HunspellStemFilter filter = new HunspellStemFilter(tokenizer, dictionary, true, true);
AssertTokenStreamContents(filter, new string[] { "lucene", "is", "awesome" }, new int[] { 1, 1, 1 });
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestHunspellStemFilter.cs
示例20: testCasing
/// <summary>
/// Ensure the filter actually lowercases text.
/// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testCasing() throws Exception
public virtual void testCasing()
{
Reader reader = new StringReader("AĞACI");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("TurkishLowerCase").create(stream);
assertTokenStreamContents(stream, new string[] {"ağacı"});
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestTurkishLowerCaseFilterFactory.cs
注:本文中的MockTokenizer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论