public class FindMatches
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FindMatches.StoppedException
Process will throw this exception if it stopped.All callers must catch it and just skip.
|
Constructor and Description |
---|
FindMatches(IProject project,
int maxCount,
boolean allowSeparateSegmentMatch,
boolean searchExactlyTheSame) |
Modifier and Type | Method and Description |
---|---|
protected void |
addNearString(EntryKey key,
java.lang.String source,
java.lang.String translation,
NearString.MATCH_SOURCE comesFrom,
boolean fuzzy,
int similarity,
int similarityNoStem,
int simAdjusted,
byte[] similarityData,
java.lang.String tmxName,
java.lang.String creator,
long creationDate,
java.lang.String changer,
long changedDate,
java.util.List<TMXProp> tuProperties)
Add near string into result list.
|
protected void |
checkStopped(IStopped stop) |
protected boolean |
haveChanceToAdd(int simStem,
int simNoStem,
int simExactly)
Check if entry have a chance to be added to result list.
|
protected void |
processEntry(EntryKey key,
java.lang.String source,
java.lang.String translation,
NearString.MATCH_SOURCE comesFrom,
boolean fuzzy,
int penalty,
java.lang.String tmxName,
java.lang.String creator,
long creationDate,
java.lang.String changer,
long changedDate,
java.util.List<TMXProp> props)
Compare one entry with original entry.
|
java.util.List<NearString> |
search(java.lang.String searchText,
boolean requiresTranslation,
boolean fillSimilarityData,
IStopped stop) |
Token[] |
tokenizeAll(java.lang.String str) |
Token[] |
tokenizeNoStem(java.lang.String str) |
Token[] |
tokenizeStem(java.lang.String str) |
public FindMatches(IProject project, int maxCount, boolean allowSeparateSegmentMatch, boolean searchExactlyTheSame)
searchExactlyTheSame
- allows to search similarities with the same text as source segment. This mode used only for
separate sentence match in paragraph project, i.e. where source is just part of current
source.public java.util.List<NearString> search(java.lang.String searchText, boolean requiresTranslation, boolean fillSimilarityData, IStopped stop) throws FindMatches.StoppedException
FindMatches.StoppedException
protected void processEntry(EntryKey key, java.lang.String source, java.lang.String translation, NearString.MATCH_SOURCE comesFrom, boolean fuzzy, int penalty, java.lang.String tmxName, java.lang.String creator, long creationDate, java.lang.String changer, long changedDate, java.util.List<TMXProp> props)
candEntry
- entry to compareprotected boolean haveChanceToAdd(int simStem, int simNoStem, int simExactly)
simStem
- similarity with stemmingsimNoStem
- similarity without stemmingsimExactly
- exactly similarityprotected void addNearString(EntryKey key, java.lang.String source, java.lang.String translation, NearString.MATCH_SOURCE comesFrom, boolean fuzzy, int similarity, int similarityNoStem, int simAdjusted, byte[] similarityData, java.lang.String tmxName, java.lang.String creator, long creationDate, java.lang.String changer, long changedDate, java.util.List<TMXProp> tuProperties)
public Token[] tokenizeStem(java.lang.String str)
public Token[] tokenizeNoStem(java.lang.String str)
public Token[] tokenizeAll(java.lang.String str)
protected void checkStopped(IStopped stop) throws FindMatches.StoppedException
FindMatches.StoppedException