Project

normalic

0.01
No commit activity in last 3 years
No release in over 3 years
Normalize U.S addresses
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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.number
=> "201"

>> address.street
=> "Varick"

>> address.to_s
=> "201 Varick St., New York, NY 10014"

>> phone = Normalic::PhoneNumber.parse("00 + 1* (212) 989-9741 ext. 123")
>> phone.npa
=> "212"

>> phone.to_s
=> "212 989 9741"

>> uri = Normalic::URI.parse("github.com/ericxtang/expresso/../normalic/")
>> uri.domain
=> "github"

>> uri.scheme
=> "http"

>> uri.to_s
=> "http://www.github.com/ericxtang/normalic"

>> addr = Normalic::Address.normalize_fields("address" => "201 Varick St.",
                                          :city => "New York",
                                          :state => "NY",
                                          :zipcode => 10014)
>> addr.number
=> "201"

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.

Contributors¶ ↑

Eric Tang www.erictang.org

Mike Craig twitter.com/mkscrg

Aidan Feldman www.aidanfeldman.com/