public DamerauLevenshteinCorrelater(IDistanceCalculator <T> distanceCalculator, ITranspositionCalculator <T> transpositionCalculator, IRemovalCalculator <T> removalCalculator, IInsertionCalculator <T> insertionCalculator)
        {
            if (default(T) != null && typeof(T) != typeof(char))
            {
                throw new EnumerableCorrelaterException($"{nameof(T)} must be nullable or a char");
            }

            this.distanceCalculator      = distanceCalculator;
            this.transpositionCalculator = transpositionCalculator;
            this.removalCalculator       = removalCalculator;
            this.insertionCalculator     = insertionCalculator;
        }
Example #2
0
 public LevenshteinCorrelater(IDistanceCalculator <T> distanceCalculator, IRemovalCalculator <T> removalCalculator, IInsertionCalculator <T> insertionCalculator)
 {
     correlater = new DamerauLevenshteinCorrelater <T>(distanceCalculator, null, removalCalculator, insertionCalculator);
     correlater.OnProgressUpdate += (p, t) => OnProgressUpdate?.Invoke(p, t);
 }