Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/unsupervised-language-detection/language-detector.rb
Instance Method Summary collapse
-
#to_ngrams(n) ⇒ Object
Returns a set of ‘n`-grams computed from this string.
Instance Method Details
#to_ngrams(n) ⇒ Object
Returns a set of ‘n`-grams computed from this string.
6 7 8 |
# File 'lib/unsupervised-language-detection/language-detector.rb', line 6 def to_ngrams(n) self.normalize_tweet.scan(/.{#{n}}/) end |