Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle **ingredient** #11

Open
wvengen opened this issue Sep 27, 2018 · 4 comments
Open

Handle **ingredient** #11

wvengen opened this issue Sep 27, 2018 · 4 comments
Labels
bug:parsing Something is not parsed or parsed incorrectly parser:loose Affects the loose parser parser:strict Affects the strict parser

Comments

@wvengen
Copy link
Member

wvengen commented Sep 27, 2018

Sometimes ingredients are surrounded by double asterisks, this is probably marking of an allergen (see also #4). The strict parser doesn't currently handle this (or recognizes it as the start of notes), and the loose parser recognizes the first ** as mark and includes the second ** in the resulting name.

This happens in 0.15% of the ingredient lists.

@wvengen wvengen added parser:loose Affects the loose parser parser:strict Affects the strict parser labels Sep 27, 2018
@wvengen
Copy link
Member Author

wvengen commented Sep 27, 2018

For examples, run grep '\*\*\w[^,;.:()]*\w\*\*' data/ingredient-samples-nl.

@wvengen wvengen added the bug:parsing Something is not parsed or parsed incorrectly label Sep 27, 2018
@wvengen
Copy link
Member Author

wvengen commented Nov 12, 2019

It would be a good idea to add allergen-detection with this (#4).

@wvengen
Copy link
Member Author

wvengen commented May 31, 2024

I've only observed it around a word, or mid-word, e.g.

  • **melk**
  • **melkeiwitpoeder**
  • **mosterd**-dille
  • **soja**saus
  • **schapen**- en **geitenmelk**

@wvengen
Copy link
Member Author

wvengen commented May 31, 2024

One idea would be to strip such occurences, and add the text within the double asterisks as allergens of the ingredient.
Though **schapen**- en **geitenmelk** is actually ambivalent: does it contain sheep and goat-milk, or does it contain sheep-milk and goat-milk? (I guess the latter, but this can only be known by taking into account domain knowledge and context, so not something for a parser.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:parsing Something is not parsed or parsed incorrectly parser:loose Affects the loose parser parser:strict Affects the strict parser
Projects
None yet
Development

No branches or pull requests

1 participant