farsifu
farsifu is a toolbox for developing ruby applications in Persian (Farsi) language.
Features
- Converting numbers to and from Persian numbers
- Spelling numbers in Persian (supports ordinal spelling of numbers in Persian)
- Converting Persian spelling of numbers back to normal numbers (see examples below)
- List of Iran's provinces, cities and counties
- List of countries in Persian
Examples:
"1234567890,;".to_farsi
"۱۲۳۴۵۶۷۸۹۰،؛".to_english
1024.spell_farsi
-2567023.spell_farsi
7.53.spell_farsi
-0.999.spell_farsi
-0.999.spell_farsi(false)
12.spell_ordinal_farsi
12.spell_ordinal_farsi(true)
"هزار و چهل و پنج".farsi_to_number
Iran::Provinces
Iran::Countries
Install
gem install farsifu
Changelog
0.5.0 - 15.FEB.2013
- Arash Mousavi is now a collaborator.
- Passing false to spell_farsi method will turn off the verbose mode.
- Major internal refactoring. Should not change the external API.
0.4.0 - 4.FEB.2013
- Added
farsi_to_number
to convert farsi spelling of numbers to real numbers , courtesy of Arash Mousavi - Major refactoring and reorganization of the code, courtesy of Arash Mousavi
0.3.0 - 28.JAN.2013
0.2.2 - 11.APR.2011
- Added ruby 1.9 compatibility, courtesy of Brian Kaney
0.2.1 - 11.JAN.2011
- Updated Readme
- Updated rspec to 2.4
- No longer replacing * with ×
0.2 - 2.MAR.2010
- Renamed gem from FarsiFu to farsifu
- Added a spec suite
- Migrated the gem to rubygems.org
- Added Iran Module
0.02 - 10.AUG.2008
- Converted into a gem
- Added rdocs documentation
0.01 - 07.AUG.2008
Copyright
Copyright (c) 2009-2013 Allen Bargi. See LICENSE for details.