1
1
/*
2
2
* JavaPermutationTools: A Java library for computation on permutations and sequences
3
- * Copyright 2005-2022 Vincent A. Cicirello, <https://www.cicirello.org/>.
3
+ * Copyright 2005-2023 Vincent A. Cicirello, <https://www.cicirello.org/>.
4
4
*
5
5
* This file is part of JavaPermutationTools (https://jpt.cicirello.org/).
6
6
*
29
29
*
30
30
* <p>Edit distance is the minimum cost to transform one string (or sequence) into the other, which
31
31
* is the sum of the costs of the edit operations necessary to do so. This edit distance considers 3
32
- * edit operations: Inserts which insert a new element into the sequence, Deletes which remove an
32
+ * edit operations: Inserts which inserts a new element into the sequence, Deletes which removes an
33
33
* element from the sequence, and Changes which replace an element with a different element.
34
34
*
35
- * <p>The edit distance is parameterized by costs for the edit operations. We provide two
36
- * constructors which enable you to specify 3 costs, 1 for each type of edit operation. One of the
37
- * constructors expects integer costs, and the other double valued costs. If you specify costs as
38
- * integers, then all of the distance and distancef methods from the {@link
39
- * org.cicirello.sequences.distance.SequenceDistanceMeasurer SequenceDistanceMeasurer} and {@link
40
- * org.cicirello.sequences.distance.SequenceDistanceMeasurerDouble SequenceDistanceMeasurerDouble}
41
- * interfaces are available. If costs are specified as doubles, then only the distancef methods will
42
- * function, while the distance methods will throw exceptions.
35
+ * <p>The edit distance is parameterized by costs for the edit operations. The class provides a
36
+ * constructor which enables you to specify 3 costs as ints, 1 for each type of edit operation. If
37
+ * your application requires non-integer costs, then use the {@link EditDistanceDouble} class which
38
+ * defines the costs as doubles, but is otherwise an implementation of the same algorithm.
43
39
*
44
40
* <p>This class supports computing EditDistance for Java String objects or arrays of any of the
45
41
* primitive types, or arrays of objects. It makes no assumptions about the contents of the Strings
@@ -80,7 +76,9 @@ public class EditDistance extends EditDistanceDouble implements SequenceDistance
80
76
* @param deleteCost Cost of an deletion operation. Must be non-negative.
81
77
* @param changeCost Cost of an change operation. Must be non-negative.
82
78
* @throws IllegalArgumentException if any of the costs are negative.
79
+ * @deprecated For double-valued costs, use the {@link EditDistanceDouble} class instead.
83
80
*/
81
+ @ Deprecated
84
82
public EditDistance (double insertCost , double deleteCost , double changeCost ) {
85
83
super (insertCost , deleteCost , changeCost );
86
84
if (isIntAsDouble (insertCost ) && isIntAsDouble (deleteCost ) && isIntAsDouble (changeCost )) {
@@ -95,8 +93,7 @@ public EditDistance(double insertCost, double deleteCost, double changeCost) {
95
93
}
96
94
97
95
/**
98
- * Constructs an edit distance measure with the specified edit operation costs. With integer
99
- * costs, all of the distance and distancef methods are available.
96
+ * Constructs an edit distance measure with the specified edit operation costs.
100
97
*
101
98
* @param insertCost Cost of an insertion operation. Must be non-negative.
102
99
* @param deleteCost Cost of an deletion operation. Must be non-negative.
0 commit comments