Package org.conical.common.bbl.util
Class ParseUtil
java.lang.Object
org.conical.common.bbl.util.ParseUtil
Wrapper for static utility methods related to string parsing
- Author:
- rdoherty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
parseStreetName
(String address) Attempts to find the street name in the given String.
-
Constructor Details
-
ParseUtil
public ParseUtil()
-
-
Method Details
-
parseStreetName
Attempts to find the street name in the given String. The algorithm is as follows:- Splits address line into tokens delimited by <space>
- If only 0 or 1 tokens exist, return the original value
- If 2 tokens exist, assume first token is street number and return second token
- If >2 tokens exist, assume first token is street number and check second for a variation of a compass direction
- If second token is a variation of north, south, east, or west, return third token
- If not, return second token
- Parameters:
address
- address line to be parsed- Returns:
- street name (without street type (e.g. Street, Blvd, Road, Lane)
-