Fix USP menu parser dessert offsets and "c/" abbreviation splitting - #23
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
quadrilateroParser(rest. 11/12),eachParser(rest. 13) andlargoSaoFranciscoParser(rest. 14) picked the dessert at an off-by-one index, returning a salad/guarnição line instead of the actual Sobremesa.cleanItemssplit the menu text on every/, which broke thec/(com) abbreviation mid-phrase beforecleanStringcould 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.MenuParsersTestsrebuilt 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 viagit stashto exist before this change, caused by restaurant 11 being closed for renovation on USP's side)