BTW while it is still work in progress (now mainly because the android UI isn't finished yet) https://github.com/simonpoole/OpeningHoursParser is a JavaCC based parser which attempts to implement the full spec, undoubtedly I've probably missed one or two special cases, but it is fairly complete.
It currently successfully parses 108'455 of 122'100 test strings (with some relaxation of rules) of those that fail 10'569 seem to be valid lexical errors and a large part of the remaining errors seem to have other issues. The test strings were extracted from the OSM database (nodes only). As you say the specification itself is overly complicated (the "optional" colon is not really a problem, except that it is not really clear where it is allowed, there is some further similar fuzziness wrt comments) and definitely shouldn't have more stuff added to it (with perhaps the exceptions of adding further variable dates and similar things). Simon Am 21.08.2015 um 12:36 schrieb Ruben Maes: > Friday 21 August 2015 11:48:49, [email protected]: >> Hello, >> >> I recently released a new version of YoHours, a website which allows >> everyone to create and view opening hours in the OSM syntax. It now >> supports seasons-dependent hours (month, week, day, holiday selectors). >> >> It's available here: >> http://github.pavie.info/yohours/ >> >> The code is available on GitHub: >> https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours >> [1] >> >> If you have any suggestions, let me know :) >> >> Cordially, >> >> PanierAvide. >> >> >> Links: >> ------ >> [1] >> https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours > I opened an issue[1] on this GitHub project, because it puts a colon after > week, month and monthday selectors. > PanierAvide replied that the specification allows an "optional separator for > readability"[2]. Indeed, when you read the overly complicated and totally not > mapper-focused specification, you can see > [ <year_selector> ] [ <month_or_monthday_selector> ] [ <week_selector> ] [ > <separator_for_readability> ] > > Whose idea was this? It's already complicated enough that you don't have to > add *optional* separators for supposed readability. > IMO it's just fine without them. > > PS: I always follow the time domains proposal[3]. It's clear and it's > compatible with the other specification AFAIK. > > [1] https://github.com/PanierAvide/panieravide.github.io/issues/1 > [2] > https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#separator_for_readability > [3] https://wiki.openstreetmap.org/wiki/Proposed_features/Time_domains > > > > _______________________________________________ > Tagging mailing list > [email protected] > https://lists.openstreetmap.org/listinfo/tagging
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Tagging mailing list [email protected] https://lists.openstreetmap.org/listinfo/tagging
