cadnza / Chinese-Getter

Anki add-on to retrieve and fill metadata on Chinese vocabulary
https://ankiweb.net/shared/info/972150718
2 stars 0 forks source link

Information not loading #2

Open camerooncameroon opened 2 years ago

camerooncameroon commented 2 years ago

Hello! Thanks for awesome idea, I'm totally obsessed how to make it work )) Hanzi animations not loading, whatever I do. Can also bulk-mode adding information feature be added to the add-on? So that animations (pinyin etc) could be added to a whole deck?

cadnza commented 2 years ago

Hi @camerooncameroon, glad you like it! Here are a few answers:

  1. For the Hanzi animations, do you have an example of a term you're trying to add? You might have found an edge case, in which case I'll need to do a little debugging. In the meantime, feel free to give the readme a skim if you haven't yet.
  2. Regarding bulk adding, unfortunately the extension doesn't support it. 😔 You'll likely want an external tool for that—there's only so much that Anki extensions can do, especially from the card dialog where this particular extension works. Alternately, you might look into pre-made Chinese decks from the Anki community.*
  3. Adding pinyin to a whole deck would be wonderful, wouldn't it? I did something similar to add videos to my ASL deck, and I can tell you from that experience that this extension isn't your best option for that. Your best bet will probably be to map your fields in a spreadsheet and then export it as an Anki deck. That'll give you fine control over which animation file goes with which term. Beyond that, you'll have to get creative if you want them to map automatically. 🙂

* A little more on bulk adding cards: It should be a pretty straightforward process, especially if you're downloading a pre-made Chinese deck from Anki, but from personal experience, I'm not sure I recommend it. A good 75% of learning a new word for me takes place when I physically make the flashcard in Anki, and adding information in bulk cuts out that experience.

The guy who wrote Fluent Forever says something similar:

The card construction process is one of the most fun and satisfying ways to learn a language. Content in the knowledge that every detail will become a permanent memory, you become the architect of your own mind. What breed of dog will you think of when you wish to remember the word dog? Which examples will you choose to form your verb conjugations? What vocabulary is most useful for your own life?

Making these decisions forms an exciting part of the learning process and, ultimately, takes very little time. After getting used to your SRS, you can add new cards in a matter of seconds. For most nouns, you can simply type the word once, search for a picture on Google Images, and copy (or draw) it onto your card. This can take less than fifteen seconds. Imagery for more complicated ideas will, of course, take more time to identify—a process that itself gives you the connections you need to make a word your own.

I sincerely wish I could sell my personal flash card decks. If their usefulness were transferable, I'd make a lot of money and help a lot of people. Instead, I give them away for free on my website with the disclaimer that no one has successfully used them to learn a language. Of the few thousand people who have downloaded them, no one has tried to refute that claim, so I feel confident stating here that my personal decks are useless to anyone but myself. Use them at your own peril.

Do take that with a grain of salt, though. Everyone learns differently, and it could very well be that adding flashcards in bulk goes a long way toward helping you learn Chinese. If that's the case, the Anki community can be your best friend; there are a lot of pre-made Chinese decks out there, some of very high quality. And if you'd like to make your own in bulk, Wiktionary's Mandarin frequency lists wouldn't be a bad place to start (if Mandarin is what you're learning).

cadnza commented 2 years ago

TL;DR: Send me a word you're trying to get Hanzi for and I'll see if I can get it to work. 🙂

camerooncameroon commented 2 years ago

@cadnza Thanks for the helpful and detailed overview, I'm exploring Anki right now so your recommendations and advices would be essential for me.

TL;DR: Send me a word you're trying to get Hanzi for and I'll see if I can get it to work. 🙂

I've just tried to add new card '中', hit tab, nothing happened. Addon config are as follows:

{
    "Chinese animations field": "Diagram",
    "Chinese characters field": "Hanzi",
    "Chinese pinyin field": "Pinyin",
    "Chinese sound field": "Sound",
    "Chinese vocab note type": "Chinese (Advanced)",
    "Forvo API key": ""
}

All the other addons are disabled

UPD: tried again and something terrifying happened:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-11-06 00:01:42

Caught exception:
Traceback (most recent call last):
  File "aqt\webview.py", line 41, in cmd
  File "aqt\webview.py", line 142, in _onCmd
  File "aqt\webview.py", line 595, in _onBridgeCmd
  File "aqt\editor.py", line 380, in onBridgeCmd
  File "aqt\hooks_gen.py", line 2014, in __call__
  File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\972150718\__init__.py", line 219, in chineseGetter
    if(note._model["name"] == t_type):
  File "anki\_legacy.py", line 52, in __getattr__
AttributeError
cadnza commented 2 years ago

@camerooncameroon Thanks for the example and the output. It looks like the target note type in your config is set to Chinese (Advanced); can you confirm that your Chinese note type is called Chinese (Advanced), i.e. that the Chinese vocab note type value in your config matches the actual target note type?

camerooncameroon commented 2 years ago

@cadnza Yes, confirm that. Chinese (Advanced) is my mainly used note type, borrowed from Chinese Support Redux Add-on. BTW, for filling-in animations field take a look at https://github.com/nmarley/chinese-char-animations, it could be used for filling in the stroke order diagram instead of the MDBG site

camerooncameroon commented 2 years ago

@cadnza Was reviewing my addons and tried again to revive this addon (but it's not easy to crack this nut anyway). Downloaded and imported the Chinese - Vocab deck (so now the issue can't be a mistype in notetype's name in config), but got error again when opening the Add card dialog:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-01-03 03:25:43

Caught exception:
Traceback (most recent call last):
  File "aqt\webview.py", line 41, in cmd
  File "aqt\webview.py", line 142, in _onCmd
  File "aqt\webview.py", line 595, in _onBridgeCmd
  File "aqt\editor.py", line 380, in onBridgeCmd
  File "aqt\hooks_gen.py", line 2014, in __call__
  File "C:\Users\Asus\AppData\Roaming\Anki2\addons21\972150718\__init__.py", line 219, in chineseGetter
    if(note._model["name"] == t_type):
  File "anki\_legacy.py", line 52, in __getattr__
AttributeError

No data was loaded after entering the headword (hanzi) and hitting the tab key to unfocus - I think because of the error when loading the add card dialog. (I don't have Forvo api key so only animated chars were expected to load + pinyin)

cadnza commented 2 years ago

@camerooncameroon So sorry for the delay—to be honest, you caught me right as I was going into a pretty intense job training. We're not allowed access to phones, laptops, etc., and it goes until March; I'm on holiday break right now and going back in tomorrow.

Bottom line: I know this is weird, but I'll be totally unable to look at anything until March when the training ends. :-/ Once that happens, I'll get to it as soon as I can. Sorry!

guitargeekgreg commented 7 months ago

Did this ever get solved? I'm having a similar issue.

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.19044

Traceback (most recent call last): File "aqt.webview", line 50, in cmd File "aqt.webview", line 157, in _onCmd File "aqt.webview", line 686, in _onBridgeCmd File "aqt.editor", line 418, in onBridgeCmd File "_aqt.hooks", line 2542, in call File "C:\Users\gtoews\AppData\Roaming\Anki2\addons21\972150718__init__.py", line 219, in chineseGetter if(note._model["name"] == t_type): File "anki._legacy", line 80, in getattr AttributeError: 'Note' object has no attribute '_model'

===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Chinese Getter ['972150718', 2021-06-23T09:27, 'None', '']

===IDs of active AnkiWeb add-ons=== 972150718

===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed])