Class: RsegEngine::English
Instance Method Summary collapse
-
#initialize ⇒ English
constructor
A new instance of English.
- #process(char) ⇒ Object
Methods inherited from Engine
Constructor Details
#initialize ⇒ English
Returns a new instance of English.
5 6 7 8 |
# File 'lib/engines/english.rb', line 5 def initialize @word = '' super end |
Instance Method Details
#process(char) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/engines/english.rb', line 10 def process(char) match = false word = nil if LETTER_SYMBOLS.include?(char) @word << char match = true else word = @word @word = '' match = false end [match, word] end |