Why translation memory provider didn't support highlight function?

Hi,

We all know that SDL local file TM support hightlight the differences between the input text and the returned source text, just like this:

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

Is there any method to achieve this function?

Parents
  • In order to for this to work you need to calculate the determine the changes and calculate the positions where there are differences. You then need to set this information on the following property:

    searchResult.ScoringResult.EditDistance

    Calculating the changes and differences is not a trivial taks and we are looking at ways on how we can expose the existing implementation. Until then you need to provide your implementation.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • I have tried to implement the  EditDistance function like this.

    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);
    }
     
    But after compiled my plugin and loading on sdl trados, it reminds me I don't have the right to do this.  
     
     
    Any other way to implement this function, looking forward to reply~
Reply
  • I have tried to implement the  EditDistance function like this.

    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);
    }
     
    But after compiled my plugin and loading on sdl trados, it reminds me I don't have the right to do this.  
     
     
    Any other way to implement this function, looking forward to reply~
Children