Stypox / dicio-sentences-compiler

Sentences-compiler for Dicio assistant
GNU General Public License v3.0
11 stars 4 forks source link

Add support for multiple variations of the same word #7

Closed Stypox closed 2 years ago

Stypox commented 2 years ago

This PR implements support for word variations, using the syntax <|?>. For example, if one wanted a word that matches "mail", "email" and "gmail", they would write <e|g?>mail, which is far shorter than (but roughly equivalent to) the or-list mail|email|gmail (which is currently the only method supported). <> groups can appear anywhere in the word (at the beginning, at the end or in the middle), and there can even be multiple ones of them. The important thing to remember is not to insert spaces in between letters and < or >: for example o <n|ff> line would represent three words (equivalent to o n|ff line) instead of just one! The correct way to write it is without spaces, i.e. o<n|ff>line, which would be equivalent to online|offline.

Fixes #5 Fixes Stypox/dicio-android#27 Also see Stypox/dicio-android#26 and Stypox/dicio-android#36 This PR requires Stypox/dicio-skill#4

TODO: add an explanation to the README done