We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d20cc9d commit 0ba9ffaCopy full SHA for 0ba9ffa
src/main/java/info/debatty/java/stringsimilarity/QGram.java
@@ -75,6 +75,20 @@ public final double distance(final String s1, final String s2) {
75
Map<String, Integer> profile1 = getProfile(s1);
76
Map<String, Integer> profile2 = getProfile(s2);
77
78
+ return distance(profile1, profile2);
79
+ }
80
+
81
+ /**
82
+ * Compute QGram distance using precomputed profiles.
83
+ *
84
+ * @param profile1
85
+ * @param profile2
86
+ * @return
87
+ */
88
+ public final double distance(
89
+ final Map<String, Integer> profile1,
90
+ final Map<String, Integer> profile2) {
91
92
Set<String> union = new HashSet<String>();
93
union.addAll(profile1.keySet());
94
union.addAll(profile2.keySet());
0 commit comments