DSL::Entity::Foods

Grammars for food and drink entity names.

DSL::Entity::Foods

Raku grammar classes for food and drink entities (food and drink names.)

Remark: The food entity names in this package were taken from an archived GitHub repository related to IBM's Watson engine. I can no longer find that repository.

Installation

From Zef ecosystem:

zef install DSL::Entity::Foods

From GitHub:

zef install https://github.com/antononcube/Raku-DSL-Entity-Foods.git

Examples

use DSL::Entity::Foods;

say ToFoodEntityCode('banana split');
say ToFoodEntityCode('arizona ice tea');
say ToFoodEntityCode('high fructose corn syrup');
#ERROR: Possible misspelling of 'arizona iced tea' as 'arizona ice tea'.
# "WATSON_BananaSplit"
# "WATSON_ArizonaIcedTea"
# "WATSON_HighFructoseCornSyrup"

Grammar parsing

One of the main motivations for this package is to be able to use known country names and related adjectives as grammar tokens. For example, in packages like "DSL::English::FoodPreparationWorkflows", [AAp2].

Here are few grammar parsing examples:

use DSL::Entity::Foods::Grammar;

my $pCOMMAND = DSL::Entity::Foods::Grammar.new;
$pCOMMAND.set-resources(DSL::Entity::Foods::resource-access-object());

say $pCOMMAND.parse('arizona iced tea', rule => 'food-entity-command');
# ļ½¢arizona iced teaļ½£
#  entity-food-name => ļ½¢arizona iced teaļ½£
#   0 => ļ½¢arizona iced teaļ½£
#    entity-name-part => ļ½¢arizonaļ½£
#    entity-name-part => ļ½¢icedļ½£
#    entity-name-part => ļ½¢teaļ½£
say $pCOMMAND.parse('fried tomatoese', rule => 'food-entity-command');
#ERROR: Possible misspelling of 'fried tomatoes' as 'fried tomatoese'.
# ļ½¢fried tomatoeseļ½£
#  entity-food-name => ļ½¢fried tomatoeseļ½£
#   0 => ļ½¢fried tomatoeseļ½£
#    entity-name-part => ļ½¢friedļ½£
#    entity-name-part => ļ½¢tomatoeseļ½£

References

[AAp1] Anton Antonov, DSL::Shared Raku package, (2020), GitHub/antononcube.

[AAp2] Anton Antonov, DSL::English::FoodPreparationWorkflows Raku package, (2021), GitHub/antononcube.

[AAp3] Anton Antonov, DSL::Entity::Jobs Raku package, (2021), GitHub/antononcube.

DSL::Entity::Foods v0.1.0

Grammars for food and drink entity names.

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

DSL::Shared:ver<0.2.11+>

Test Dependencies

Provides

  • DSL::Entity::Foods
  • DSL::Entity::Foods::Actions::Bulgarian::Standard
  • DSL::Entity::Foods::Actions::Raku::System
  • DSL::Entity::Foods::Actions::WL::Entity
  • DSL::Entity::Foods::Actions::WL::System
  • DSL::Entity::Foods::Grammar
  • DSL::Entity::Foods::Grammar::EntityNames
  • DSL::Entity::Foods::ResourceAccess

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.