久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='TvZDK'></small><noframes id='TvZDK'>

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

  • <i id='TvZDK'><tr id='TvZDK'><dt id='TvZDK'><q id='TvZDK'><span id='TvZDK'><b id='TvZDK'><form id='TvZDK'><ins id='TvZDK'></ins><ul id='TvZDK'></ul><sub id='TvZDK'></sub></form><legend id='TvZDK'></legend><bdo id='TvZDK'><pre id='TvZDK'><center id='TvZDK'></center></pre></bdo></b><th id='TvZDK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TvZDK'><tfoot id='TvZDK'></tfoot><dl id='TvZDK'><fieldset id='TvZDK'></fieldset></dl></div>
  • <tfoot id='TvZDK'></tfoot>

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

        如何從 Lucene 的特定字段中獲取唯一術(shù)語列表?

        How can I get the list of unique terms from a specific field in Lucene?(如何從 Lucene 的特定字段中獲取唯一術(shù)語列表?)

                <tbody id='WUOiY'></tbody>
            • <tfoot id='WUOiY'></tfoot>
              <legend id='WUOiY'><style id='WUOiY'><dir id='WUOiY'><q id='WUOiY'></q></dir></style></legend>
            • <small id='WUOiY'></small><noframes id='WUOiY'>

            • <i id='WUOiY'><tr id='WUOiY'><dt id='WUOiY'><q id='WUOiY'><span id='WUOiY'><b id='WUOiY'><form id='WUOiY'><ins id='WUOiY'></ins><ul id='WUOiY'></ul><sub id='WUOiY'></sub></form><legend id='WUOiY'></legend><bdo id='WUOiY'><pre id='WUOiY'><center id='WUOiY'></center></pre></bdo></b><th id='WUOiY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WUOiY'><tfoot id='WUOiY'></tfoot><dl id='WUOiY'><fieldset id='WUOiY'></fieldset></dl></div>
                • <bdo id='WUOiY'></bdo><ul id='WUOiY'></ul>

                • 本文介紹了如何從 Lucene 的特定字段中獲取唯一術(shù)語列表?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個來自包含多個字段的大型語料庫的索引.這些字段中只有一個包含文本.我需要根據(jù)該字段從整個索引中提取唯一詞.有誰知道我如何在 java 中使用 Lucene 做到這一點?

                  I have an index from a large corpus with several fields. Only one these fields contain text. I need to extract the unique words from the whole index based on this field. Does anyone know how I can do that with Lucene in java?

                  推薦答案

                  你正在尋找 術(shù)語向量(字段中所有單詞的集合以及每個單詞的使用次數(shù),不包括停用詞).您將使用 IndexReader 的 getTermFreqVector(docid, field) 用于索引中的每個文檔,并用它們填充 HashSet.

                  You're looking for term vectors (a set of all the words that were in the field and the number of times each word was used, excluding stop words). You'll use IndexReader's getTermFreqVector(docid, field) for each document in the index, and populate a HashSet with them.

                  替代方法是使用 terms() 并只選擇您感興趣的領(lǐng)域的術(shù)語:

                  The alternative would be to use terms() and pick only terms for the field you're interested in:

                  IndexReader reader = IndexReader.open(index);
                  TermEnum terms = reader.terms();
                  Set<String> uniqueTerms = new HashSet<String>();
                  while (terms.next()) {
                          final Term term = terms.term();
                          if (term.field().equals("field_name")) {
                                  uniqueTerms.add(term.text());
                          }
                  }
                  

                  這不是最佳解決方案,您正在閱讀然后丟棄所有其他字段.Lucene 4 中有一個類 Fields,它返回 terms(field) 僅適用于單個字段.

                  This is not the optimal solution, you're reading and then discarding all other fields. There's a class Fields in Lucene 4, that returns terms(field) only for a single field.

                  這篇關(guān)于如何從 Lucene 的特定字段中獲取唯一術(shù)語列表?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個隨機打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲為 int?)

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

                      <tfoot id='BsUam'></tfoot>
                        <bdo id='BsUam'></bdo><ul id='BsUam'></ul>

                          <tbody id='BsUam'></tbody>
                          • <i id='BsUam'><tr id='BsUam'><dt id='BsUam'><q id='BsUam'><span id='BsUam'><b id='BsUam'><form id='BsUam'><ins id='BsUam'></ins><ul id='BsUam'></ul><sub id='BsUam'></sub></form><legend id='BsUam'></legend><bdo id='BsUam'><pre id='BsUam'><center id='BsUam'></center></pre></bdo></b><th id='BsUam'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BsUam'><tfoot id='BsUam'></tfoot><dl id='BsUam'><fieldset id='BsUam'></fieldset></dl></div>
                            <legend id='BsUam'><style id='BsUam'><dir id='BsUam'><q id='BsUam'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 一本一道久久a久久精品综合蜜臀 | 在线观看亚洲专区 | 国产网站在线免费观看 | 久久久久久亚洲欧洲 | 日韩在线小视频 | 国产98色在线 | 日韩 | 91xx在线观看 | 成人国产精品色哟哟 | 天天弄 | 久久久新视频 | 欧美婷婷 | 久久国产精品一区二区三区 | 男人午夜视频 | 6996成人影院网在线播放 | 国产成人91视频 | 午夜专区 | 99久久99| 综合色导航| 国外成人在线视频 | 中文字幕a√ | 亚洲精品一区av在线播放 | caoporn地址 | 午夜性色a√在线视频观看9 | 日韩欧美成人一区二区三区 | 亚洲一区二区三区在线视频 | 国产精品不卡 | 欧美一级在线观看 | 欧美aⅴ| 欧美日韩精品中文字幕 | www.日韩在线 | 国产精品成人一区二区三区夜夜夜 | 欧美综合久久久 | 欧美一区二区大片 | 精品久久久久久国产 | 亚洲激情综合 | 91最新入口| 一区二区av | 亚洲欧美精品一区 | 成人精品鲁一区一区二区 | 久久久毛片 | 成人伊人 |