haskell-postal- Haskell binding for the libpostal library

Copyright2018 Fábián Tamás László
MaintainerFábián Tamás László <giganetom@gmail.com>
Safe HaskellNone



Provides an interface for the libpostal NLP library



data AddressParserOptions Source #

Phantom type for a Ptr containing address parser options

data NormalizeOptions Source #

Phantom type for a Ptr containing options for the normalizer

setup :: IO Int Source #

Calls libpostal_setup() to set up the library Make sure you call this before anything else

setupParser :: IO Int Source #

Calls libpostal_setup_parser() to set up the address parser Call this before trying to parse addresses

setupLanguageClassifier :: IO Int Source #

Calls libpostal_setup_language_classifier() to set up the classifier Call this before doing address normaliation

getAddressParserDefaultOptions :: IO (Ptr AddressParserOptions) Source #

Returns default parser options returned by libpostal_get_address_parser_default_options()

getDefaultNormalizeOptions :: IO (Ptr NormalizeOptions) Source #

Returns default normalizer options returned by libpostal_get_default_options()

parseAddress :: Ptr AddressParserOptions -> Text -> IO [(Text, Text)] Source #

Parse an address Calls libpostal_parse_address() to parse an address and returns the parsed parts as a list of key-value tuples (an association list).

expandAddress :: Ptr NormalizeOptions -> Text -> IO [Text] Source #

Returns the expansion of an address Calls libpostal_expand_address() to normalize an address and return the list of normalized addresses.

tearDownParser :: IO () Source #

Calls libpostal_teardown_parser()

tearDownLanguageClassifier :: IO () Source #

Calls libpostal_teardown_language_classifier()

tearDown :: IO () Source #

Calls libpostal_teardown()