AwesomeTTS / awesometts-anki-addon

AwesomeTTS text-to-speech add-on for Anki
GNU General Public License v3.0
482 stars 100 forks source link

Stripping parentheticals no longer working in latest update. #135

Closed brownbat closed 4 years ago

brownbat commented 4 years ago

Great work on this add on, still impressed with the massive undertaking. It's pretty essential to all my language learning.

Possible bug in the latest update, per the title. I switched to the new tts tag format on cards using ATTS's "Add TTS..." button. I specified all the options, including associating my preexisting group of multiple Google Wavenet languages with Chinese.

Then separately confirmed in the ATTS options I still had all checkboxes checked for ignoring information in parens and brackets.

When a card comes up with parentheses, expected it to skip anything between those.

It reads the full field though.

I'm on the latest, 2.1.35, Win 10.

(Pretty sure it was working as expected just before this update.)

Also, very minor, but in the dropdown Tag Options > Language field, you're missing a closing parenthesis for "Chinese (Taiwanese Mandarin".

Thanks for all your work on this one!

luc-vocab commented 4 years ago

I will look into this. A couple of questions for you:

The aim of the latest release is to have more consistent on-the-fly TTS support across platforms (i.e. work similarly across Anki Desktop with AwesomeTTS, Anki Desktop without AwesomeTTS, AnkiMobile for iOS, and eventually AnkiDroid). If AwesomeTTS strips text within parentheses, this is not a behavior which you'll also get on the mobile apps. That said for consistency I will try to find a way to add this back in.

luc-vocab commented 4 years ago

Ok I think I know how to fix, it will be in AwesomeTTS 1.25, if you can't wait, please overwrite your ttsplayer.py with the latest version: https://github.com/AwesomeTTS/awesometts-anki-addon/blob/master/awesometts/ttsplayer.py

brownbat commented 4 years ago

You have already fixed, so this is late, sorry! I don't use mobile or cloze. No bulk generation either (large decks + several voices in a group, so would mean more calls to the cloud and HDD space).

The aim of the latest release is to have more consistent on-the-fly TTS support across platforms

That's a great thing to push for, should make everything easier for devs and users in the long run.

My main use case was making a quick note about alternate forms of words in sentences, without disrupting the flow of the TTS, and without having to separate out every possible version into a separate field or card. It was easier to add some parentheses for a mental note than split up every alternate permutation.

Ok I think I know how to fix

Thank you!

I know it pushes against the goal of consistency, but this gives ATTS a ton of power, lets me make cards much more flexibly, so I hope it will be worth it to support.

Another approach might be a helper function that created TTS fields. Create a brand new field in a deck using a regex from an existing field.

Then I could: 1) Create a new "TTS" field from my main question field. The regex could strip off anything in parens or brackets or special characters that I don't like. 2) ATTS can just read that new simple TTS field, rather than my main question field with all its quirks. It would read the same thing on mobile or desktop or wherever, and wouldn't have to stop to adjust a field before reading it.

TTS field would be explicit, and ATTS would easily behave in a consistent way with those decks across all platforms.

The ugly part of this is that decks would be really messy. And it would create a ton of redundant fields. 9/10 times you just want to read the question field without any edits.

So I do think your current approach is better. But this is just another option to think about.

Thanks for fixing this! Really appreciate it!

luc-vocab commented 4 years ago

So is the current fix acceptable for you ? In that case you don't need to do anything, the fix will be in 1.25.

Just wanted to share a few thoughts on some things you mentioned:

My main use case was making a quick note about alternate forms of words in sentences, without disrupting the flow of the TTS, and without having to separate out every possible version into a separate field or card. It was easier to add some parentheses for a mental note than split up every alternate permutation.

My understanding is that you have a "word" or "sentence" field that you want pronounced, and you also have some "notes" or "context" information. And you've combined those into a field like this: "word (notes)". I expect most experienced anki users also need to write down such notes or context particularly for challenging cards. In my case, I have a separate "Notes", and "Examples" fields which appear on the back of the card template. Putting them on a separate field gives me more flexibility for example for audio, or if I want to reverse the card. It also allows me to have the card template display the "notes" or "example" field with a smaller font, and a more subdued color like grey. All of this is only possible if you separated the information out into a separate field.

If you're OK with bugfix, could I ask you for a review on the addon page ? https://ankiweb.net/shared/info/1436550454

luc-vocab commented 4 years ago

I just released AwesomeTTS 1.25 which includes the above fix.

brownbat commented 4 years ago

Bugfix works great, thank you.

I definitely use a separate Notes field for comments, but this is somewhat different.

A toy example, for language learning:

The boy (/kid/youth) rode his bicycle (/bike).

Another case is conversations.

(Person A) Some question? (Person B) A reply!

There are workarounds. I could put the extended sentence with alternate forms in a note field, but then I won't see it as prominently when I study. I could just use hyphens for the different speakers in a snippet of conversation, but would be hard to distinguish them if it's more than a few lines.

could I ask you for a review

Oh, I gave thumbs up already, you're doing some of the most impressive work in the add-on space. As the author of a (much much tinier) add on myself, this project is just inspiring.