Module: CW::TextHelpers

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

Instance Method Summary collapse

Instance Method Details

#cw_chars(chr) ⇒ Object



14
15
16
# File 'lib/cw/text_helpers.rb', line 14

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

#exclude_non_cw_chars(word) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/cw/text_helpers.rb', line 18

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

#letter_groupObject



6
7
8
# File 'lib/cw/text_helpers.rb', line 6

def letter_group
  (97..122).collect {|e| e.chr}
end

#number_groupObject



10
11
12
# File 'lib/cw/text_helpers.rb', line 10

def number_group
  (48..57).collect {|e| e.chr}
end