diff --git a/thesethreewords.py b/thesethreewords.py index cc0e84e..a398d6c 100644 --- a/thesethreewords.py +++ b/thesethreewords.py @@ -77,17 +77,18 @@ class WordHasher(object): self.six_wordlist = HUMAN_WORDLIST self.three_wordlist = GOOGLE_WORDLIST - def three_words(self, (lat, lon)): + def three_words(self, lat_long): """Convert coordinate to a combination of three words The coordinate is defined by latitude and longitude in degrees. """ + lat, lon = lat_long gh = geohash.encode(lat, lon, 9) words = "-".join(self.three_wordlist[p] for p in self.to_rugbits(self.geo_to_int(gh))) return words - def six_words(self, (lat, lon)): + def six_words(self, lat_long): """Convert coordinate to a combination of six words The coordinate is defined by latitude and longitude @@ -96,6 +97,7 @@ class WordHasher(object): With six words the word list contains only words which are short, easy to pronounce and easy distinguish. """ + lat, lon = lat_long gh = geohash.encode(lat, lon, 9) words = "-".join(self.six_wordlist[p] for p in self.to_bytes(self.pad(gh))) return words