|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object databionics.text.SimilarString
public class SimilarString
A Strings that can be compared to other strings byte common metrics.
StringUtils
Constructor Summary | |
---|---|
SimilarString()
Standard constructor without arguments. |
|
SimilarString(java.lang.String value)
|
Method Summary | |
---|---|
int |
countSimilarExtTrigramMetric(StringList compare)
Count how many Strings in this list are similar to this String based on the trigram metric and a threshhold of 0.5. |
float |
extNGramMetric(int n,
java.lang.String compare)
Calculate extended n-grams metric distance of string and argument. |
boolean |
isSimilarTo(java.lang.String compare)
Check whether the String is similar to another String. |
float |
nGramMetric(int n,
java.lang.String compare)
Calculate n-grams metric distance of string and argument. |
java.lang.String |
normalize()
Normalize the String, that is make it lowercase, remove all no word characters like spacec and punctuation, remove articles replace German Umlaute |
static boolean |
similar(java.lang.String first,
java.lang.String second)
Check whether the Strings are similar As similar qualifies: 1) equal 2) both not empty and contained int one another 3) trigram metric greater than 0.5 |
StringList |
toExtNGrams(int n)
Build extended n-grams of string by adding _ at start and end. |
StringList |
toNGrams(int n)
Build n-grams of string. |
java.lang.String |
toString()
String representation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimilarString()
public SimilarString(java.lang.String value)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public StringList toNGrams(int n)
n
- Length of n-grams.
public StringList toExtNGrams(int n)
n
- Length of n-grams.
public float nGramMetric(int n, java.lang.String compare)
n
- Length of n-grams.compare
- String to compare to.
public float extNGramMetric(int n, java.lang.String compare)
n
- Length of n-grams.compare
- String to compare to.
public int countSimilarExtTrigramMetric(StringList compare)
compare
- Strings to compare to.
public java.lang.String normalize()
public boolean isSimilarTo(java.lang.String compare)
public static boolean similar(java.lang.String first, java.lang.String second)
first
- First string.second
- Second string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |