File: speed.yml

package info (click to toggle)
ruby-did-you-mean 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 412 kB
  • sloc: ruby: 1,755; makefile: 7
file content (13 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
prelude: |
  require 'did_you_mean/spell_checker'

  str1, str2 = "user_signed_in?", "user_logged_in?"
  METHODS    = ''.methods
  INPUT      = 'starts_with?'
  collection = DidYouMean::SpellChecker.new(dictionary: METHODS)

benchmark:
  Jaro:          DidYouMean::Jaro.distance(str1, str2)
  Jaro Winkler:  DidYouMean::JaroWinkler.distance(str1, str2)
  Levenshtein:   DidYouMean::Levenshtein.distance(str1, str2)
  Spell checker: collection.correct(INPUT)