Guest User

Untitled

a guest
Jul 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. if (search_term != null) {
  2. WhereBoxParser.extractZip(search_term) match {
  3. case Some(zip: String) => wrapZip(zip)
  4. case None => {
  5. WhereBoxParser.extractStateAbbrev(search_term) match {
  6. case Some(abbrev: String) => wrapStateAbbrev(abbrev)
  7. case None => {
  8. WhereBoxParser.extractStateName(search_term) match {
  9. case Some(name: String) => wrapStateName(name)
  10. case None => {
  11. if (AddressMatcher.isAddress(search_term)) {
  12. GeoCoder.geoCodeLocation(search_term) match {
  13. case Some(georesult: GeoCodedLocation) => {
  14. if (isValidGeoResult(georesult)) {
  15. wrapGeoResult(georesult)
  16. } else searchSphinx
  17. }
  18. case _ => searchSphinx
  19. }
  20. } else searchSphinx
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment