Package net.sf.okapi.lib.verification
Class TermChecker
- java.lang.Object
-
- net.sf.okapi.lib.verification.TermChecker
-
public class TermChecker extends Object
-
-
Constructor Summary
Constructors Constructor Description TermChecker()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<TermHit>getExistingTargetStrings(TextFragment frag, List<TermHit> sourceHits, boolean betweenCodes)static List<TermHit>getExistingTargetTerms(TextFragment frag, List<TermHit> sourceHits)Get a list of existing target term in a given fragment based on a list of TermHit object for the source.List<Issue>getIssues()voidinitialize(SimpleTB termAccess, LocaleId srcLoc, LocaleId trgLoc, boolean stringSearch, boolean betweenCodes)static List<TermHit>removeMatches(List<TermHit> srcList, List<TermHit> trgList)Removes from both lists all the entries that are found in the source list and have their corresponding entry in the target list.intverify(URI docId, String subDocId, ITextUnit tu, Segment srcSeg, Segment trgSeg)
-
-
-
Method Detail
-
initialize
public void initialize(SimpleTB termAccess, LocaleId srcLoc, LocaleId trgLoc, boolean stringSearch, boolean betweenCodes)
-
getExistingTargetTerms
public static List<TermHit> getExistingTargetTerms(TextFragment frag, List<TermHit> sourceHits)
Get a list of existing target term in a given fragment based on a list of TermHit object for the source. Use this method to find the target terms in a text from a list of source term found in a source text. This allows to go faster as only the terms for which we have source matches are looked at.- Parameters:
frag- the fragment to process.sourceHits- the list of TermHit objects found in the source.- Returns:
- a list of existing target term in a given fragment based on a list of TermHit objects.
-
getExistingTargetStrings
public static List<TermHit> getExistingTargetStrings(TextFragment frag, List<TermHit> sourceHits, boolean betweenCodes)
-
removeMatches
public static List<TermHit> removeMatches(List<TermHit> srcList, List<TermHit> trgList)
Removes from both lists all the entries that are found in the source list and have their corresponding entry in the target list.Assuming the source list comes from a source text and the target list from its corresponding translation: The resulting source list indicates the terms that are likely to have not been translated according the terminology, or have a different meaning as the term listed in the source list.
- Parameters:
srcList- the source list.trgList- the target list.- Returns:
- the modified source list. Note that both lists are modified after the call.
-
-