Skip to content

mkscrg/normalic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

normalize U.S addresses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%