Class ParseUtil

java.lang.Object
org.conical.common.bbl.util.ParseUtil

public class ParseUtil extends Object
Wrapper for static utility methods related to string parsing
Author:
rdoherty
  • Constructor Details

    • ParseUtil

      public ParseUtil()
  • Method Details

    • parseStreetName

      public static String parseStreetName(String address)
      Attempts to find the street name in the given String. The algorithm is as follows:
      1. Splits address line into tokens delimited by <space>
      2. If only 0 or 1 tokens exist, return the original value
      3. If 2 tokens exist, assume first token is street number and return second token
      4. If >2 tokens exist, assume first token is street number and check second for a variation of a compass direction
      5. If second token is a variation of north, south, east, or west, return third token
      6. If not, return second token
      While simplistic, this algorithm has a reasonably high degree of success.
      Parameters:
      address - address line to be parsed
      Returns:
      street name (without street type (e.g. Street, Blvd, Road, Lane)