Package org.aksw.palmetto.evaluate
Class CoherenceEvaluation.StaticCorpusAdapter
- java.lang.Object
-
- org.aksw.palmetto.evaluate.CoherenceEvaluation.StaticCorpusAdapter
-
- All Implemented Interfaces:
CorpusAdapter,WindowSupportingAdapter
- Enclosing class:
- CoherenceEvaluation
public static class CoherenceEvaluation.StaticCorpusAdapter extends Object implements WindowSupportingAdapter
A simple corpus adapter that already contains the results for a single word set. Note that it will throw anIllegalArgumentExceptionif it is called with a different word set.- Author:
- Michael Röder (michael.roeder@uni-paderborn.de)
-
-
Field Summary
Fields Modifier and Type Field Description protected com.carrotsearch.hppc.IntIntOpenHashMapdocLengthsprotected int[][]histogramprotected com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]>wordPositionsprotected String[]wordSet
-
Constructor Summary
Constructors Constructor Description StaticCorpusAdapter(int[][] histogram, String[] wordSet, com.carrotsearch.hppc.IntIntOpenHashMap docLengths, com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> wordPositions)StaticCorpusAdapter(String[] wordSet, WindowSupportingAdapter luceneAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()int[][]getDocumentSizeHistogram()Returns the histogram of the document sizes of the corpus.com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]>requestWordPositionsInDocuments(String[] words, com.carrotsearch.hppc.IntIntOpenHashMap docLengths)Returns the positions of the given words inside the corpus.
-
-
-
Field Detail
-
histogram
protected int[][] histogram
-
wordSet
protected String[] wordSet
-
docLengths
protected com.carrotsearch.hppc.IntIntOpenHashMap docLengths
-
wordPositions
protected com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> wordPositions
-
-
Constructor Detail
-
StaticCorpusAdapter
public StaticCorpusAdapter(int[][] histogram, String[] wordSet, com.carrotsearch.hppc.IntIntOpenHashMap docLengths, com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> wordPositions)
-
StaticCorpusAdapter
public StaticCorpusAdapter(String[] wordSet, WindowSupportingAdapter luceneAdapter)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceCorpusAdapter
-
getDocumentSizeHistogram
public int[][] getDocumentSizeHistogram()
Description copied from interface:WindowSupportingAdapterReturns the histogram of the document sizes of the corpus.- Specified by:
getDocumentSizeHistogramin interfaceWindowSupportingAdapter- Returns:
- the histogram of the document sizes
-
requestWordPositionsInDocuments
public com.carrotsearch.hppc.IntObjectOpenHashMap<com.carrotsearch.hppc.IntArrayList[]> requestWordPositionsInDocuments(String[] words, com.carrotsearch.hppc.IntIntOpenHashMap docLengths)
Description copied from interface:WindowSupportingAdapterReturns the positions of the given words inside the corpus.- Specified by:
requestWordPositionsInDocumentsin interfaceWindowSupportingAdapter- Parameters:
words- the words for which the positions inside the documents should be determineddocLengths- empty int int map in which the document lengths and counts are inserted- Returns:
- the positions of the given words inside the corpus
-
-