-
Notifications
You must be signed in to change notification settings - Fork 28
improve pronouns change (perspective) #48
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
base: 21.02
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,7 +194,7 @@ def date_str(self, d): | |
return self.translate('Tomorrow') | ||
else: | ||
return nice_date(d.date()) | ||
|
||
def change_pronouns(self, reminder): | ||
"""Change my / our into you / your, etc. | ||
|
||
|
@@ -204,12 +204,13 @@ def change_pronouns(self, reminder): | |
Arguments: | ||
reminder (str): reminder text | ||
""" | ||
my_regex = r'\b{}\b'.format(self.translate('My')) | ||
our_regex = r'\b{}\b'.format(self.translate('Our')) | ||
your_word = self.translate('Your') | ||
reminder = re.sub(my_regex, your_word, reminder) | ||
reminder = re.sub(our_regex, your_word, reminder) | ||
return reminder | ||
vocabulary = self.translate_namedvalues("Perspective") | ||
|
||
reminder = f" {reminder}" | ||
for k, v in vocabulary.items(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we try and use full variable names, just for readability and consistency. |
||
if f" {k} " in reminder: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the sentence is "remind me that i take my teeth out ouf my mouth". It would only change one. (Pretty rare, but consistent) - allthough that would make a heck of a sentence 🤣 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default I think
There is an optional parameter if you want to limit that to n instances:
So if I'm not mistaken, in this case we should only need to call that once. It is quite an interesting sentence too lol There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doh, that shouldn't happen. (the mistake) |
||
reminder = reminder.replace(f" {k} ", f" {v} ") | ||
return reminder.strip() | ||
|
||
@intent_handler('ReminderAt.intent') | ||
def add_new_reminder(self, msg=None): | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mein,dein | ||
meine,deine | ||
meinen,deinen | ||
meinem,deinem | ||
unser,euer | ||
unsere,euere | ||
unseren,eueren | ||
unserem,euerem |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
my,your | ||
our,your |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mi,tu | ||
nuestro,tu | ||
nuestra,tu |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
مال تو,برای من | ||
مال تو,مال ما |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mon,votre | ||
ma,votre | ||
nos,votre | ||
notre,votre |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mijn,uw | ||
onze,uw |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
мой,ваш | ||
наш,ваш |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
min,din | ||
vår,din |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the space at the end seems like a good change. Shouldn't happen in english unless the stt is cut off but could in some other language.