Address Parser
Address Parser
The Context
While doing any online transaction the address of the user is mandatory. Rather than
entering street name, locality, State etc, as separate fields, the better way to get the
address is that you can ask the user to enter the complete address in one field. What
the merchant will require would be the exact address with different fields like street,
locality, city, zip code etc.
The Problem
You will be given an address in a string, you need to parse the address from the
string and return the structure Address.
Sample Input:
Find attached sample input test file where each address is separated by a blank line.
Address parsing
inputs.txt
Expected Output:
We want your application to parse all the given addresses in the attached input file.
The output should be in a text file containing all the parsed addresses, where each
parsed output address is in the following format:
Street|Locality|City|State|PostalCode|Country
Each address output should be in a new line.
In case any of the address field is missing, leave the space blank between the “|”
(pipe) separators. Don’t remove the pipe separators.
For example, if State is not mentioned in the input string, the output should be:
Street|Locality|City| |PostalCode|Country
Deliverables
1. Mandatory: Compilable source code (self-documented) in any language. Sample
output text file in the format mentioned.
2. Extra Credits: Ideas to evolve code