Class WindowSupportingLuceneCorpusAdapter

    • Field Detail

      • histogram

        protected int[][] histogram
      • docLengthFieldName

        protected String docLengthFieldName
      • LOGGER

        private static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • WindowSupportingLuceneCorpusAdapter

        protected WindowSupportingLuceneCorpusAdapter​(org.apache.lucene.index.DirectoryReader dirReader,
                                                      org.apache.lucene.index.AtomicReader[] reader,
                                                      org.apache.lucene.index.AtomicReaderContext[] contexts,
                                                      String textFieldName,
                                                      String docLengthFieldName,
                                                      int[][] histogram)
    • Method Detail

      • requestWordPositionsInDocuments

        public com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> requestWordPositionsInDocuments​(String[] words,
                                                                                                                                com.carrotsearch.hppc.IntIntOpenHashMap docLengths)
        Description copied from interface: WindowSupportingAdapter
        Returns the positions of the given words inside the corpus.
        Specified by:
        requestWordPositionsInDocuments in interface WindowSupportingAdapter
        Parameters:
        words - the words for which the positions inside the documents should be determined
        docLengths - empty int int map in which the document lengths and counts are inserted
        Returns:
        the positions of the given words inside the corpus
      • requestDocumentsWithWord

        protected void requestDocumentsWithWord​(String word,
                                                com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> positionsInDocs,
                                                com.carrotsearch.hppc.IntIntOpenHashMap docLengths,
                                                int wordId,
                                                int numberOfWords)
      • gatherWordPositions

        protected void gatherWordPositions​(org.apache.lucene.index.DocsAndPositionsEnum docPosEnum,
                                           com.carrotsearch.hppc.IntArrayList positions)
                                    throws IOException
        Throws:
        IOException
      • addDocLength

        protected void addDocLength​(com.carrotsearch.hppc.IntIntOpenHashMap docLengths,
                                    int globalDocId,
                                    int localDocId,
                                    org.apache.lucene.index.AtomicReader reader)
                             throws IOException
        Throws:
        IOException