private TmMatch RetrieveSimilarMatchWithConcordanceSearch(TmMatch match, SearchSettings settings) { var segmentText = match.GetSource(settings.IsConcordanceSearch); // concordance search don't return any results with too little value of MaxResults // That's why it isn't set up to use it's default value 20. Trados.Interop.TMAccess.SearchResult tradosSegments = this.TranslationProvider.TradosProvider.ConcordanceSearch( segmentText, settings.MinScore); return(tradosSegments.TmMatches.Count > 0 ? tradosSegments.TmMatches[1] : match); }
public static string GetSource(this TmMatch tm, bool isConcordance) { return(!isConcordance ? tm.GetSource() : tm.TtxTranslationUnit.Children[0].Children[1].Children[0].Children[0].Children[0].Text); }