Easy parser/normalizer for U.S. addresses, U.S. phone numbers, and URIs.
Don’t you wanna punch yourself in the face every time you have to parse and normalize this stuff?
I did repeatedly while writing this gem so you don’t have to anymore.
It tries to correct mal-formed input to the best of its ability.
>> address = Normalic::Address.parse("201 Varick St. floor 12th, New York, NY 10014")
>> address.to_s
=> "201 Varick St., New York, NY 10014"
>> phone = Normalic::PhoneNumber.parse("00 + 1* (212) 989-9741 ext. 123")
>> phone.to_s
=> "212 989 9741"
>> uri = Normalic::URI.parse("github.com/ericxtang/expresso/../normalic/")
>> uri.to_s
=> "http://www.github.com/ericxtang/normalic"
In the name of normalization, the URI class uses http and www as the default scheme and subdomain if they are missing from the input string.