Package ai.platon.pulsar.common
Class FrequencyManager
-
- All Implemented Interfaces:
-
kotlin.collections.Map,kotlin.collections.MutableMap
public final class FrequencyManager<T extends Comparable<T>> implements Map<String, Frequency<T>>
A set of term counters
-
-
Constructor Summary
Constructors Constructor Description FrequencyManager()
-
Method Summary
Modifier and Type Method Description IntegergetSize()Set<String>getKeys()Collection<Frequency<T>>getValues()Set<Entry.Map<String, Frequency<T>>>getEntries()final Frequency<T>computeIfAbsent(String name)final Frequency<T>computeIfAbsent(String name, T elements)final Integercount(String name, T term)BooleanisEmpty()BooleancontainsKey(String key)BooleancontainsValue(Frequency<T> value)Frequency<T>get(String key)Frequency<T>put(String key, Frequency<T> value)Frequency<T>remove(String key)UnitputAll(Map<out String, Frequency<T>> m)Unitclear()final IntegerremoveMoreThen(Double appearance)Remove items appears more than {@param threshold} times final IntegerremoveLessThen(Double appearance)Remove items appears more then {@param threshold} times final UnitsaveTo(Path directory)final Unitsave()final Unitload()StringtoString()-
Methods inherited from class kotlin.collections.MutableMap
compute, computeIfAbsent, computeIfPresent, merge, putIfAbsent, remove, replace, replace, replaceAll -
Methods inherited from class kotlin.collections.Map
forEach, getOrDefault -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getValues
Collection<Frequency<T>> getValues()
-
computeIfAbsent
final Frequency<T> computeIfAbsent(String name)
-
computeIfAbsent
final Frequency<T> computeIfAbsent(String name, T elements)
-
containsKey
Boolean containsKey(String key)
-
containsValue
Boolean containsValue(Frequency<T> value)
-
removeMoreThen
final Integer removeMoreThen(Double appearance)
Remove items appears more than {@param threshold} times
- Parameters:
appearance- The appearance
-
removeLessThen
final Integer removeLessThen(Double appearance)
Remove items appears more then {@param threshold} times
- Parameters:
appearance- The appearance
-
-
-
-