<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 提取英语单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                    <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>