<small id='U90kq'></small><noframes id='U90kq'>

      <tfoot id='U90kq'></tfoot>
      • <bdo id='U90kq'></bdo><ul id='U90kq'></ul>
    1. <i id='U90kq'><tr id='U90kq'><dt id='U90kq'><q id='U90kq'><span id='U90kq'><b id='U90kq'><form id='U90kq'><ins id='U90kq'></ins><ul id='U90kq'></ul><sub id='U90kq'></sub></form><legend id='U90kq'></legend><bdo id='U90kq'><pre id='U90kq'><center id='U90kq'></center></pre></bdo></b><th id='U90kq'></th></span></q></dt></tr></i><div id='U90kq'><tfoot id='U90kq'></tfoot><dl id='U90kq'><fieldset id='U90kq'></fieldset></dl></div>

        <legend id='U90kq'><style id='U90kq'><dir id='U90kq'><q id='U90kq'></q></dir></style></legend>

        使用 Lucene 提取英语单词

        Stemming English words with Lucene(使用 Lucene 提取英语单词)
        <tfoot id='a3cwl'></tfoot>

        <small id='a3cwl'></small><noframes id='a3cwl'>

          <bdo id='a3cwl'></bdo><ul id='a3cwl'></ul>

              <legend id='a3cwl'><style id='a3cwl'><dir id='a3cwl'><q id='a3cwl'></q></dir></style></legend>
                    <tbody id='a3cwl'></tbody>
                  <i id='a3cwl'><tr id='a3cwl'><dt id='a3cwl'><q id='a3cwl'><span id='a3cwl'><b id='a3cwl'><form id='a3cwl'><ins id='a3cwl'></ins><ul id='a3cwl'></ul><sub id='a3cwl'></sub></form><legend id='a3cwl'></legend><bdo id='a3cwl'><pre id='a3cwl'><center id='a3cwl'></center></pre></bdo></b><th id='a3cwl'></th></span></q></dt></tr></i><div id='a3cwl'><tfoot id='a3cwl'></tfoot><dl id='a3cwl'><fieldset id='a3cwl'></fieldset></dl></div>
                  本文介绍了使用 Lucene 提取英语单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在一个 Java 应用程序中处理一些英文文本,我需要对它们进行词干处理.例如,从文本amenities/amenity"我需要得到amenit".

                  I'm processing some English texts in a Java application, and I need to stem them. For example, from the text "amenities/amenity" I need to get "amenit".

                  函数如下:

                  String stemTerm(String term){
                     ...
                  }
                  

                  我找到了 Lucene Analyzer,但它看起来太复杂了,无法满足我的需要.http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/analysis/PorterStemFilter.html

                  I've found the Lucene Analyzer, but it looks way too complicated for what I need. http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/analysis/PorterStemFilter.html

                  有没有办法在不构建分析器的情况下使用它来词干?我不了解所有 Analyzer 业务...

                  Is there a way to use it to stem words without building an Analyzer? I don't understand all the Analyzer business...

                  编辑:我实际上需要词干提取+词形还原.Lucene 可以做到这一点吗?

                  EDIT: I actually need a stemming + lemmatization. Can Lucene do this?

                  推荐答案

                  import org.apache.lucene.analysis.PorterStemmer;
                  ...
                  String stemTerm (String term) {
                      PorterStemmer stemmer = new PorterStemmer();
                      return stemmer.stem(term);
                  }
                  

                  参见这里 了解更多详情.如果您只想使用词干提取,那么您应该使用 this 而不是 Lucene.

                  See here for more details. If stemming is all you want to do, then you should use this instead of Lucene.

                  您应该在将 term 传递给 stem() 之前将其小写.

                  You should lowercase term before passing it to stem().

                  这篇关于使用 Lucene 提取英语单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)

                    <bdo id='5c32N'></bdo><ul id='5c32N'></ul>

                    1. <legend id='5c32N'><style id='5c32N'><dir id='5c32N'><q id='5c32N'></q></dir></style></legend>

                            <tbody id='5c32N'></tbody>
                          <i id='5c32N'><tr id='5c32N'><dt id='5c32N'><q id='5c32N'><span id='5c32N'><b id='5c32N'><form id='5c32N'><ins id='5c32N'></ins><ul id='5c32N'></ul><sub id='5c32N'></sub></form><legend id='5c32N'></legend><bdo id='5c32N'><pre id='5c32N'><center id='5c32N'></center></pre></bdo></b><th id='5c32N'></th></span></q></dt></tr></i><div id='5c32N'><tfoot id='5c32N'></tfoot><dl id='5c32N'><fieldset id='5c32N'></fieldset></dl></div>
                        1. <small id='5c32N'></small><noframes id='5c32N'>

                        2. <tfoot id='5c32N'></tfoot>