Skip to content

Parser chooses the incorrect tokens #1

@annorman

Description

@annorman

"12 kg something" breaks into 4 tokens, but it considers 1 to be a quantity and 2 to be a unit so it returns: #Munchie::Food:0x007fedc1b0dab8 @tokens=[text: 1 something, text: something]

Also for some reason kg returns grams, even though the token parser works correctly:
Munchie.parse("1 kg something")
=> #Munchie::Food:0x007fedc1b15920 @tokens=[1 (weight: 1 grams, metric), text: something]

Again, it has the correct tokens, just need to pull them out correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions