Package opennlp.tools.util.jvm
Class JvmStringInterner
java.lang.Object
opennlp.tools.util.jvm.JvmStringInterner
- All Implemented Interfaces:
StringInterner
A
StringInterner implementation based on String.intern(). Strings interned via
this implementation are put into PermGen space. If needed, the PermGen memory can be increased by
the JVM argument -XX:MaxPermSize.
Using this StringInterner brings back the default behaviour of OpenNLP before version
2.3.2. You can use it by setting the system property opennlp.interner.class to
the fully qualified classname of a StringInterner implementation.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JvmStringInterner
public JvmStringInterner()
-
-
Method Details
-
intern
Interns and returns a reference to the representative instance for any collection of string instances that are equal to each other.- Specified by:
internin interfaceStringInterner- Parameters:
sample- string instance to be interned- Returns:
- reference to the interned string instance
-