Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix previous commit with ruby 1.9 problem

  • Loading branch information...
commit 78c6631fa48d8ee275c71576bd96c18d1ca0191e 1 parent 20e8214
@rubydev rubydev authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/language_detector.rb
View
6 lib/language_detector.rb
@@ -205,7 +205,11 @@ def is_puctuation? b
end
def count_ngram token, n, counts
- token = "_#{token}#{'_' * (n-1)}" if n > 1 && token.jlength >= n
+ if RUBY_VERSION < '1.9'
+ token = "_#{token}#{'_' * (n-1)}" if n > 1 && token.jlength >= n
+ else
+ token = "_#{token}#{'_' * (n-1)}" if n > 1 && token.length >= n
+ end
i = 0
while i + n <= token.length
s = ''
Please sign in to comment.
Something went wrong with that request. Please try again.