Class TermChecker


  • public class TermChecker
    extends Object
    • Constructor Detail

      • TermChecker

        public TermChecker()
    • 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.
      • 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.