MycroftAI / skill-reminder

Mycroft AI official Reminder Skill - set reminders
https://mycroft.ai/skills
Apache License 2.0
14 stars 28 forks source link

improve pronouns change (perspective) #48

Open emphasize opened 2 years ago

emphasize commented 2 years ago

... by leveraging the skills translate_namedvalues to be able to fine grain the vocabulary changed

Problem

The method used limits the possibilities in several ways:

Thus i think that using translate_namedvalues is the better approach to change the pronouns. The reminder is iterated over and changed as the vocabulary is found.

This also reverts changes made introducing My.dialog, Our.dialog and Your.dialog replacing those with a single Perspective.value containing the vocabulary pairs. (all available langs)

CLA

👍

Tested

👍

emphasize commented 2 years ago

actually -while rarely occuring- a while loop would be better

for k, v in vocabulary.items():
    while f" {k} " in utterance:
        utterance = utterance.replace(f" {k} ", f" {v} ")

and probably reminder = f" {reminder} "