Exemplo n.º 1
0
 private Match ProcessMatch(Token working_a, Token working_b, Match currentMatch, CompareResult result)
 {
     if (currentMatch == null)
     {
         currentMatch = new Match(result);
     }
     currentMatch.TokensA.AddLast(working_a);
     currentMatch.TokensB.AddLast(working_b);
     return currentMatch;
 }
Exemplo n.º 2
0
        private Match FinishMatch(Match currentMatch, List<Match> matches)
        {
            if (currentMatch == null) return null;

            var a_text = currentMatch.TokensA.Select(a => a.Text).Distinct().ToArray();
            var b_text = currentMatch.TokensB.Select(a => a.Text).Distinct().ToArray();

            var allMatches = a_text.Length;
            var realMatches = a_text.Intersect(b_text).Count();
            var p = (double)realMatches / (double)allMatches;

            if (allMatches >= _cfg.MIN_MATCH_LENGTH && p >= _cfg.MIN_COMMON_TOKEN)
            {
                matches.Add(currentMatch);
            }
            return null;
        }