summaryrefslogtreecommitdiff
path: root/lib/bundler/similarity_detector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/similarity_detector.rb')
-rw-r--r--lib/bundler/similarity_detector.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb
index d67bfbae6e..c4caab71a8 100644
--- a/lib/bundler/similarity_detector.rb
+++ b/lib/bundler/similarity_detector.rb
@@ -9,8 +9,8 @@ module Bundler
# return an array of words similar to 'word' from the corpus
def similar_words(word, limit = 3)
- words_by_similarity = @corpus.map{|w| SimilarityScore.new(w, levenshtein_distance(word, w))}
- words_by_similarity.select{|s| s.distance<=limit}.sort_by(&:distance).map(&:string)
+ words_by_similarity = @corpus.map{|w| SimilarityScore.new(w, levenshtein_distance(word, w)) }
+ words_by_similarity.select{|s| s.distance<=limit }.sort_by(&:distance).map(&:string)
end
# return the result of 'similar_words', concatenated into a list
@@ -34,7 +34,7 @@ module Bundler
dm = [] # distance matrix
# Initialize first row values
- dm[0] = (0..this.length).collect { |i| i * ins }
+ dm[0] = (0..this.length).collect {|i| i * ins }
fill = [0] * (this.length - 1)
# Initialize first column values