/address-standardizer

An address standardizer made in Kotlin based on USPS Publication 28

Primary LanguageKotlinApache License 2.0Apache-2.0

Address Standardizer

license forks stars issues pull-requests

An address standardizer made in Kotlin based on USPS Publication 28

What it does do

  • Parse your address into parts
  • Replace some parts (eg. direction) with its standard.

What it does not do

  • Appending ZIP+4
  • Address Validation
  • DPV Verification
  • Address (Typo) Correction

Download

How to use

Make sure to use a valid address, otherwise it may not work!

In Kotlin

import io.standardizer.address.AddressStandardizerFactory  
  
val adr = AddressStandardizerFactory.createStandardizer("us").standardize("your address here")  

or

import io.standardizer.address.AddressStandardizerFactory  
  
val standardizer = AddressStandardizerFactory.createStandardizer("us")  
val adr = standardizer.standardize("your address here")  

In Java

Use Standalone Jar (includes Kotlin Runtime), otherwise you will have to manually include the kotlin runtime in the classpath!

package packageName;  
  
import io.standardizer.address.AddressStandardizer;  
import io.standardizer.address.AddressStandardizerFactory;  
  
import java.util.Map;  
  
public class Main {  
    public static void main(String[] args) { 
        AddressStandardizer adr = AddressStandardizerFactory.createStandardizer("us"); 
        Map<String, String> res = adr.standardize("your address here"); 
        System.out.println(res); 
    }
}  

TODO

  • Support for bypass and frontage roads
  • Refactoring to make more Object-Oriented
  • Proper exception handling