openculinary / knowledge-graph

The RecipeRadar knowledge graph stores and provides access to recipe and ingredient relationship information.
GNU Affero General Public License v3.0
10 stars 0 forks source link

Improve markup term consumption #33

Closed jayaddison closed 4 years ago

jayaddison commented 4 years ago

Describe the reason for these changes and the problem that they solve

Markup generation for ingredients with ngrams > 1 was incorrect.

Briefly summarize the changes

  1. During token stream generation, output an empty tuple as an end-of-stream marker
  2. During markup generation, track the number of expected tokens once a matching term is found
  3. Emit an opening tag when a matching ingredient term is found
  4. When the token stream is depleted or after sufficient tokens have been processed, closed the markup tag

How have the changes been tested?

  1. Unit tests are provided

List any issues that this change relates to Fixes #32