Sha256: 3df85335c5be47ab9dc18e781f64586d02e691479ff7cc6255227341429bb48b

Contents?: true

Size: 429 Bytes

Versions: 8

Compression:

Stored size: 429 Bytes

Contents

module RsegEngine
  LETTER_SYMBOLS = ('a'..'z').to_a + ('A'..'Z').to_a

  class English < Engine
    def initialize
      @word = ''
      super
    end
  
    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  
  end
end

Version data entries

8 entries across 8 versions & 5 rubygems

Version Path
rseg_harry-0.0.4 lib/engines/english.rb
rseg_harry-0.0.3 lib/engines/english.rb
rseg_ggharry-0.0.2 lib/engines/english.rb
rseg_ggharry-0.0.1 lib/engines/english.rb
rseg-ggharry-0.0.1 lib/engines/english.rb
rseg1.9-0.1.5 lib/engines/english.rb
rseg-0.1.7 lib/engines/english.rb
rseg-0.1.6 lib/engines/english.rb