Search in sources :

Example 1 with FindMatches

use of org.omegat.core.statistics.FindMatches in project omegat by omegat-org.

the class FindMatchesThread method search.

@Override
protected List<NearString> search() throws Exception {
    if (!project.isProjectLoaded()) {
        // project is closed
        return Collections.emptyList();
    }
    if (project.getSourceTokenizer() == null) {
        return null;
    }
    long before = System.currentTimeMillis();
    try {
        FindMatches finder = new FindMatches(project, OConsts.MAX_NEAR_STRINGS, true, false);
        List<NearString> result = finder.search(processedEntry.getSrcText(), true, true, this::isEntryChanged);
        LOGGER.finer(() -> "Time for find matches: " + (System.currentTimeMillis() - before));
        return result;
    } catch (FindMatches.StoppedException ex) {
        throw new EntryChangedException();
    }
}
Also used : FindMatches(org.omegat.core.statistics.FindMatches) NearString(org.omegat.core.matching.NearString)

Aggregations

NearString (org.omegat.core.matching.NearString)1 FindMatches (org.omegat.core.statistics.FindMatches)1