Cannot use parameterized arguments in 3

This commit is contained in:
mmcwilliams 2024-06-28 09:35:43 -04:00
parent c3ecddcf3d
commit ff090f2744
1 changed files with 4 additions and 2 deletions

View File

@ -77,17 +77,18 @@ class WordHasher(object):
self.six_wordlist = HUMAN_WORDLIST self.six_wordlist = HUMAN_WORDLIST
self.three_wordlist = GOOGLE_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 """Convert coordinate to a combination of three words
The coordinate is defined by latitude and longitude The coordinate is defined by latitude and longitude
in degrees. in degrees.
""" """
lat, lon = lat_long
gh = geohash.encode(lat, lon, 9) gh = geohash.encode(lat, lon, 9)
words = "-".join(self.three_wordlist[p] for p in self.to_rugbits(self.geo_to_int(gh))) words = "-".join(self.three_wordlist[p] for p in self.to_rugbits(self.geo_to_int(gh)))
return words return words
def six_words(self, (lat, lon)): def six_words(self, lat_long):
"""Convert coordinate to a combination of six words """Convert coordinate to a combination of six words
The coordinate is defined by latitude and longitude The coordinate is defined by latitude and longitude
@ -96,6 +97,7 @@ class WordHasher(object):
With six words the word list contains only words With six words the word list contains only words
which are short, easy to pronounce and easy distinguish. which are short, easy to pronounce and easy distinguish.
""" """
lat, lon = lat_long
gh = geohash.encode(lat, lon, 9) gh = geohash.encode(lat, lon, 9)
words = "-".join(self.six_wordlist[p] for p in self.to_bytes(self.pad(gh))) words = "-".join(self.six_wordlist[p] for p in self.to_bytes(self.pad(gh)))
return words return words