Rascalov / Anki-Simple-Forvo-Audio

Simple anki 2.1+ addon to get forvo audio into your cards for free. No Forvo account needed
https://ankiweb.net/shared/info/560814150
GNU General Public License v3.0
33 stars 3 forks source link

Match text to language typed in / possible preferences of languages to search from #18

Closed ONEsuzuki closed 1 year ago

ONEsuzuki commented 1 year ago

Possible enhancement? Forvo matches text in search and gives results based on language used, would it be possible to do something similar or tell it what deck is what language, so that I never have to select the language manually.

Rascalov commented 1 year ago

Welcome to the repo! If I understand you correctly, depending on the deck you want to add flashcards to, the target language used to search would be different? image I currently only set the default target language to the one that was last used. I can see why your suggestion would be useful for people that learn multiple languages.

However, doing this would require a unique property on the deck that the Forvo addon would be able to identify and link to a language. Maybe a language code inside the deck's name (e.g.: "[ru]MyDeck"). Currently I don't use or interact with the deck in this function, so I would need some time to figure the best way to do so. The downside of this approach, is that it would require users to edit the names of their decks to contain or (preferably) start with a language code.

Let me know your thoughts on this.

ONEsuzuki commented 1 year ago

Yes you are correct (reference to image) but could you rather than change the deck name place it in the deck description; the deck description is mainly used for decks uploaded to the anki web anyways so, If it were possible I feel as though this would be better. I don’t know much about code so I look forward to hearing back from you. Just a shame that you can’t tag anki decks themselves with a specific code in anki it would make something like this much easier. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 05 June 2023 17:51 To: @.> Cc: @.>; @.> Subject: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

Welcome to the repo! If I understand you correctly, depending on the deck you want to add flashcards to, the target language used to search would be different? [image]https://user-images.githubusercontent.com/31393063/243417636-049c12f1-b502-4cef-8b17-d7f25961ed8f.png I currently only set the default target language to the one that was last used. I can see why this would be useful for people that learn multiple languages.

However, doing this would require a unique property on the deck that the Forvo addon would be able to identify and link to a language. Maybe a language code inside the deck's name (e.g.: "[ru]MyDeck"). Currently I don't use or interact with the deck in this function, so I would need some time to figure the best way to do so. The downside of this approach, is that it would require users to edit the names of their decks to contain or (preferably) start with a language code.

Let me know your thoughts on this.

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1577141185, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT3YQNXSBNC5BSLVBYILXJYFBXANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>

Rascalov commented 1 year ago

Interesting, I did not know a deck description existed, thanks for the heads up. From that, I can kinda imagine the flow:

  1. Get the current deck you're adding cards to
  2. if the description has a language code in brackets, it will select the associated language 2a. if not, after the first audio insertion, add the target language's language code to the description if the same language code is not already present in the description.

Should not be too hard if I can access the deck from the audio search menu, I might push an update for it today. Let me know if I missed anything in the flow

ONEsuzuki commented 1 year ago

Sounds great didn’t think about adding language code automatically; I’m not really familiar with flow but it seems to look good. Look forward to an update.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 05 June 2023 20:07 To: @.> Cc: @.>; @.> Subject: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

Interesting, I did not know a deck description existed, thanks for the heads up. From that, I can kinda imagine the flow:

  1. Get the current deck you're adding cards to
  2. if the description has a language code in brackets, it will select the associated language 2a. if not, after the first audio insertion, add the target language's language code to the description if the same language code is not already present in the description.

Should not be too hard if I can access the deck from the audio search menu, I might push an update for it today. Let me know if I missed anything in the flow

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1577325113, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT3YW4DZCAOTJLJLGPDLXJYU6PANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>

Rascalov commented 1 year ago

It is done, I have added a setting as shown below that will set the language code in the description of the deck you add cards to. If you have added an audio, it tags your deck with the language you chose while adding that audio. Let me know if it works as you imagined. You can update the extension by getting the addon code on the site or cloning the repository to your addon directory.

image

ONEsuzuki commented 1 year ago

Definitely be using this tomorrow, looking forward to it !

Galaxyから送信

-------- 元のメッセージ -------- 送信元: Tim @.> 日時: 2023/06/05 21:24 (GMT+00:00) 宛先: Rascalov/Anki-Simple-Forvo-Audio @.> Cc: 鈴木 @.>, Author @.> 件名: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

