Skip to content

Commit

Permalink
updated cities.json to only use synonyms that match with a ratio of 70
Browse files Browse the repository at this point in the history
  • Loading branch information
iwpnd committed Feb 15, 2020
1 parent ce4515b commit 6ebe80f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ __pycache__/
flash-geotext.code-workspace
*.ipynb
scripts/
.DS_Store


# C extensions
*.so
Expand Down
14 changes: 9 additions & 5 deletions flashgeotext/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ def _load_data_list(self, file: str = "") -> list:
return list(json.loads(f.read()).keys())


class Extractor(object):
cities: KeywordProcessor = KeywordProcessor
countries: KeywordProcessor = KeywordProcessor
class Extractor:
cities: KeywordProcessor = KeywordProcessor(case_sensitive=True)
countries: KeywordProcessor = KeywordProcessor(case_sensitive=True)

def __init__(self):
pass
def __init__(self, demo_data: bool = False):

if demo_data:
demodata = DemoData()
self.cities.add_keywords_from_dict(keyword_dict=demodata.cities)
self.countries.add_keywords_from_dict(keyword_dict=demodata.countries)
2 changes: 1 addition & 1 deletion flashgeotext/resources/cities.json

Large diffs are not rendered by default.

0 comments on commit 6ebe80f

Please sign in to comment.