I am using the libpostal library to find an full address (street, city, state, and postal code) within a news article. libpostal when given input text:
There was an accident at 5 Main Street Boulder, CO 10566 -- which is at the corner of Wilson.
returns a vector:
[{:label "house", :value "there was an accident at 5"}
{:label "road", :value "main street"}
{:label "city", :value "boulder"}
{:label "state", :value "co"}
{:label "postcode", :value "10566"}
{:label "road", :value "which is at the corner of wilson."}
I am wondering if there is a clever way in Clojure to extract a sequence where the :label values occur in a sequence:
[road unit? level? po_box? city state postcode? country?]
where ? represents an optional value in the match.