Package net.sf.okapi.tm.pensieve.seeker
Interface ITmSeeker
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
PensieveSeeker
public interface ITmSeeker extends AutoCloseable
Used to query the TM.- Author:
- HaslamJD, HARGRAVEJE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the searcherList<TmHit>searchExact(TextFragment query, Metadata metadata)Get a list of exact matches for a given text fragment, taking inline codes in account.List<TmHit>searchFuzzy(TextFragment query, int threshold, int maxHits, Metadata metadata)Get a list of fuzzy matches for a given text fragment, taking inline codes in account.
-
-
-
Method Detail
-
searchExact
List<TmHit> searchExact(TextFragment query, Metadata metadata)
Get a list of exact matches for a given text fragment, taking inline codes in account.- Parameters:
query- the fragment to search formetadata- the metadata attributes to also match against, null for no metadata.- Returns:
- a list of exact matches
- Throws:
OkapiIOException- if the search cannot be completed due to I/O problems
-
searchFuzzy
List<TmHit> searchFuzzy(TextFragment query, int threshold, int maxHits, Metadata metadata)
Get a list of fuzzy matches for a given text fragment, taking inline codes in account.- Parameters:
query- the fragment to search for.threshold- the minimal score value to return.maxHits- the max number of hits returned.metadata- the metadata attributes to also match against, null for no metadata.- Returns:
- a list of exact or fuzzy matches.
- Throws:
OkapiIOException- if the search cannot be completed do to I/O problems
-
close
void close()
Close the searcher- Specified by:
closein interfaceAutoCloseable
-
-