m-rtin / anki-ipa

Anki add-on to insert IPA transcriptions
https://ankiweb.net/shared/info/799647424
GNU Affero General Public License v3.0
21 stars 12 forks source link

Error in ENG IPA #35

Closed tangor86 closed 2 years ago

tangor86 commented 2 years ago

Hello

I have error:

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-04-30 14:28:34

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 "decorator.py", line 232, in fun
  File "anki\hooks.py", line 89, in decorator_wrapper
  File "anki\hooks.py", line 86, in repl
  File "C:\Users\EUGENY\AppData\Roaming\Anki2\addons21\799647424\main.py", line 183, in on_bridge_cmd
    _old(editor, command)
  File "aqt\editor.py", line 438, in onBridgeCmd
  File "C:\Users\EUGENY\AppData\Roaming\Anki2\addons21\799647424\main.py", line 80, in paste_ipa
    editor.web.eval("focusField(%d);" % editor.currentField)
TypeError: %d format: a number is required, not NoneType

Although the IPA field is updated

image

But the phonetics themselves a bit weird, I was expecting simply: [ˈʧɑːkəʊl] but maybe it should be like this...

m-rtin commented 2 years ago

Thanks for your feedback. Both issues should be solved now. Your example for British English:

image
tangor86 commented 2 years ago

it now works if "eng_a" is selected... if "eng" I have error ➟ (but thanks for the fix!)

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 to the add-on author.
Debug info:
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 5.15.2 PyQt 5.15.5
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-08-06 13:34:21

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 42, in cmd
  File "aqt.webview", line 149, in _onCmd
  File "aqt.webview", line 624, in _onBridgeCmd
  File "decorator", line 232, in fun
  File "anki.hooks", line 89, in decorator_wrapper
  File "anki.hooks", line 86, in repl
  File "C:\Users\EUGENY\AppData\Roaming\Anki2\addons21\799647424\__init__.py", line 178, in on_bridge_cmd
    _old(editor, command)
  File "aqt.editor", line 467, in onBridgeCmd
  File "C:\Users\EUGENY\AppData\Roaming\Anki2\addons21\799647424\__init__.py", line 60, in paste_ipa
    ipa = parse_ipa_transcription.transcript(words=words, language=lang_alias)
  File "C:\Users\EUGENY\AppData\Roaming\Anki2\addons21\799647424\parse_ipa_transcription.py", line 151, in transcript
    transcription_method = transcription_methods[language]
KeyError: ''