Permalink
Browse files

Fix previous commit with ruby 1.9 problem

  • Loading branch information...
1 parent 20e8214 commit 78c6631fa48d8ee275c71576bd96c18d1ca0191e @rubydev rubydev committed Jul 5, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/language_detector.rb
View
@@ -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 = ''

0 comments on commit 78c6631

Please sign in to comment.