GithubHelp home page GithubHelp logo

mobino / phone_classifier Goto Github PK

View Code? Open in Web Editor NEW
20.0 8.0 2.0 92 KB

Simple classification of phone numbers into different categories (:mobile, :landline, :forbidden)

License: MIT License

Ruby 100.00%

phone_classifier's Introduction

Phone Classifier

Used to quickly classifiy a phone number into :landline, :mobile or :forbidden

Current Travis Build Status: Build Status

Installation

gem install phone_classifier

Usage

PhoneClassifier.new('41791234567').kind        # => :mobile
PhoneClassifier.new('41791234567').mobile?     # => true
PhoneClassifier.new('41791234567').forbidden?  # => false

Supported Countries

  • +1, USA (will only reject service numbers, all other numbers considered mobile). Blame the US numbering systems
  • +30, Greece
  • +31, Netherlands
  • +32, Belgium
  • +33, France
  • +34, Spain
  • +36, Hungary
  • +39, Italy
  • +40, Romania
  • +41, Switerzland
  • +43, Austria
  • +44, UK
  • +45, Denmark
  • +46, Sweden
  • +47, Norway
  • +48, Poland
  • +49, Germany
  • +54, Argentina
  • +60, Malaysia
  • +61, Australia
  • +65, Singapore
  • +90, Turkey
  • +94, Sri Lanka
  • +91, India
  • +98, Iran
  • +212, Morocco
  • +213, Algeria
  • +233, Ghana
  • +234, Nigeria
  • +248, Seychelles
  • +249, Sudan
  • +255, Tanzania
  • +350, Gibraltar
  • +351, Portugal
  • +352, Luxembourg
  • +353, Ireland
  • +354, Iceland
  • +356, Malta
  • +357, Cyprus
  • +358, Finland
  • +359, Bulgaria
  • +370, Lithuania
  • +372, Estonia
  • +377, Monaco
  • +386, Slovenia
  • +420, Czech Republic
  • +421, Slovakia
  • +503, El Salvador
  • +509, Haiti
  • +852, Hong Kong
  • +972, Israel

Where is it used

Used in Mobino, a mobile payment service, to classifiy client phone numbers

Related

PhoneClassifier uses the fantastic Phony library to normalize numbers. Phony is the tool of choice if you need to work with phone numbers in Ruby.

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create new Pull Request

phone_classifier's People

Contributors

jcfischer avatar hippiefahrzeug avatar tpena avatar chengchen avatar jfgroff avatar tomeric avatar

Stargazers

 avatar Igor Zubkov avatar Francesco Sullo avatar Nogweii avatar Jordan avatar Leechael avatar Schinckus Lionel avatar Peter Dedene avatar Paul Deardorff avatar Cameron Ehrlich avatar Philippe Jayet avatar Martin May avatar André Mathlener avatar Jeffrey Macko avatar  avatar Alon Burg avatar Erran Carey avatar Fred Chen avatar Mattt avatar Oleksandr Simonov avatar

Watchers

 avatar Oleksandr Simonov avatar Nihad Abbasov avatar  avatar  avatar James Cloos avatar  avatar  avatar

Forkers

andrius jethroo

phone_classifier's Issues

forbidden category

Hello,

Its nice to see this app live – I was forked to add Lithuania and Spain, but you already have them.

However, I do not agree with your classification for 'forbidden' category, I believe, it should be exploded into: tolfree, premium, forbidden categories...

Let's discuss for example about my home country (Lithuania), we have an official dial plan for country

Phone number length including country code (370) is 11 digits (e164), followed by non-zero area code and a phone number (which could start with zero);

We also have 3 to 6-digits 'short' numbers to call information services, taxis etc.

Back to subject – area codes starting with 8 and 9 is not 'forbidden' but toll-free and premium numbers, according to the dialing plan, 'forbidden' should be on 'reserved' numbers category.

What do you think, is it good idea to add more categories? / Regards

Doesn't work for US numbers

I am trying to separate US numbers into landline and mobile but seems like its no more working for US numbers. Is there something I can do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.