Skip to content

Fix USP menu parser dessert offsets and "c/" abbreviation splitting - #23

Merged
LeoColman merged 1 commit into
masterfrom
fix/usp-menu-parser-dessert-and-c-slash
Jun 30, 2026
Merged

Fix USP menu parser dessert offsets and "c/" abbreviation splitting#23
LeoColman merged 1 commit into
masterfrom
fix/usp-menu-parser-dessert-and-c-slash

Conversation

@LeoColman

Copy link
Copy Markdown
Member

Summary

  • quadrilateroParser (rest. 11/12), eachParser (rest. 13) and largoSaoFranciscoParser (rest. 14) picked the dessert at an off-by-one index, returning a salad/guarnição line instead of the actual Sobremesa.
  • cleanItems split the menu text on every /, which broke the c/ (com) abbreviation mid-phrase before cleanString could expand it (e.g. "Ervilha c/ creme de abobora" → "Ervilha c"). The expansion now happens before the split, and the now-dead post-split replace was removed.
  • MenuParsersTests rebuilt with real menus fetched directly from the USP RU API, with expectations set to the actual main/vegetarian/dessert items (not the previously buggy parser output).

Test plan

  • ./gradlew :restaurants:test --tests "app.jopiter.restaurants.repository.usp.MenuParsersTests" — all green
  • ./gradlew :restaurants:test — no new failures (2 pre-existing, unrelated failures confirmed via git stash to exist before this change, caused by restaurant 11 being closed for renovation on USP's side)

quadrilateroParser, eachParser and largoSaoFranciscoParser picked the
dessert by an off-by-one index, returning a salad/guarnição line
instead of the actual Sobremesa. Also, cleanItems split on every "/",
which broke the "c/" (com) abbreviation mid-phrase before cleanString
could expand it, truncating vegetarian/guarnição items.

MenuParsersTests now uses real menus fetched from the USP RU API.
@LeoColman
LeoColman merged commit 16c2a42 into master Jun 30, 2026
1 of 2 checks passed
@LeoColman
LeoColman deleted the fix/usp-menu-parser-dessert-and-c-slash branch June 30, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant