当前位置: 首页>>代码示例>>Java>>正文


Java BaseTokenStreamTestCase.assertAnalyzesTo方法代码示例

本文整理汇总了Java中org.apache.lucene.analysis.BaseTokenStreamTestCase.assertAnalyzesTo方法的典型用法代码示例。如果您正苦于以下问题:Java BaseTokenStreamTestCase.assertAnalyzesTo方法的具体用法?Java BaseTokenStreamTestCase.assertAnalyzesTo怎么用?Java BaseTokenStreamTestCase.assertAnalyzesTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.analysis.BaseTokenStreamTestCase的用法示例。


在下文中一共展示了BaseTokenStreamTestCase.assertAnalyzesTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testMailtoSchemeEmails

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testMailtoSchemeEmails () throws Exception {
  // See LUCENE-3880
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "MAILTO:[email protected]",
      new String[] {"mailto", "[email protected]"},
      new String[] { "<ALPHANUM>", "<EMAIL>" });

  // TODO: Support full mailto: scheme URIs. See RFC 6068: http://tools.ietf.org/html/rfc6068
  BaseTokenStreamTestCase.assertAnalyzesTo
      (a,  "mailto:[email protected],[email protected][email protected]"
          + "&subject=Subjectivity&body=Corpusivity%20or%20something%20like%20that",
          new String[] { "mailto",
              "[email protected]",
              // TODO: recognize ',' address delimiter. Also, see examples of ';' delimiter use at: http://www.mailto.co.uk/
              ",[email protected]",
              "[email protected]", // TODO: split field keys/values
              "subject", "subjectivity",
              "body", "corpusivity", "20or", "20something","20like", "20that" }, // TODO: Hex decoding + re-tokenization
          new String[] { "<ALPHANUM>",
              "<EMAIL>",
              "<EMAIL>",
              "<EMAIL>",
              "<ALPHANUM>", "<ALPHANUM>",
              "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>" });
}
 
开发者ID:europeana,项目名称:search,代码行数:25,代码来源:TestUAX29URLEmailAnalyzer.java

示例2: testMailtoSchemeEmails

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testMailtoSchemeEmails () throws Exception {
  // See LUCENE-3880
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "mailto:[email protected]",
      new String[] {"mailto", "[email protected]"},
      new String[] { "<ALPHANUM>", "<EMAIL>" });

  // TODO: Support full mailto: scheme URIs. See RFC 6068: http://tools.ietf.org/html/rfc6068
  BaseTokenStreamTestCase.assertAnalyzesTo
      (a,  "mailto:[email protected],[email protected][email protected]"
         + "&subject=Subjectivity&body=Corpusivity%20or%20something%20like%20that",
       new String[] { "mailto",
                      "[email protected]",
                      // TODO: recognize ',' address delimiter. Also, see examples of ';' delimiter use at: http://www.mailto.co.uk/
                      ",[email protected]",
                      "[email protected]", // TODO: split field keys/values
                      "subject", "Subjectivity",
                      "body", "Corpusivity", "20or", "20something","20like", "20that" }, // TODO: Hex decoding + re-tokenization
       new String[] { "<ALPHANUM>",
                      "<EMAIL>",
                      "<EMAIL>",
                      "<EMAIL>",
                      "<ALPHANUM>", "<ALPHANUM>",
                      "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>" });
}
 
开发者ID:jimaguere,项目名称:Maskana-Gestor-de-Conocimiento,代码行数:25,代码来源:TestUAX29URLEmailTokenizer.java

示例3: testAnalyzerFactory

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testAnalyzerFactory() throws Exception {
  String text = "Fortieth, Quarantième, Cuadragésimo";
  Benchmark benchmark = execBenchmark(getAnalyzerFactoryConfig
      ("ascii folded, pattern replaced, standard tokenized, downcased, bigrammed.'analyzer'",
       "positionIncrementGap:100,offsetGap:1111,"
       +"MappingCharFilter(mapping:'test-mapping-ISOLatin1Accent-partial.txt'),"
       +"PatternReplaceCharFilterFactory(pattern:'e(\\\\\\\\S*)m',replacement:\"$1xxx$1\"),"
       +"StandardTokenizer,LowerCaseFilter,NGramTokenFilter(minGramSize:2,maxGramSize:2)"));
  BaseTokenStreamTestCase.assertAnalyzesTo(benchmark.getRunData().getAnalyzer(), text,
      new String[] { "fo", "or", "rt", "ti", "ie", "et", "th",
                     "qu", "ua", "ar", "ra", "an", "nt", "ti", "ix", "xx", "xx", "xe",
                     "cu", "ua", "ad", "dr", "ra", "ag", "gs", "si", "ix", "xx", "xx", "xs", "si", "io"});
}
 
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:TestPerfTasksLogic.java

