lib/vidibus/core_extensions/string.rb
# Replaces non-latin chars, leaves some special ones.
Replaces non-latin chars, leaves some special ones.
Replaces non - latin chars leaves some special ones .
def latinize
    c = dup
    for char, map in LATIN_MAP
      c.gsub!(/[#{map.join}]/mu, char)
    end
    c.gsub!(/[^a-zA-Z0-9\.\,\|\?\!\:;"'=\+\-_]+/mu, " ")
    c.gsub!(/\s+/, " ")
    c
  end
def latinize c = dup for char , map in LATIN_MAP c . gsub! ( / [ #{ map . join } ] /mu , char ) end c . gsub! ( / [^a-zA-Z0-9 \. \, \| \? \! \: ;"'= \+ \- _]+ /mu , " " ) c . gsub! ( / \s + / , " " ) c end
Replaces non-latin chars, leaves some special ones.
Replaces non - latin chars leaves some special ones .