It is done, I have added a setting as shown below that will set the language code in the description of the deck you add cards to. If you have added an audio, it tags your deck with the language you chose while adding that audio. Let me know if it works as to your liking. You can update the extension by getting the addon code on the sitehttps://ankiweb.net/shared/info/560814150 or cloning the repository to your addon directory.

[image]

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1577425285, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT34252SVBUC7XPOYNFDXJY567ANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>

Rascalov commented 1 year ago

Very good, let me know if it works as intended for you, after confirmation I can close this issue as resolved

ONEsuzuki commented 1 year ago

Added the settings as you said:

{

"LastSelectedField": "Back",

"LastSelectedLanguage": "Korean_ko",

"MaxForvoDownloads": 100,

"Remember language on a per deck basis": "True",

"audioFileExtension": "mp3",

"downloadPath": "C:\Users\ekrug\AppData\Roaming\Anki2\鈴木\collection.media",

"ignorePunctuation": "True" } @. It works and edits the description on a single deck, but when I used it on the Korean deck it just added the Korean language code to the Japanese deck. @. Japanese deck description @.*** Korean deck description I hope this is an easy fix because it seems to look very promising; Just wondering why you need to remember last deck used though if It remembers it better this way ? Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 05 June 2023 22:30 To: @.> Cc: @.>; @.> Subject: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

Very good, let me know if it works as intended for you, after confirmation I can close this issue as resolved

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1577503402, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT3ZT4ZY2JAEFF33J33LXJZFWLANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>

Rascalov commented 1 year ago

Does this happen when you edit cards in the browse menu? Could be that the current deck is not correctly selected in that menu. I will have to fix that in any case

Rascalov commented 1 year ago

I pushed out an update for editing the card in the browse window, I think this caused issues as it would update the last deck you added cards to, and the Browse editor does it on a card by card basis.

Please update your Anki and check if the issue is resolved

ONEsuzuki commented 1 year ago

I have updated the addon, it works really well. But I removed the Japanese language code from the deck’s description just to see if it would put it back in; however the language code didn’t re-appear when I added a word’s audio using the addon, wondering if this is intentional? And just thinking about this working with sub-decks? Don’t know how you would go about this but wondering what you’re thoughts might be since they don’t appear to have a description of any-kind. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 06 June 2023 16:37 To: @.> Cc: @.>; @.> Subject: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

I pushed out an update for editing the card in the browse window, I think this caused issues as it would update the last deck you added cards to, and the Browse editor does it on a card by card basis.

Please update your Anki and check if the issue is resolved

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1579000998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT353STCVB6SZDG76HMDXJ5FBXANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>

ONEsuzuki commented 1 year ago

More just thinking about this for languages with multiple dialects, then you wouldn't have to switch it by hand in the menu.

Rascalov commented 1 year ago

I haven't been able to reproduce the issue of the language code not reappearing after removal. As for sub-decks, they do have their own description. Anki does not count a sub-deck as something other than a regular deck. It's merely used as a way of sorting and ordering decks. From my tests, it works as intended for sub-decks.

Languages with multiple dialects seems too much like a niche of a niche for what I intended to build. This would require additional unique properties that go further than language codes while also allowing for searches tailored towards specific dialects using the Forvo scraper.

For now I am closing this issue as resolved! If you have any further suggestions or issues that persist, you may create another issue and I'll be sure to respond.

ONEsuzuki commented 1 year ago

Thank you very much for you’re contributions, it is greatly appreciate.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 09 June 2023 01:26 To: @.> Cc: @.>; @.> Subject: Re: [Rascalov/Anki-Simple-Forvo-Audio] Match text to language typed in / possible preferences of languages to search from (Issue #18)

I haven't been able to reproduce the issue of the language code not reappearing after removal. As for sub-decks, they do have their own description. Anki does not count a sub-deck as something other than a regular deck. It's merely used as a way of sorting and ordering decks. From my tests, it works as intended for sub-decks.

Languages with multiple dialects seems too much like a niche of a niche for what I intended to build. This would require additional unique properties that go further than language codes while also allowing for searches tailored towards specific dialects using the Forvo scraper.

For now I am closing this issue as resolved! If you have any further suggestions or issues that persist, you may create another issue and I'll be sure to respond.

— Reply to this email directly, view it on GitHubhttps://github.com/Rascalov/Anki-Simple-Forvo-Audio/issues/18#issuecomment-1583663846, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2QBT34ACJIBFBB24YT2ZKDXKJUUFANCNFSM6AAAAAAY3GEC5E. You are receiving this because you authored the thread.Message ID: @.***>