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

feat/extract_yes_no #30

Merged
merged 12 commits into from Sep 11, 2022
Merged

feat/extract_yes_no #30

merged 12 commits into from Sep 11, 2022

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Sep 10, 2022

in core and skills we have this snippet of code over and over

if self.voc_match("yes"):
   ...
elif self.voc_match("no"):
   ...
else:
   ...

problem statement: given the answer to a yes/no question, did the user mean yes / no / neutral ?

this PR adds a new generic parse method

from lingua_franca.parse import yes_or_no

utterance = self.get_response("I heard you like cheese?")
answer = yes_or_no(utterance)
if answer is True:
    "indeed!"
elif answer is False:
    "thats a lie!"
else:
    "maybe...."

this formalizes it under LF to keep lang support centralized, the .voc files are replaced with a single .json file, supporting a new language only requires the addition of this file

initial yesno.json files have been automatically sourced by parsing mycroft/res/text

related mycroft issues/PRs:

new parse method, in core and skills we have this snippet of code over and over

```
if self.voc_match("yes"):
   ...
elif self.voc_match("no"):
   ...
else:
   ...
```

this formalizes it under LF to keep lang support centralized, the .voc files are replace with a single .json file, supporting a new language only requires the addition of this file

initial yesno.json files have been automatically sourced by parsing mycroft/res/text
@JarbasAl JarbasAl added the enhancement New feature or request label Sep 10, 2022
@codecov
Copy link

codecov bot commented Sep 10, 2022

Codecov Report

No coverage uploaded for pull request base (dev@392cc37). Click here to learn what that means.
The diff coverage is n/a.

@@          Coverage Diff          @@
##             dev     #30   +/-   ##
=====================================
  Coverage       ?   0.00%           
=====================================
  Files          ?      65           
  Lines          ?   16401           
  Branches       ?       0           
=====================================
  Hits           ?       0           
  Misses         ?   16401           
  Partials       ?       0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@JarbasAl JarbasAl merged commit 1697f6e into dev Sep 11, 2022
6 checks passed
@JarbasAl JarbasAl deleted the feat/extract_yes_no branch September 11, 2022 13:32
JarbasAl added a commit to OpenVoiceOS/ovos-core that referenced this pull request Oct 4, 2022
JarbasAl added a commit to OpenVoiceOS/ovos-core that referenced this pull request Oct 4, 2022
* feat/lf_ask_yeno

companion PR to OpenVoiceOS/ovos-lingua-franca#30

* update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant