usaddress

package
v0.50.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	PrimaryNumber   string // House or building number
	StreetPredir    string // Pre-directional (e.g., N, S)
	StreetName      string
	StreetSuffix    string
	StreetPostdir   string // Post-directional (e.g., NW)
	SecondaryUnit   string // e.g., APT 101
	City            string
	State           string
	ZIPCode         string
	Plus4           string // Optional ZIP+4 code
	POBox           string // For PO Box addresses
	RuralRoute      string // For rural route addresses
	HighwayContract string // For highway contract route addresses
	Country         string
}

Address represents a standardized address

func StandardizeAddress

func StandardizeAddress(addressStr string) Address

StandardizeAddress accepts an address string and returns a standard Address struct

func (Address) Similarity

func (a Address) Similarity(other Address) float64

func (Address) String

func (a Address) String() string

String formats the Address into a standardized string representation.

func (Address) Validate

func (a Address) Validate() error

Validate checks if the address is valid and returns an error explaining why it's invalid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL