|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.UniqueID
messif.objects.AbstractObject
messif.objects.LocalAbstractObject
messif.objects.impl.ObjectString
messif.objects.impl.ObjectStringEditDist
public class ObjectStringEditDist
Object with string content and edit distance metric function. See relevant literature (e.g. a book "Similarity Search: The Metric Space Approach") for a definition of the edit distance function.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject |
---|
LocalAbstractObject.DataEqualObject |
Field Summary |
---|
Fields inherited from class messif.objects.impl.ObjectString |
---|
text |
Fields inherited from class messif.objects.LocalAbstractObject |
---|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE |
Constructor Summary | |
---|---|
ObjectStringEditDist()
Creates a new instance of ObjectStringEditDist with randomly generated string content. |
|
ObjectStringEditDist(java.io.BufferedReader stream)
Creates a new instance of ObjectString from text stream. |
|
ObjectStringEditDist(int minLength,
int maxLength)
Creates a new instance of ObjectStringEditDist with randomly generated string content. |
|
ObjectStringEditDist(java.lang.String text)
Creates a new instance of ObjectStringEditDist. |
Method Summary | |
---|---|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
The actual implementation of the metric function (see LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
protected float |
getDistanceLowerBoundImpl(LocalAbstractObject obj,
int accuracy)
Implementation that actually computes the lower bound on the metric distance. |
protected float |
getDistanceUpperBoundImpl(LocalAbstractObject obj,
int accuracy)
Implementation that actually computes the upper bound on the metric distance. |
protected int |
getChangeWeight(char chr1,
char chr2)
Returns the weight of changing char1 into char2 during
the edit distance computation. |
protected int |
getInsertDeleteWeight()
Returns the weight of deleting or inserting a character during the edit distance computation. |
Methods inherited from class messif.objects.impl.ObjectString |
---|
binarySerialize, cloneRandomlyModify, dataEquals, dataHashCode, generateRandom, getBinarySize, getSize, getStringData, getStringLength, toString, writeData |
Methods inherited from class messif.objects.LocalAbstractObject |
---|
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceUpperBound, getMaxDistance, getNormDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, readObjectComments, unchainFilter, write, write |
Methods inherited from class messif.objects.AbstractObject |
---|
clone, getLocatorURI, getNoDataObject, getObjectID, getObjectKey, setObjectKey |
Methods inherited from class messif.objects.UniqueID |
---|
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ObjectStringEditDist(java.lang.String text)
text
- the string content of the new objectpublic ObjectStringEditDist()
public ObjectStringEditDist(int minLength, int maxLength)
minLength
characters
and at most maxLength
characters.
minLength
- minimal length of the randomly generated string contentmaxLength
- maximal length of the randomly generated string contentpublic ObjectStringEditDist(java.io.BufferedReader stream) throws java.io.EOFException, java.io.IOException
stream
- the stream from which to read lines of text
java.io.EOFException
- if the end-of-file of the given stream is reached
java.io.IOException
- if there was an I/O error during reading from the streamMethod Detail |
---|
protected int getChangeWeight(char chr1, char chr2)
char1
into char2
during
the edit distance computation. The returned value must be greater than or
equal to zero and must be symetric, that is getChangeWeight(x,y) == getChangeWeight(y,x)
.
chr1
- the source characterchr2
- the target character
char1
into char2
protected int getInsertDeleteWeight()
protected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
LocalAbstractObject
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
for full explanation).
The implementation should not increment distanceComputations statistics.
getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distance
protected float getDistanceLowerBoundImpl(LocalAbstractObject obj, int accuracy)
LocalAbstractObject
getDistanceLowerBoundImpl
in class LocalAbstractObject
obj
- the object to compute lower-bound distance toaccuracy
- the level of precision to use for lower-bound
obj
protected float getDistanceUpperBoundImpl(LocalAbstractObject obj, int accuracy)
LocalAbstractObject
getDistanceUpperBoundImpl
in class LocalAbstractObject
obj
- the object to compute upper-bound distance toaccuracy
- the level of precision to use for upper-bound
obj
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |