"fjhhjhkkjhkh3460asdad" is recognized as a valid german number?

56 views
Skip to first unread message

Dominic

unread,
Feb 8, 2022, 6:26:45 AM2/8/22
to libphonenumber-discuss

David Beaumont

unread,
Feb 8, 2022, 6:35:47 AM2/8/22
to libphonenum...@googlegroups.com
If you call the API with something you have asserted is a number (which is what the demo does) then it tries very hard to trust you.

It skips the "junk" at the front to get "3460" and looks at the trailing letters ("asdad") is if they were dialled on an ITU phone where numbers can be represented as letters, so a=2, s=7, d=3 (this is mostly used for US numbers but can apply elsewhere).
You've stated it's a German number in the demo, so that's trusted to begin with and we end up with +49 3460 27323 (from "asdad").

If you were expecting the libphonenumber demo to identify "good" phone numbers in otherwise nonsense text, I'm afraid it's not going to do that.
It trusts that you are already giving it an extracted phone number.

David




--
You received this message because you are subscribed to the Google Groups "libphonenumber-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libphonenumber-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libphonenumber-discuss/e41eafec-519e-4f5b-b2ad-3d1fc1d4153dn%40googlegroups.com.


--
David Beaumont :: Îñţérñåţîöñåļîžåţîờñ Libraries :: Google
Google Switzerland GmbH., Brandschenkestrasse 110, CH-8002, Zürich - Switzerland
Reply all
Reply to author
Forward
0 new messages