Package org.omegat.gui.glossary
Class GlossarySearcher
java.lang.Object
org.omegat.gui.glossary.GlossarySearcher
A class encapsulating glossary matching logic.
-
Constructor Summary
ConstructorsConstructorDescriptionGlossarySearcher(ITokenizer tok, Language srcLang, boolean mergeAltDefinitions) GlossarySearcher(ITokenizer tok, Language srcLang, Language targetLang, boolean mergeAltDefinitions) -
Method Summary
Modifier and TypeMethodDescriptionsearchSourceMatches(SourceTextEntry ste, List<GlossaryEntry> entries) searchSourceMatchTokens(SourceTextEntry ste, GlossaryEntry entry) Searches for matching tokens between the source text of aSourceTextEntryand the source text of aGlossaryEntry.searchTargetMatches(String trg, ProtectedPart[] protectedParts, GlossaryEntry entry)
-
Constructor Details
-
GlossarySearcher
-
GlossarySearcher
public GlossarySearcher(ITokenizer tok, Language srcLang, Language targetLang, boolean mergeAltDefinitions)
-
-
Method Details
-
searchSourceMatches
-
searchSourceMatchTokens
Searches for matching tokens between the source text of aSourceTextEntryand the source text of aGlossaryEntry.The method tokenizes the source text and compares it with the glossary entry's source text. If no matches are found, it attempts to find matches using rules specific to CJK (Chinese, Japanese, Korean) text.
- Parameters:
ste- the source text entry containing the text to be tokenized and matchedentry- the glossary entry containing the source text to be matched against- Returns:
- a mutable list of token arrays representing the matched tokens between the source text entry and the glossary entry
-
searchTargetMatches
public List<String> searchTargetMatches(String trg, ProtectedPart[] protectedParts, GlossaryEntry entry)
-