public class CharStatComparator extends Object implements SkipComparator<StringValue>
Constructor and Description |
---|
CharStatComparator() |
CharStatComparator(Normalizer normalizer) |
Modifier and Type | Method and Description |
---|---|
double |
compare(StringValue a,
StringValue b)
This has to return a distance between a and b with the following
restrictions:
The return value has to lie between 0 and 1.
1 means maximum dissimilarity between a and b.
0 means maximum similarity between a and b (especially it should be
true that a = b implies a zero distance).
distance(a,b) should be equal or at least close to
distance(b,a)
Please note that this has to be well-defined, even if an input is null.
|
double |
delete(StringValue a)
This should be called during an alignment to retrieve the costs for a
deletion of value a from the first sequence.
|
static double |
distance(String a,
String b)
This calculates the distance between the two strings a and b calculating
for each alphanumeric character (a-z, 0-9) the number of times it occured
in both strings at taking the difference of both.
|
boolean |
equals(Object obj) |
String |
getGapString()
The string that is used as reference to determine the INSERTION/DELETION
cost of another string.
|
String |
getSkipString()
The string that is used as reference to determine the
SKIPINSERTION/SKIPDELETION cost of another string.
|
ValueType |
getType() |
int |
hashCode() |
double |
insert(StringValue b)
This should be called during an alignment to retrieve the costs for an
insertion of value b into the first sequence.
|
void |
setGapString(String gapString)
The string that is used as reference to determine the INSERTION/DELETION
cost of another string.
|
void |
setSkipString(String skipString)
The string that is used as reference to determine the
SKIPINSERTION/SKIPDELETION cost of another string.
|
double |
skipDelete(StringValue a)
This should be called during an alignment to retrieve the costs for a
skip deletion of value a from the first sequence.
|
double |
skipInsert(StringValue b)
This should be called during an alignment to retrieve the costs for a
skip insertion of value b into the first sequence.
|
public CharStatComparator()
public CharStatComparator(Normalizer normalizer)
public String getGapString()
public void setGapString(String gapString)
gapString
- The string that is used as reference to determine the
INSERTION/DELETION cost of another string.public String getSkipString()
public void setSkipString(String skipString)
skipString
- The string that is used as reference to determine the
SKIPINSERTION/SKIPDELETION cost of another string.public double skipDelete(StringValue a)
skipDelete
in interface SkipComparator<StringValue>
a
- a value.public double skipInsert(StringValue b)
skipInsert
in interface SkipComparator<StringValue>
b
- a value.public double delete(StringValue a)
delete
in interface GapComparator<StringValue>
a
- a value.public double insert(StringValue b)
insert
in interface GapComparator<StringValue>
b
- a value.public double compare(StringValue a, StringValue b)
compare
in interface Comparator<StringValue>
a
- the left input.b
- the right input.public ValueType getType()
getType
in interface Comparator<StringValue>
public static double distance(String a, String b)
a
- the first input string.b
- the second input string.Copyright © 2014. All rights reserved.