News for hackers. Stuff that matters.
Re:Google's library for dealing with phone numbers (Java/Jav... by kondro on Wednesday January 05, 2011 @06:24AM (#2070669)
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.
Re:Google's library for dealing with phone numbers (Java/Jav... by bliving on Wednesday January 05, 2011 @09:09AM (#2070968)
"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...

Re:Google's library for dealing with phone numbers (Java/Jav... by robotron on Wednesday January 05, 2011 @07:45AM (#2070795)
"A direct port to Javascript is also available."

Did you happen to notice where this is?

Re:Google's library for dealing with phone numbers (Java/Jav... by tuxychandru on Wednesday January 05, 2011 @07:55AM (#2070812)
It is in the SVN. README documents the usage.

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

Re:Google's library for dealing with phone numbers (Java/Jav... by g1smd on Thursday January 06, 2011 @04:51PM (#2077400)
Re:Google's library for dealing with phone numbers (Java/Jav... by davidradcliffe on Wednesday January 05, 2011 @09:16AM (#2070991)
How much work would it take to make a complete ruby port?
Re:Google's library for dealing with phone numbers (Java/Jav... by kondro on Wednesday January 05, 2011 @09:25AM (#2071021)
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.

Re:Google's library for dealing with phone numbers (Java/Jav... by simon_kun on Wednesday January 05, 2011 @09:24AM (#2071015)
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)
Re:Google's library for dealing with phone numbers (Java/Jav... by bigfudge on Wednesday January 05, 2011 @09:32AM (#2071040)
Or python... I'm hacking together regexes for dealing with specific country formats in django right now... Is there a comparable python lib available?