1. 05 Apr, 2021 2 commits
  2. 20 Mar, 2021 3 commits
    • David Faure's avatar
      The recent commit "generalize to comma" was about a simplification. · cf53d9f8
      David Faure authored
      => move that feature to simplifiedExpression. No reason to generate
      errors due to "Mo 12:00-15:00, Mo 18:00-24:00".
      But we can simplify this when we get a chance to modify it.
      cf53d9f8
    • David Faure's avatar
      Add simplifiedExpression() · 16292639
      David Faure authored
      This simplifies the expression if possible:
      - Mo 08:00-13:00; Tu 08:00-13:00
      + Mo,Tu 08:00-13:00
      
      Doing this inside normalizedExpression() would create many more Osmose
      errors than necessary. Better differenciate normalization (which helps
      detecting invalid input) and simplification (which is more about setting
      the best possible expression if we're modifying it anyway).
      
      This comes from the fact that I got comments on changesets where
      I was setting a non-simplified expression. It's all the same to
      computers, but humans find the simplified version more readable/logical.
      16292639
    • David Faure's avatar
      b96e0800
  3. 17 Mar, 2021 2 commits
    • David Faure's avatar
      363cd007
    • David Faure's avatar
      autocorrect wrong use of ';' where ',' was expected · 26569483
      David Faure authored
      We can detect the common case of
      - Mo-Sa 12:00-15:00; 18:00-24:00
      + Mo-Sa 12:00-15:00,18:00-24:00
      based on the fact that the second rule has no time selector.
      
      The JS evaluation_tool doesn't do this autocorrect though, and
      adds the two time ranges (as if "Mo-Sa 12:00-15:00, Mo-Su 18:00-24:00")
      rather than overwriting the first rule with the second as I thought would happen.
      
      It's still very unlikely that this is what the author meant though...
      
      Do the same in case of identical weekdays (and no other selector):
      - Mo-Sa 12:00-15:00; Mo-Sa 18:00-24:00
      + Mo-Sa 12:00-15:00,18:00-24:00
      26569483
  4. 14 Mar, 2021 1 commit
    • Volker Krause's avatar
      Don't do error recovery between two wrongly ordered wide range selectors · e98ae54b
      Volker Krause authored
      We end up in this path e.g. for wrong date formats, and since all parts
      are technically valid, error recovery tried to piece something together
      out of those. The current check for things being in the right order is
      far from complete, but we can extend that as needed, we aren't accepting
      more input than before due to this.
      e98ae54b
  5. 25 Jan, 2021 1 commit
  6. 23 Jan, 2021 1 commit
  7. 20 Jan, 2021 1 commit
  8. 14 Jan, 2021 1 commit
  9. 09 Jan, 2021 1 commit
    • David Faure's avatar
      Generalize the weekday autocorrect · 94b631dc
      David Faure authored
      Sep 16-Jun 15: Tu-Fr, Sa, Su [1,3] 09:00-14:00
      was normalized as
      Sep 16-Jun 15: Tu-Fr, Sa,Su[1,3] 09:00-14:00
      with a missing weekday autocorrects: the space before the first "Sa".
      This is because the monthday selector was preventing the first two rules
      from being collapsed together.
      
      This commit generalizes the weekday autocorrect to accept any additional
      selector in the first rule, except of course a time selector.
      It adds made-up testcases for the other cases of selectors in the first
      rule (a year range, a week range).
      I also grouped together all testcases that are mostly about the weekday
      autocorrect.
      94b631dc
  10. 07 Jan, 2021 1 commit
    • David Faure's avatar
      Fix autocorrect for multiple months separated with commas · fa83dab7
      David Faure authored
      The added testcase used to become
      Apr,May,Oct,Nov, Dec: Mo-Su, 10:00-19:00; Jun-Sep: Mo-Su 10:00-20:00
      with an erroneous space before "Dec".
      
      I don't claim full understanding of the autocorrect() code, this is
      just the result of reverse-engineering which part of the condition
      was wrong, removing it, and noticing that other tests still pass :)
      fa83dab7
  11. 04 Jan, 2021 1 commit
  12. 01 Jan, 2021 2 commits
  13. 29 Dec, 2020 1 commit
  14. 26 Dec, 2020 2 commits
  15. 22 Dec, 2020 1 commit
  16. 16 Dec, 2020 1 commit
  17. 15 Dec, 2020 2 commits
  18. 14 Dec, 2020 1 commit
    • Volker Krause's avatar
      Add the ability to resume parsing after a syntax error · 72cce9ba
      Volker Krause authored
      We use this to support wrong additional rule separation. Trying to model
      this case in the grammar would introduce so many ambiguities that even GLR
      parsing isn't able to handle that anymore. Instead we now take what we
      parsed so far, and continue fresh from after the wrong comma.
      
      The same approach should be applicable for the also very common case of
      rule separators missing entirely (it technically works, but is a bit too
      lenient still).
      
      This results in about 3k additional expressions from the full OSM corpus
      to now get accepted.
      72cce9ba
  19. 13 Dec, 2020 2 commits
  20. 08 Dec, 2020 2 commits
  21. 07 Dec, 2020 4 commits
  22. 06 Dec, 2020 2 commits
    • Volker Krause's avatar
      Explicitly handle implicitly defined states · a1a7521e
      Volker Krause authored and David Faure's avatar David Faure committed
      This fixes evaluation issues for wrongly assumed implicitly defined states,
      but also a number of normalization tests.
      a1a7521e
    • Volker Krause's avatar
      Rework fallback rule handling · c93f41a3
      Volker Krause authored and David Faure's avatar David Faure committed
      The previous approach made the wrong assumption that there is only one
      global fallback rule, and that this always has a 24/7 time selector.
      Reality is different, fallback rules can have selectors and can occur
      multiple times.
      c93f41a3
  23. 05 Dec, 2020 4 commits
  24. 04 Dec, 2020 1 commit
    • Volker Krause's avatar
      Allow to reuse an OpeningHours object · dddb8e0b
      Volker Krause authored
      This is relevant for mass validation. Cuts down processing the full OSM
      corpus by 50% to about two seconds, about half of which is spend on
      loading the input file even.
      dddb8e0b