示例4: testNumericSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testNumericSA() throws Exception {
  // floating point, serial, model numbers, ip addresses, etc.
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new String[]{"21.35"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new String[]{"r2d2", "c3po"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new String[]{"216.239.63.104"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new String[]{"216.239.63.104"});
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:TestUAX29URLEmailAnalyzer.java

示例5: testVariousTextSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testVariousTextSA() throws Exception {
  // various
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "C embedded developers wanted", new String[]{"c", "embedded", "developers", "wanted"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo bar FOO BAR", new String[]{"foo", "bar", "foo", "bar"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new String[]{"foo", "bar", "foo", "bar"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "\"QUOTED\" word", new String[]{"quoted", "word"});
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:TestUAX29URLEmailAnalyzer.java

示例6: testApostrophesSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testApostrophesSA() throws Exception {
  // internal apostrophes: O'Reilly, you're, O'Reilly's
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly", new String[]{"O'Reilly"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "you're", new String[]{"you're"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "she's", new String[]{"she's"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "Jim's", new String[]{"Jim's"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "don't", new String[]{"don't"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly's", new String[]{"O'Reilly's"});
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:10,代码来源:TestUAX29URLEmailTokenizer.java

示例7: testNumericSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testNumericSA() throws Exception {
  // floating point, serial, model numbers, ip addresses, etc.
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new String[]{"21.35"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new String[]{"R2D2", "C3PO"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new String[]{"216.239.63.104"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new String[]{"216.239.63.104"});
}
 
开发者ID:jimaguere,项目名称:Maskana-Gestor-de-Conocimiento,代码行数:8,代码来源:TestStandardAnalyzer.java

示例8: testVariousTextSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testVariousTextSA() throws Exception {
  // various
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "C embedded developers wanted", new String[]{"C", "embedded", "developers", "wanted"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo bar FOO BAR", new String[]{"foo", "bar", "FOO", "BAR"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new String[]{"foo", "bar", "FOO", "BAR"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "\"QUOTED\" word", new String[]{"QUOTED", "word"});
}
 
开发者ID:jimaguere,项目名称:Maskana-Gestor-de-Conocimiento,代码行数:8,代码来源:TestUAX29URLEmailTokenizer.java

示例9: testKoreanSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testKoreanSA() throws Exception {
  // Korean words
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "안녕하세요 한글입니다", new String[]{"안녕하세요", "한글입니다"});
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:TestStandardAnalyzer.java

示例10: testAlphanumericSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testAlphanumericSA() throws Exception {
  // alphanumeric tokens
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "B2B", new String[]{"B2B"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "2B", new String[]{"2B"});
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:TestStandardAnalyzer.java

示例11: testFarsi

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testFarsi() throws Exception {
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "ویکی پدیای انگلیسی در تاریخ ۲۵ دی ۱۳۷۹ به صورت مکملی برای دانشنامهٔ تخصصی نوپدیا نوشته شد.",
      new String[] { "ویکی", "پدیای", "انگلیسی", "در", "تاریخ", "۲۵", "دی", "۱۳۷۹", "به", "صورت", "مکملی",
      "برای", "دانشنامهٔ", "تخصصی", "نوپدیا", "نوشته", "شد" });
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:TestUAX29URLEmailAnalyzer.java

示例12: testEmpty

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testEmpty() throws Exception {
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "", new String[] {});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, ".", new String[] {});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, " ", new String[] {});
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:TestUAX29URLEmailAnalyzer.java

示例13: testThai

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testThai() throws Exception {
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "การที่ได้ต้องแสดงว่างานดี. แล้วเธอจะไปไหน? ๑๒๓๔",
      new String[] { "การที่ได้ต้องแสดงว่างานดี", "แล้วเธอจะไปไหน", "๑๒๓๔" });
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:TestUAX29URLEmailAnalyzer.java

示例14: testNumericSA

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testNumericSA() throws Exception {
  // floating point, serial, model numbers, ip addresses, etc.
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new String[]{"21.35"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new String[]{"R2D2", "C3PO"});
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new String[]{"216.239.63.104"});
}
 
开发者ID:europeana,项目名称:search,代码行数:7,代码来源:TestUAX29URLEmailTokenizer.java

示例15: testLao

import org.apache.lucene.analysis.BaseTokenStreamTestCase; //导入方法依赖的package包/类
public void testLao() throws Exception {
  BaseTokenStreamTestCase.assertAnalyzesTo(a, "ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ", 
      new String[] { "ສາທາລະນະລັດ", "ປະຊາທິປະໄຕ", "ປະຊາຊົນລາວ" });
}
 
开发者ID:europeana,项目名称:search,代码行数:5,代码来源:TestUAX29URLEmailTokenizer.java


注:本文中的org.apache.lucene.analysis.BaseTokenStreamTestCase.assertAnalyzesTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。