-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
8237455
to
7fac954
Compare
7fac954
to
8e20ccd
Compare
idunn/places/pj_poi.py
Outdated
@@ -535,3 +535,21 @@ def has_takeaway(self): | |||
for desc in self.data.business_descriptions | |||
for label in desc.values | |||
) | |||
|
|||
HOTEL_STARS_REGEX = re.compile(r"hôtel (?P<rating>\d) étoiles") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about hotels with just 1 star ?
HOTEL_STARS_REGEX = re.compile(r"hôtel (?P<rating>\d) étoiles") | |
HOTEL_STARS_REGEX = re.compile(r"hôtel (?P<rating>\d) étoiles?") |
for kind, stars in [ | ||
(StarsKind.LODGING, place.get_lodging_stars()), | ||
(StarsKind.RESTAURANT, place.get_restaurant_stars()), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help with the integration, perhaps we could keep only one of these ratings, depending on place.get_class_name()
?
Then the client could just append the number of stars with the title of the poi class/subclass, without any redundant implementation on both sides, or risk of confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I had in mind is that erdapfel would blindly display all items of the list, but maybe we risk displaying irrelevant data?
8367599
to
4a7e647
Compare
idunn/blocks/stars.py
Outdated
def check_class(self, subclass: Optional[str]) -> bool: | ||
return (self, subclass) in [ | ||
(self.LODGING, "lodging"), | ||
(self.RESTAURANT, "restaurant"), | ||
(self.RESTAURANT, "fast_food"), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subclass
should rather be named class_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just rewrote last commit as this is a very minor change.
4a7e647
to
b30744c
Compare
Add a new
stars
block which indicates if the POI is a starred restaurant or hotel and eventually gives its rating.The format looks like follows: