Sha256: 45e6ea00a4afdb4e7810465641af3a4541c2bdeb1db13c919899c9ad1af608a2

Contents?: true

Size: 611 Bytes

Versions: 9

Compression:

Stored size: 611 Bytes

Contents

module English

  # = Patterns Function Module
  #
  # Returns a Regexp pattern based on the given
  # pattern string or symbolic name.
  #
  # They are also recognizied in plural form.

  module Patterns

    module_function

    # Character

    def char
      //
    end

    alias_method :chars, :char
    alias_method :character, :char
    alias_method :characters, :char

    # Word

    def word
      /\s+|\Z/
    end

    alias_method :words, :word

    # Line

    def line
      /\Z/
    end

    alias_method :lines, :line

    # Sentence  FIXME

    def sentence
      /[.]\ /
    end

  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
etapper-0.0.5 vendor/gems/english-0.3.1/lib/english/patterns.rb
etapper-0.0.4 vendor/gems/english-0.3.1/lib/english/patterns.rb
etapper-0.0.3 vendor/gems/english-0.3.1/lib/english/patterns.rb
etapper-0.0.2 vendor/gems/english-0.3.1/lib/english/patterns.rb
etapper-0.0.1 vendor/gems/english-0.3.1/lib/english/patterns.rb
etapper-0.0.0 vendor/gems/english-0.3.1/lib/english/patterns.rb
mack-facets-0.8.3 lib/gems/english-0.3.1/lib/english/patterns.rb
mack-facets-0.8.2 lib/gems/english-0.3.1/lib/english/patterns.rb
mack-facets-0.8.3.1 lib/gems/english-0.3.1/lib/english/patterns.rb