Module: English::Patterns

Defined in:
lib/gems/english-0.3.1/lib/english/patterns.rb

Overview

Patterns Function Module

Returns a Regexp pattern based on the given pattern string or symbolic name.

They are also recognizied in plural form.

Class Method Summary collapse

Class Method Details

.charObject Also known as: chars, character, characters

Character



16
17
18
# File 'lib/gems/english-0.3.1/lib/english/patterns.rb', line 16

def char
  //
end

.lineObject Also known as: lines

Line



34
35
36
# File 'lib/gems/english-0.3.1/lib/english/patterns.rb', line 34

def line
  /\Z/
end

.sentenceObject

Sentence FIXME



42
43
44
# File 'lib/gems/english-0.3.1/lib/english/patterns.rb', line 42

def sentence
  /[.]\ /
end

.wordObject Also known as: words

Word



26
27
28
# File 'lib/gems/english-0.3.1/lib/english/patterns.rb', line 26

def word
  /\s+|\Z/
end