SearchSegment method is called multiple times for the same text

Hello.

I'm developing a addin for Trados2022.

====================================================================

ITranslationProviderLanguageDirection::SearchSegment method is called multiple times for the same text

when open a document on the editor.

I'm having trouble to spend time to translate the same text  in multiple times.

What should I do about this?

Should I keep results cache of translation results?

================================================

The "SearchSegment " is called from When ITranslationProviderLanguageDirection::SearchTranslationUnitsMasked.

When open a document, the "SearchTranslationUnitsMasked" is called multiple times, too.

In the case there are 3 texts on document in editor...

text1, text2, text3

The "SearchTranslationUnitsMasked" was called 4 times with texts as argument(segments) like below.

text1, text2

text1

text1

text2, text3

This means "SearchSegment" is called multiple time for the same text.

emoji