Package org.apache.sysds.utils.stats
Class NGramBuilder<T,U>
java.lang.Object
org.apache.sysds.utils.stats.NGramBuilder<T,U>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintgetSize()getTopK(int k) getTopK(int k, Comparator<NGramBuilder.NGramEntry<T, U>> comparator, boolean reversed) voidmerge(NGramBuilder<T, U> builder) static <T,U> String toCSV(String[] columnNames, List<NGramBuilder.NGramEntry<T, U>> entries, Function<NGramBuilder.NGramEntry<T, U>, String> statsMapper) static <T,U> void toCSVStream(String[] columnNames, List<NGramBuilder.NGramEntry<T, U>> entries, Function<NGramBuilder.NGramEntry<T, U>, String> statsMapper, Consumer<String> lineConsumer)
-
Constructor Details
-
NGramBuilder
-
-
Method Details
-
toCSV
public static <T,U> String toCSV(String[] columnNames, List<NGramBuilder.NGramEntry<T, U>> entries, Function<NGramBuilder.NGramEntry<T, U>, String> statsMapper) -
toCSVStream
public static <T,U> void toCSVStream(String[] columnNames, List<NGramBuilder.NGramEntry<T, U>> entries, Function<NGramBuilder.NGramEntry<T, U>, String> statsMapper, Consumer<String> lineConsumer) -
getSize
public int getSize() -
merge
-
append
-
getTopK
-
getTopK
public List<NGramBuilder.NGramEntry<T,U>> getTopK(int k, Comparator<NGramBuilder.NGramEntry<T, U>> comparator, boolean reversed) -
clearCurrentRecording
public void clearCurrentRecording()
-