Skip to content
Mostly regex-based tool to normalize URLs, U.S phone numbers and U.S addresses
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
License.txt
Manifest
README.rdoc
Rakefile
normalic.gemspec

README.rdoc

Normalic

Easy parser/normalizer for U.S. addresses, U.S. phone numbers, and URIs.

More info

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.

Example

>> 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"

Note on URI parsing behavior

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.

Something went wrong with that request. Please try again.