public final class SmithWaterman extends Object implements StringMetric
This class is immutable and thread-safe if its substitution and gap functions are.
| Constructor and Description |
|---|
SmithWaterman()
Constructs a new Smith Waterman metric.
|
SmithWaterman(Gap gap,
Substitution substitution,
int windowSize)
Constructs a new Smith Waterman metric.
|
| Modifier and Type | Method and Description |
|---|---|
float |
compare(String a,
String b)
Measures the similarity between strings a and b.
|
String |
toString() |
public SmithWaterman()
-5.0 - gapLength a -3.0 substitution penalty
for mismatches, 5.0 for matches.public SmithWaterman(Gap gap, Substitution substitution, int windowSize)
gap - a gap function to score gaps bysubstitution - a substitution function to score substitutions bywindowSize - a non-negative window in whichpublic float compare(String a, String b)
StringMetriccompare in interface Metric<String>compare in interface StringMetrica - string a to compareb - string b to compareCopyright © 2014–2016. All rights reserved.