File tree 7 files changed +11
-11
lines changed
opennlp-tools/src/main/java/opennlp/tools/util
7 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public class StringList implements Iterable<String> {
35
35
* Initializes a {@link StringList} instance.
36
36
* <p>
37
37
* Note: <br>
38
- * Token String will be interened via {@link StringInterners}.
38
+ * Token String will be interned via {@link StringInterners}.
39
39
*
40
40
* @param singleToken One single token
41
41
*/
@@ -47,7 +47,7 @@ public StringList(String singleToken) {
47
47
* Initializes a {@link StringList} instance.
48
48
* <p>
49
49
* Note: <br>
50
- * Token Strings will be interened via {@link StringInterners}.
50
+ * Token Strings will be interned via {@link StringInterners}.
51
51
*
52
52
* @param tokens The string parts of the new {@link StringList}.
53
53
* Must not be an empty tokens array or {@code null}.
Original file line number Diff line number Diff line change 32
32
* Origin:
33
33
* <a href="https://shipilev.net/talks/joker-Oct2014-string-catechism.pdf">
34
34
* https://shipilev.net/talks/joker-Oct2014-string-catechism.pdf</a>
35
- * <p>
36
35
*/
37
36
@ Internal
38
37
@ ThreadSafe
39
38
class CHMStringDeduplicator implements StringInterner {
40
39
private final int prob ;
41
40
private final Map <String , String > map ;
42
41
42
+ /**
43
+ * Creates a {@link CHMStringDeduplicator} with a probability of {@code 0.5}.
44
+ */
43
45
public CHMStringDeduplicator () {
44
46
this (0.5 );
45
47
}
Original file line number Diff line number Diff line change 29
29
* Origin:
30
30
* <a href="https://shipilev.net/jvm/anatomy-quarks/10-string-intern/">
31
31
* https://shipilev.net/jvm/anatomy-quarks/10-string-intern/</a>
32
- * <p>
33
32
*/
34
33
@ Internal
35
34
@ ThreadSafe
Original file line number Diff line number Diff line change 28
28
* Origin:
29
29
* <a href="https://shipilev.net/jvm/anatomy-quarks/10-string-intern/">
30
30
* https://shipilev.net/jvm/anatomy-quarks/10-string-intern/</a>
31
- * <p>
32
31
*/
33
32
@ Internal
34
33
class HMStringInterner implements StringInterner {
Original file line number Diff line number Diff line change 26
26
* <p>
27
27
* Using this {@link StringInterner} brings back the default behaviour of OpenNLP before version
28
28
* {@code 2.3.2}. You can use it by setting the system property {@code opennlp.interner.class} to
29
- * the full qualified classname of a {@link StringInterner} implementation.
29
+ * the fully qualified classname of a {@link StringInterner} implementation.
30
30
* </p>
31
31
*/
32
32
@ Internal
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ public interface StringInterner {
24
24
25
25
/**
26
26
* Interns and returns a reference to the representative instance
27
- * for any of a collection of string instances that are equal to each other.
27
+ * for any collection of string instances that are equal to each other.
28
28
*
29
- * @param s string instance to be interned
29
+ * @param sample string instance to be interned
30
30
* @return reference to the interned string instance
31
31
*/
32
- String intern (String s );
32
+ String intern (String sample );
33
33
}
Original file line number Diff line number Diff line change 25
25
/**
26
26
* Provides string interning utility methods. Interning mechanism can be configured via the
27
27
* system property {@code opennlp.interner.class} by specifying an implementation via its
28
- * full qualified classname. It needs to implement {@link StringInterner}.
28
+ * fully qualified classname. It needs to implement {@link StringInterner}.
29
29
* <p>
30
30
* If not specified by the user, the default interner is {@link CHMStringInterner}.
31
31
*/
@@ -53,7 +53,7 @@ public class StringInterners {
53
53
54
54
/**
55
55
* Interns and returns a reference to the representative instance
56
- * for any of a collection of string instances that are equal to each other.
56
+ * for any collection of string instances that are equal to each other.
57
57
*
58
58
* @param sample string instance to be interned
59
59
* @return reference to the interned string instance
You can’t perform that action at this time.
0 commit comments