Module: CWG::TextHelpers

Included in:
CurrentWord, Rss, Str, Words
Defined in:
/Users/martyn/cw/cw_clone/lib/cw/text_helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) cw_chars(chr)



15
16
17
# File '/Users/martyn/cw/cw_clone/lib/cw/text_helpers.rb', line 15

def cw_chars chr
  chr.tr('^a-z0-9\.\,+', '')
end

- (Object) exclude_non_cw_chars(word)



19
20
21
22
23
24
25
# File '/Users/martyn/cw/cw_clone/lib/cw/text_helpers.rb', line 19

def exclude_non_cw_chars word
  temp = ''
  word.split.each do |chr|
    temp += chr if letter(chr)
  end
  temp
end

- (Object) letter_group



7
8
9
# File '/Users/martyn/cw/cw_clone/lib/cw/text_helpers.rb', line 7

def letter_group
  (97..122).to_a
end

- (Object) number_group



11
12
13
# File '/Users/martyn/cw/cw_clone/lib/cw/text_helpers.rb', line 11

def number_group
  (48..57).to_a
end