Skip to content

Commit

Permalink
Fixed duplicates of name suffix and print if different names. #33
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMikita committed Sep 22, 2016
1 parent 7331f03 commit ee21c96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def prepareNameSuffix(results):

# Separate different country codes
for row in results:
for field in ['country_code', 'state', 'city']:
for field in counts.keys():
if row[field] in counts[field]:
continue
# Skip states for not-US
Expand All @@ -443,7 +443,7 @@ def prepareNameSuffix(results):
if not row['city']:
row = parseDisplayName(row)

if row['type'] != 'city' and len(row['city']) > 0 \
if row['type'] != 'city' and len(row['city']) > 0 and row['name'] != row['city'] \
and (len(counts['city']) > 1 or len(counts['name']) > 1):
name_suffix.append(row['city'])
if row['country_code'] == 'us' and len(counts['state']) > 1 and len(row['state']) > 0:
Expand Down

0 comments on commit ee21c96

Please sign in to comment.