backend/feature/add-description #63

Merged
kscheidecker merged 13 commits from backend/feature/add-description into main 2025-02-21 07:38:17 +00:00
Showing only changes of commit 8a9ec6b4d8 - Show all commits

View File

@@ -312,10 +312,10 @@ class LandmarkManager:
if importance is None : if importance is None :
if len(tags.keys()) < 5 : if len(tags.keys()) < 5 :
return None, None return None, None
if len(tags.keys()) < 10 : elif len(tags.keys()) < 10 :
description = f"{name} is a well known {place_type}." description = f"{name} is a well known {place_type}."
if len(tags.keys()) < 17 : elif len(tags.keys()) < 17 :
importance = 'national' importance = 'national'
description = f"{name} is a {place_type} of national importance." description = f"{name} is a {place_type} of national importance."
else : else :
@@ -334,10 +334,10 @@ class LandmarkManager:
# Format the visitor number # Format the visitor number
if n_visitors is not None : if n_visitors is not None :
n_visitors = int(n_visitors) n_visitors = int(n_visitors)
if n_visitors > 1000 : if n_visitors < 1000000 :
description += f" {name} welcomes {int(n_visitors/1000)} thousand visitors every year." description += f" It welcomes {int(n_visitors/1000)} thousand visitors every year."
if n_visitors > 1000000 : else :
description += f" {name} welcomes {round(n_visitors/1000000, 1)} millionvisitors every year." description += f" It welcomes {round(n_visitors/1000000, 1)} million visitors every year."
# Set the keywords. # Set the keywords.
keywords = {"importance": importance, keywords = {"importance": importance,