Module: Pingilish

Defined in:
lib/pingilish.rb,
lib/pingilish/version.rb

Defined Under Namespace

Classes: DbFilter, Farsi, MappingFilter

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.to_default(text) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/pingilish.rb', line 12

def self.to_default(text)
  db_filter = DbFilter.new(text)
  text = db_filter.process

  # stem_filter = StemFilter.new(text)
  # text = stem_filter.process

  mapping_filter = MappingFilter.new(text)
  text = mapping_filter.process
end

.to_farsi(str) ⇒ Object



7
8
9
10
# File 'lib/pingilish.rb', line 7

def self.to_farsi(str)
  pin = Farsi.new(str)
  pin.to_farsi.force_encoding('UTF-8')
end