public class FixedWeightEditDistance extends WeightedEditDistance implements Compilable, Serializable
FixedWeightEditDistance sets constant weights for
the edit operations for weighted edit distance.
Subclasses of this class may override any of the weight implementations.
Serialization and compilation both do the same thing, namely store the fixed weight edit distance for reading in later.
| Constructor and Description |
|---|
FixedWeightEditDistance()
Constructs an edit distance where the match weight is zero and
all other weights are positive infinity.
|
FixedWeightEditDistance(double matchWeight,
double deleteWeight,
double insertWeight,
double substituteWeight,
double transposeWeight)
Construct a weighted edit distance with the specified constant
weights for edits.
|
| Modifier and Type | Method and Description |
|---|---|
void |
compileTo(ObjectOutput objOut)
Writes a compiled version of this edit distance to the
specified object output.
|
double |
deleteWeight(char cDeleted)
Returns the constant weight of deleting the specified character.
|
double |
insertWeight(char cInserted)
Returns the constant weight of inserting the specified character.
|
double |
matchWeight(char cMatched)
Returns the constant weight of matching the specified character.
|
double |
substituteWeight(char cDeleted,
char cInserted)
Returns the constant weight of substituting the inserted character for
the deleted character.
|
String |
toString()
Returns a string-based representation of this fixed-weight
edit distance's parameters.
|
double |
transposeWeight(char cFirst,
char cSecond)
Returns the constant weight of transposing the specified characters.
|
distance, proximitypublic FixedWeightEditDistance(double matchWeight,
double deleteWeight,
double insertWeight,
double substituteWeight,
double transposeWeight)
See the WeightedEditDistance class documewntation
for more information on similarity versus dissimialrity
measures.
matchWeight - Weight for matching.deleteWeight - Weight for deleting.insertWeight - Weight for inserting.substituteWeight - Weight for substituting.transposeWeight - Weight for transposing.public FixedWeightEditDistance()
public String toString()
public void compileTo(ObjectOutput objOut) throws IOException
UnsupportedOperationException.compileTo in interface CompilableobjOut - The object output to which this fixed weight
edit distance is written.IOException - If there is an I/O error while writing.public double matchWeight(char cMatched)
matchWeight in class WeightedEditDistancecMatched - Character matched.public double deleteWeight(char cDeleted)
deleteWeight in class WeightedEditDistancecDeleted - Character deleted.public double insertWeight(char cInserted)
insertWeight in class WeightedEditDistancecInserted - Character inserted.public double substituteWeight(char cDeleted,
char cInserted)
substituteWeight in class WeightedEditDistancecDeleted - Deleted character.cInserted - Inserted character.public double transposeWeight(char cFirst,
char cSecond)
transposeWeight in class WeightedEditDistancecFirst - First character in input.cSecond - Second character in input.Copyright © 2019 Alias-i, Inc.. All rights reserved.