Skip to content

Commit 462a686

Browse files
committed
fix for java 8 and more recent
1 parent aa9ecf2 commit 462a686

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ A library implementing different string similarity and distance measures. A doze
2929

3030

3131
## Download
32+
3233
Using maven:
34+
3335
```
3436
<dependency>
3537
<groupId>info.debatty</groupId>
@@ -40,6 +42,8 @@ Using maven:
4042

4143
Or check the [releases](https://github.com/tdebatty/java-string-similarity/releases).
4244

45+
This library requires Java 8 or more recent.
46+
4347
## Overview
4448

4549
The main characteristics of each implemented algorithm are presented below. The "cost" column gives an estimation of the computational cost to compute the similarity between two strings of length m and n respectively.

Diff for: pom.xml

+5-2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
<groupId>org.apache.maven.plugins</groupId>
8383
<artifactId>maven-javadoc-plugin</artifactId>
8484
<version>2.10.4</version>
85+
<configuration>
86+
<source>8</source>
87+
</configuration>
8588
<executions>
8689
<execution>
8790
<id>attach-javadocs</id>
@@ -112,8 +115,8 @@
112115
<artifactId>maven-compiler-plugin</artifactId>
113116
<version>3.6.1</version>
114117
<configuration>
115-
<source>6</source>
116-
<target>1.6</target>
118+
<source>8</source>
119+
<target>8</target>
117120
</configuration>
118121
</plugin>
119122

Diff for: src/main/java/info/debatty/java/stringsimilarity/Cosine.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public Cosine() {
7070
* @return The cosine similarity in the range [0, 1]
7171
* @throws NullPointerException if s1 or s2 is null.
7272
*/
73+
@Override
7374
public final double similarity(final String s1, final String s2) {
7475
if (s1 == null) {
7576
throw new NullPointerException("s1 must not be null");
@@ -142,12 +143,14 @@ private static double dotProduct(
142143
* @return 1.0 - the cosine similarity in the range [0, 1]
143144
* @throws NullPointerException if s1 or s2 is null.
144145
*/
146+
@Override
145147
public final double distance(final String s1, final String s2) {
146148
return 1.0 - similarity(s1, s2);
147149
}
148150

149151
/**
150-
* {@inheritDoc}
152+
* Compute similarity between precomputed profiles.
153+
*
151154
* @param profile1
152155
* @param profile2
153156
* @return

Diff for: src/main/java/info/debatty/java/stringsimilarity/RatcliffObershelp.java

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import info.debatty.java.stringsimilarity.interfaces.NormalizedStringDistance;
2828
import java.util.List;
2929
import java.util.ArrayList;
30-
import java.util.Iterator;
3130

3231
import net.jcip.annotations.Immutable;
3332

0 commit comments

Comments
 (0)