From 90c3d71ed7fa7b47f56e5bcd249f983d4007ab56 Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Wed, 27 Apr 2016 13:04:28 +0300 Subject: [PATCH] Review fixes. --- search/search_quality/clusterize-postcodes.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search/search_quality/clusterize-postcodes.lisp b/search/search_quality/clusterize-postcodes.lisp index 9332d66f6b..23b67379ff 100755 --- a/search/search_quality/clusterize-postcodes.lisp +++ b/search/search_quality/clusterize-postcodes.lisp @@ -27,20 +27,20 @@ exec /usr/bin/env sbcl --noinform --quit --load "$0" --end-toplevel-options "$@" "Removes leading and trailing garbage from a string." (string-trim *seps* string)) -(defun english-letter-p (char) +(defun latin-char-p (char) (or (and (char>= char #\a) (char<= char #\z)) (and (char>= char #\A) (char<= char #\Z)))) (defun get-postcode-pattern (postcode) "Simplifies postcode in the following way: - * all english letters are replaced by 'A' + * all latin letters are replaced by 'A' * all digits are replaced by 'N' * hyphens and dots are replaced by a space * other characters are capitalized This format follows https://en.wikipedia.org/wiki/List_of_postal_codes. " - (map 'string #'(lambda (c) (cond ((english-letter-p c) #\A) + (map 'string #'(lambda (c) (cond ((latin-char-p c) #\A) ((digit-char-p c) #\N) ((or (char= #\- c) (char= #\. c)) #\Space) (T c)))