Coder Social home page Coder Social logo

Comments (13)

floere avatar floere commented on August 18, 2024

Thanks! It is horribly broken indeed, with a big fat TODO on top.

I'll think about a quick solution and pasting it here (for reference). Cheers!

from phony.

floere avatar floere commented on August 18, 2024

Thanks for the test cases and the detailed writeup as well!

from phony.

vilcsak avatar vilcsak commented on August 18, 2024

Is there another country that has a similar setup with the area codes? If there's an existing case, I can probably figure things out.

from phony.

floere avatar floere commented on August 18, 2024

Lithuania might be helpful, but I have to admit that I am wondering how to do the mobile numbers. Argentina is pretty unique in that they prepend a "mobile digit" in front of the normal numbering scheme.

from phony.

floere avatar floere commented on August 18, 2024

This solves the case for fixed line numbers:

  country '54', one_of('11') >> split(4,4) |
                one_of("220",
                       "221",
                       "223",
                       "237",
                       "261",
                       "264",
                       "291",
                       "297",
                       "299",
                       "341",
                       "342",
                       "343",
                       "345",
                       "351",
                       "353",
                       "358",
                       "381",
                       "385",
                       "387",
                       "388") >> split(3,4) |
                fixed(4)      >> split(2,4)

from phony.

floere avatar floere commented on August 18, 2024

@vilcsak Can you live with mobile number rendered as "+54 911 1234 5678"? (no space between 9 and 11) I need to do a little rewrite of Phony if this case needs to be covered.

from phony.

floere avatar floere commented on August 18, 2024

(Please disregard my earlier attempt at a regexp – I was in the wrong mindset)

from phony.

floere avatar floere commented on August 18, 2024

Got it, will release in 1.5.2 in 10 minutes.

  # Argentine Republic.
  #
  country '54', one_of('11', '911') >> split(4,4) | # Fixed & Mobile
                match(/^(22[0137]|237|26[14]|29[179]|34[1235]|35[138]|38[1578])/) >> split(3,4) |        # Fixed
                match(/^(922[0137]|9237|926[14]|929[179]|934[1235]|935[138]|938[1578])/) >> split(3,4) | # Mobile
                match(/^(9\d{4})/) >> split(2, 4) | # Mobile
                fixed(4) >> split(2,4) # Fixed

from phony.

vilcsak avatar vilcsak commented on August 18, 2024

Cool, this will certainly do for now. Would be great to have the true 9 support in the future.

from phony.

floere avatar floere commented on August 18, 2024

Great! 1.5.2 is released, fixed with your input. Many thanks!

from phony.

vilcsak avatar vilcsak commented on August 18, 2024

Upgraded, thanks!

from phony.

floere avatar floere commented on August 18, 2024

@vilcsak Great! Please note that 1.6.0 has been released as well, lowering the possibility of cut-off numbers. Also find yourself in the special mentions section https://github.com/floere/phony/wiki/Contributors :)

from phony.

floere avatar floere commented on August 18, 2024

Btw, I love the title "quite broken" … it's like the brits say "quite dead" :)

from phony.

Related Issues (20)

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.