New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

farsifu

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

farsifu

  • 0.5.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

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 # => "1234567890,;"
    1024.spell_farsi          # => "یک هزار و بیست و چهار"
    -2567023.spell_farsi      # => "منفی دو میلیون و پانصد و شصت و هفت هزار و بیست و سه"
    7.53.spell_farsi          # => "هفت ممیز پنجاه و سه صدم"
    -0.999.spell_farsi        # => "منفی صفر ممیز نهصد و نود و نه هزارم"
    # Passing false to spell_farsi method will turn off the verbose mode.
    -0.999.spell_farsi(false) # => "منفی نهصد و نود و نه هزارم"
    12.spell_ordinal_farsi    # => "دوازدهم"
    # Note the different when you pass true to spell_ordinal_farsi method. 
    12.spell_ordinal_farsi(true)    # => "دوازدهمین"
    "هزار و چهل و پنج".farsi_to_number  # => 1045


    Iran::Provinces
    # => returns an array of hashes like below
    # [{:name => "آذربایجان شرقی", :eng_name => "Azerbaijan, East",
    #   :capital => "تبریز", :eng_capital => "Tabriz", 
    #   :counties => ["آذرشهر", "اسکو",..."]...]

    Iran::Countries
    # => returns an array of hashes like below
    # [ { :iso2 => 'AI', :fa => 'آنگیل', :en => 'Anguilla' }, ...]

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

  • Initial release

Copyright (c) 2009-2013 Allen Bargi. See LICENSE for details.

FAQs

Package last updated on 03 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc