Why translation memory provider didn't support highlight function?

之前有人提出了这个问题,这里显示的是代码,因此仍然没有不一致的显示。

我们都知道SDL本地文件TM支持高亮显示输入文本和返回源文本之间的差异,如下所示:

Screenshot of Studio Developers Q&A interface showing a comparison of text with highlighted differences. The left panel displays Chinese text with highlighted differences, and the right panel shows an English translation with a 90% match.

Howerver, Our plugin which implements translation provider function can't display the difference, the result is:

Screenshot of Studio Developers Q&A interface with a comparison of text. The left panel shows Chinese text with highlighted differences, and the right panel shows an English translation with a 94% match and additional comments.

API上说是要计算返回的SearchResult 对象的
searchResult.ScoringResult.EditDistance属性值。

My implementation function is:

private EditDistance getEditDistance(CultureInfo cultureInfo, String text, String source)
{
TokenizerSetup setup = new TokenizerSetup();
setup.Culture = cultureInfo;
TokenizerParameters parameters = new TokenizerParameters(setup, null);
Tokenizer tokenizer = new Tokenizer(parameters);
List<Token> textTokenList = tokenizer.Tokenize(text);
List<Token> sourceTokenList = tokenizer.Tokenize(source);
EditDistanceComputer<Token> editDistanceComputer = new EditDistanceComputer<Token>(null);
return editDistanceComputer.ComputeEditDistance(sourceTokenList, textTokenList);
}
Executed, but still no effect
Screenshot of code from Studio Developers Q&A. The code snippet is in a programming IDE, showing a method definition with parameters and a loop structure. Chinese characters are present in the comments.
I noticed that the call service implementation sentence match interface has a SearchSettings object, there is a read-only property IsConcordanceSearch, the value is always false, can not show whether the difference is related to this value, if there is any way to make it true What?


Generated Image Alt-Text
[edited by: RWS Community AI at 5:45 AM (GMT 0) on 15 Nov 2024]
Parents Reply Children