"999" can no longer be normalized #219

Closed
baxter opened this Issue Jan 16, 2015 · 6 comments

Projects

None yet

2 participants

@baxter
Contributor
baxter commented Jan 16, 2015

Hi there, I'm not sure if this is a bug or not. The emergency number '999' seems to behave differently to the emergency number '911' when passed through normalize.

> ruby -e 'require "./lib/phony"; puts Phony.normalize("911")'
911
> ruby -e 'require "./lib/phony"; puts Phony.normalize("999")'
/Users/baxter/Code/phony/lib/phony.rb:102:in `rescue in normalize!': Phony could not normalize the given number. Is it a phone number? (Phony::NormalizationError)
    from /Users/baxter/Code/phony/lib/phony.rb:100:in `normalize!'
    from /Users/baxter/Code/phony/lib/phony.rb:97:in `normalize'
    from -e:1:in `<main>'

Running this through git bisect, it appears that this is the first commit where this fails: 9b4234a

Is this a bug or is it expected behaviour?

Thanks very much,

Paul.

@floere
Owner
floere commented Jan 16, 2015

Phony handles only international numbers. See the README for more info. Cheers!

On Fri, Jan 16, 2015 at 3:11 PM, Paul Boxley notifications@github.com
wrote:

Hi there, I'm not sure if this is a bug or not. The emergency number '999' seems to behave differently to the emergency number '911' when passed through normalize.

> ruby -e 'require "./lib/phony"; puts Phony.normalize("911")'
911
> ruby -e 'require "./lib/phony"; puts Phony.normalize("999")'
/Users/baxter/Code/phony/lib/phony.rb:102:in `rescue in normalize!': Phony could not normalize the given number. Is it a phone number? (Phony::NormalizationError)
  from /Users/baxter/Code/phony/lib/phony.rb:100:in `normalize!'
  from /Users/baxter/Code/phony/lib/phony.rb:97:in `normalize'
  from -e:1:in `<main>'

Running this through git bisect, it appears that this is the first commit where this fails: 9b4234a
Thanks very much,

Paul.

Reply to this email directly or view it on GitHub:
#219

@baxter
Contributor
baxter commented Jan 16, 2015

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

@floere
Owner
floere commented Jan 16, 2015

What Phony does if you give it "911" is that it checks first which country it is, and then gives the remaining number to that country to split. 91 is India, so it hands the 1 to India. So a number like 911 is always handled however the country handles it. Cheers!

On Fri, Jan 16, 2015 at 3:28 PM, Paul Boxley notifications@github.com
wrote:

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

Reply to this email directly or view it on GitHub:
#219 (comment)

@floere
Owner
floere commented Jan 16, 2015

That's a "possibly, yes".

On Fri, Jan 16, 2015 at 3:28 PM, Paul Boxley notifications@github.com
wrote:

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

Reply to this email directly or view it on GitHub:
#219 (comment)

@floere floere closed this Jan 23, 2015
@baxter
Contributor
baxter commented Jan 25, 2015

That makes perfect sense, thanks very much @floere 😄

@floere
Owner
floere commented Jan 25, 2015

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment