Hacker News new | past | comments | ask | show | jobs | submit login

Found this today whilst I was looking for a solution to standardised formatting of phone numbers. I was hoping for a ruby solution, but this is an extremely complete library supporting formatting and validation for 228 countries/regions.



"extremely complete library"

I'm interested in how the completeness is defined, as the standards available are loose at best. I couldn't see by what measure they considered this work 'complete'.

That complaint aside, it's a great effort to see. Now to test it out...


"A direct port to Javascript is also available."

Did you happen to notice where this is?


It is in the SVN. README documents the usage.

http://code.google.com/p/libphonenumber/source/browse/#svn%2...



How much work would it take to make a complete ruby port?


Well... habermann24 (https://github.com/habermann24/libphonenumber-ruby) looks like he's started on a ruby port and he also has his phoney library which doesn't appear to use the same dataset and doesn't work properly for Australia.

I am planning on just using the Java version with JRuby - it will probably be faster than a pure ruby version anyway.


Not the answer you were looking for, but you could run the Java lib with JRuby, or use the JS lib with Ruby/V8 and "The Ruby Racer" (https://github.com/cowboyd/therubyracer)


Or python... I'm hacking together regexes for dealing with specific country formats in django right now... Is there a comparable python lib available?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: