public class TextSearchResult extends Object implements Comparable
Levenshtein distance
).T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
TextSearchResult(int index,
int distance,
String match)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compare the instance to another one.
|
int |
getDistance()
Get the Levenshtein distance between the match and the pattern.
|
int |
getIndex()
Get the matching string start index.
|
Rectangle |
getLocation()
Get the matching string location.
|
String |
getMatch()
Get the matching string.
|
void |
setLocation(Rectangle location)
Set the matching string location.
|
public TextSearchResult(int index, int distance, String match)
index
- the match position (index) in the source text where 0 (zero)
marks the text beginning.distance
- the Levenshtein distance between the match and the pattern.
For exact searches produced through String.indexOf(java.lang.String)
use the value of 0 to indicate that the match string is exactly the same as
the pattern.match
- the matching string. It is equal to the pattern for the distance of 0.public int compareTo(Object o)
compareTo
in interface Comparable
o
- an object to compare to.public int getIndex()
public int getDistance()
public String getMatch()
distance
is 0.public Rectangle getLocation()
public void setLocation(Rectangle location)
location
- the matching string location.