|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.spell.WeightedEditDistance
com.aliasi.spell.FixedWeightEditDistance
public class FixedWeightEditDistance
A 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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class com.aliasi.spell.WeightedEditDistance |
|---|
distance, proximity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public 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()
| Method Detail |
|---|
public String toString()
toString in class Object
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||