Package opennlp.tools.util.jvm
Class CHMStringDeduplicator
java.lang.Object
opennlp.tools.util.jvm.CHMStringDeduplicator
- All Implemented Interfaces:
opennlp.tools.util.jvm.StringInterner
@Internal
@ThreadSafe
public class CHMStringDeduplicator
extends Object
implements opennlp.tools.util.jvm.StringInterner
A
StringInterner implementation by Aleksey Shipilëv with relaxed canonical requirements.
It is a probabilistic deduplication implementation with a default probability of 0.5.
Users may implement a custom class with a different probability value.
Origin: https://shipilev.net/talks/joker-Oct2014-string-catechism.pdf
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aCHMStringDeduplicatorwith a probability of0.5.CHMStringDeduplicator(double prob) -
Method Summary
-
Constructor Details
-
CHMStringDeduplicator
public CHMStringDeduplicator()Creates aCHMStringDeduplicatorwith a probability of0.5. -
CHMStringDeduplicator
public CHMStringDeduplicator(double prob) - Parameters:
prob- represents the probability, that a given String will be interned
-
-
Method Details
-
intern
- Specified by:
internin interfaceopennlp.tools.util.jvm.StringInterner
-