Class: TextNlp::Normalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/text_nlp/normalizer.rb

Instance Method Summary collapse

Instance Method Details

#normalize(text) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/text_nlp/normalizer.rb', line 5

def normalize(text)
  text.downcase!
  text.tr!("éèàçîêô","eeacieo")
  text.tr!("!',;?.()/\\_|[]{}\"<>:*$%\-"," ")
  text.gsub!(/\s+/," ")
  text.strip!
  text
end