Coder Social home page Coder Social logo

m-rtin / anki-ipa Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 12.0 4.28 MB

Anki add-on to insert IPA transcriptions

Home Page: https://ankiweb.net/shared/info/799647424

License: GNU Affero General Public License v3.0

Python 100.00%
first-timers-friendly anki

anki-ipa's Introduction

Anki IPA


Allows you to insert IPA transcriptions into the spaced-repetition flashcard app Anki.

Installation

The easiest way to install Anki IPA is through AnkiWeb.

Testing

To test the addon in Anki, navigate to Tools/Add-ons and press on the "View Files" button. The addons21 directory should open up in your file explorer. Copy your local anki-ipa/src/anki_ipa/ folder into this directory and restart Anki. You are now able to test the addon.

To run the unittests of this project, go to the anki-ipa/src/anki_ipa directory and run:

python3 -m test_parse_ipa_transcription

Contributing

New languages can be added the parse_ipa_transcription.py file. The changes should be tested in the test_parse_ipa_transcription.py file.

License and Credits

Anki IPA is based on Syntax Highlighting for Code and Batch Editing by Glutanimate.

Anki IPA is free and open-source software. The add-on code that runs within Anki is released under the GNU AGPLv3 license, extended by a number of additional terms. For more information please see the LICENSE file that accompanied this program.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

anki-ipa's People

Contributors

corderop avatar ebuart avatar jatubio avatar leidiflores avatar m-rtin avatar syntheticgio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

anki-ipa's Issues

It doesn't work with Uppercase - (again)

Hi bro,
Last year version you already fix this issue. But I just re-install my OS & it update to lastest add-on version that doesn't work with uppercase words. Can you check it again? (#18)

Crashing on 'ger' IPA

as in the title. Logs below. Let me know if you need anything else?

Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-11-16 20:27:12

--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python38\lib\encodings\cp1250.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u02c8' in position 82: character maps to <undefined>
Call stack:
  File "runanki", line 4, in <module>
  File "aqt\__init__.py", line 400, in run
  File "aqt\__init__.py", line 570, in _run
  File "aqt\webview.py", line 37, in cmd
  File "aqt\webview.py", line 123, in _onCmd
  File "aqt\webview.py", line 547, in _onBridgeCmd
  File "<C:\Users\Darek\Documents\Anki\decorator.pyc:decorator-gen-20>", line 2, in onBridgeCmd
  File "anki\hooks.py", line 638, in decorator_wrapper
  File "anki\hooks.py", line 635, in repl
  File "C:\Users\Darek\AppData\Roaming\Anki2\addons21\799647424\main.py", line 183, in on_bridge_cmd
    _old(editor, command)
  File "<C:\Users\Darek\Documents\Anki\decorator.pyc:decorator-gen-18>", line 2, in onBridgeCmd
  File "anki\hooks.py", line 638, in decorator_wrapper
  File "anki\hooks.py", line 635, in repl
  File "C:\Users\Darek\AppData\Roaming\Anki2\addons21\516643804\main.py", line 135, in onBridge
    return _old(self, str)
  File "aqt\editor.py", line 418, in onBridgeCmd
  File "C:\Users\Darek\AppData\Roaming\Anki2\addons21\799647424\main.py", line 68, in paste_ipa
    logging.debug(f"IPA transcription string: {ipa}")
  File "logging\__init__.py", line 2077, in debug
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: 'IPA transcription string: ˈmɪtˌlaɪ̯dn̩'
Arguments: ()

Ram usage is excessive

I was creating IPA field for 3k cards via this addon and I realized that ram usage is going up as the addon progresses. At %40 ram usage was at 5 GB and climbing.

Half of IPA

When I press the button of Anki IPA the add on shows only half of the IPA. If I write the word horse for example it shows only rs/.

Problem

Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-13.5.1-arm64-arm-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-12 14:31:50
アドオンが関連している可能性があります:⁨Anki IPA⁩

Caught exception:
Traceback (most recent call last):
File "aqt.webview", line 46, in cmd
File "aqt.webview", line 153, in _onCmd
File "aqt.webview", line 662, in _onBridgeCmd
File "decorator", line 232, in fun
File "anki.hooks", line 89, in decorator_wrapper
File "anki.hooks", line 86, in repl
File "/Users/sa/Library/Application Support/Anki2/addons21/799647424/init.py", line 186, in on_bridge_cmd
_old(editor, command)
File "aqt.editor", line 474, in onBridgeCmd
File "/Users/sa/Library/Application Support/Anki2/addons21/799647424/init.py", line 60, in paste_ipa
ipa = parse_ipa_transcription.transcript(words=words, language=lang_alias, strip_syllable_separator=CONFIG["STRIP_SYLLABLE_SEPARATOR"])
File "/Users/sa/Library/Application Support/Anki2/addons21/799647424/parse_ipa_transcription.py", line 145, in transcript
transcription_method = transcription_methods[language]
KeyError: ''

It doesn't work with Uppercase

Hi bro,
First of all, thank you very much for the add-on, It's very useful and work well. But recently I've got an Anki deck with all the letters is uppercase and your add-on didn't work with them. I wonder if you could help me to solve it?

Type object 'Qt' has no attribute 'Horizontal'

HI,
Thank you very much for your work.
When I clic on Edit - Add IPA an error Occur :

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, repeat 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-ons section of our support site.
Debug info:
Anki 23.10 (51a10f09) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.1.1-arm64-arm-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-12-31 13:31:02
Add-ons possibly involved: ⁨Anki IPA⁩

Caught exception:
Traceback (most recent call last):
File "/Users/USER/Library/Application Support/Anki2/addons21/799647424/batch_adding.py", line 251, in
a.triggered.connect(lambda _, b=browser: on_batch_edit(b))
File "/Users/USER/Library/Application Support/Anki2/addons21/799647424/batch_adding.py", line 237, in on_batch_edit
dialog = AddIpaTranscriptDialog(browser, selected_notes)
File "/Users/USER/Library/Application Support/Anki2/addons21/799647424/batch_adding.py", line 37, in init
self._setup_buttons()
File "/Users/USER/Library/Application Support/Anki2/addons21/799647424/batch_adding.py", line 83, in _setup_buttons
button_box = qt.QDialogButtonBox(qt.Qt.Horizontal, self)
AttributeError: type object 'Qt' has no attribute 'Horizontal'

Thank you.

Error when selecting 'eng' variant

Describe the bug
When selecting 'eng' or hitting 'play' button with 'eng' selected in add note window, the error appears.

`
Error
Debug info:
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-08-04 09:35:06

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\rydaev\AppData\Roaming\Anki2\addons21\799647424_init
.py", line 182, in on_bridge_cmd
on_ipa_language_select(editor, lang)
File "C:\Users\rydaev\AppData\Roaming\Anki2\addons21\799647424_init
.py", line 155, in on_ipa_language_select
alias = consts.LANGUAGES_MAP[lang]
KeyError: 'eng'

`

Question: Would that be possible to have multiple IPA fields?

I have some decks involving fields:

  • Front: a sentence in German
  • Back: a sentence in Portuguese
  • Add Reverse: "yes"

I would like to have two IPA fields, one for Front and another for Back.

Then I've created a new card type as below:

  • Front: a sentence in German
  • Back: a sentence in Portuguese
  • Add Reverse: "yes"
  • FrontIPA: IPA transcript for Front
  • BackIPA: IPA transcript for Back

Then I've tried Edit > Add IPA...

Language: german
Field of word: Front
Field of IPA transcription: FrontIPA
[Add]

When I click on the musical note for obtaining the IPA translation, the plugin complains that "IPA not found" was not found.
Looks like the plugin is considering the default configuration, instead of obeying my last command.

OK. Let's try then to configure the plugin.

I've configured then saying that the word field is "Front" and the IPA field is "FrontIPA".
After a restart I've tried again, but without any progress: the transcription fails saying "IPA not found".

Any clues?
What I'm doing wrong?

Would that be possible to have multiple IPA fields?

Thanks

Error Anki IPA

After install Anki IPA. When I restarted Anki,
I encountered an error like the image below
Capture
I am using Version 2.1.15 (442df9d6)
Window 10

Get IPA from formatted text

I've noticed this addon does not work for vocabs that are

  1. bold
  2. italic
  3. underline
  4. or have space(s) after it

I think this addon would be much better if it also work for the these types of vocabs.

Error generated every time IPA is generated

Each time I generate an IPA transcription, an error is generated (but the IPA is generated successfully anyways)

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: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-12-13 14:36:01
Add-ons possibly involved: ⁨Anki IPA⁩

--- Logging error ---
Traceback (most recent call last):
File "logging/init.py", line 1084, in emit
UnicodeEncodeError: 'ascii' codec can't encode character '\xdf' in position 29: ordinal not in range(128)
Call stack:
File "runankimac", line 12, in
File "aqt/init.py", line 437, in run
File "aqt/init.py", line 618, in _run
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 "/Users/user/Library/Application Support/Anki2/addons21/799647424/main.py", line 183, in on_bridge_cmd
_old(editor, command)
File "aqt/editor.py", line 438, in onBridgeCmd
File "/Users/user/Library/Application Support/Anki2/addons21/799647424/main.py", line 51, in paste_ipa
logging.debug(f"Field text: {field_text}")
File "logging/init.py", line 2080, in debug
File "logging/init.py", line 1422, in debug
File "logging/init.py", line 1577, in _log
File "logging/init.py", line 1587, in handle
File "logging/init.py", line 1649, in callHandlers
File "logging/init.py", line 950, in handle
File "logging/init.py", line 1183, in emit
File "logging/init.py", line 1089, in emit
Message: 'Field text: das Maß, Maße'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "logging/init.py", line 1084, in emit
UnicodeEncodeError: 'ascii' codec can't encode character '\xdf' in position 33: ordinal not in range(128)
Call stack:
File "runankimac", line 12, in
File "aqt/init.py", line 437, in run
File "aqt/init.py", line 618, in _run
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 "/Users/user/Library/Application Support/Anki2/addons21/799647424/main.py", line 183, in on_bridge_cmd
_old(editor, command)
File "aqt/editor.py", line 438, in onBridgeCmd
File "/Users/user/Library/Application Support/Anki2/addons21/799647424/main.py", line 60, in paste_ipa
logging.debug(f"Word list: {words}")
File "logging/init.py", line 2080, in debug
File "logging/init.py", line 1422, in debug
File "logging/init.py", line 1577, in _log
File "logging/init.py", line 1587, in handle
File "logging/init.py", line 1649, in callHandlers
File "logging/init.py", line 950, in handle
File "logging/init.py", line 1183, in emit
File "logging/init.py", line 1089, in emit
Message: "Word list: ['das', 'maß,', 'maße']"
Arguments: ()

[ger] Alternative IPA transcriptions

Currently the script scrapes only the first transcription (at least when using the German version)

For wenig I get only ˈveːnɪç

However, wiktionary often contains more than one relevant transcription. Recomended output is ˈveːnɪç|ˈveːnɪk

Error when use Anki IPA on MacOS

Describe the bug
I encountered an error when using Anki IPA, with the error details as follows:

Anki 2.1.60 (76d88073) Python 3.9.15 Qt 6.3.2 PyQt 6.3.1
Platform: macOS-13.1-arm64-arm-64bit
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-03-13 22:32:05
Add-ons possibly involved: ⁨Anki IPA⁩

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 46, in cmd
  File "aqt.webview", line 153, in _onCmd
  File "aqt.webview", line 662, in _onBridgeCmd
  File "decorator", line 232, in fun
  File "anki.hooks", line 89, in decorator_wrapper
  File "anki.hooks", line 86, in repl
  File "/Users/khiempx/Library/Application Support/Anki2/addons21/799647424/__init__.py", line 186, in on_bridge_cmd
    _old(editor, command)
  File "aqt.editor", line 469, in onBridgeCmd
  File "/Users/khiempx/Library/Application Support/Anki2/addons21/799647424/__init__.py", line 60, in paste_ipa
    ipa = parse_ipa_transcription.transcript(words=words, language=lang_alias)
  File "/Users/khiempx/Library/Application Support/Anki2/addons21/799647424/parse_ipa_transcription.py", line 136, in transcript
    transcription_method = transcription_methods[language]
KeyError: ''

issue

Anki 2.1.54 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: 2023-11-06 21:55:35

Caught exception:
Traceback (most recent call last):
File "C:\Users****\AppData\Roaming\Anki2\addons21\799647424\batch_adding.py", line 170, in add_ipa_transcription
mw.CollectionOp()
AttributeError: 'AnkiQt' object has no attribute 'CollectionOp'

How to change database.

This is completely new to me. Is there any possibility to change source database for Anki IPA? I found out the file CMU_dict.db, which is English IPA internal source? Other languages are probably parsing from webpages. Actually I would prefer Merriam-Webster learner’s dictionary for us IPA. Is there a way?

IPA add-on not working in anki

When I click on the notes to add a IPA pronunciation, this error message comes up. I deleted and reinstalled the addon and the problem still persists.

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.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-09-14 23:02:04

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 547, in _onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-2>", line 2, in onBridgeCmd
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\Laura Erickson\AppData\Roaming\Anki2\addons21\799647424\main.py", line 183, in on_bridge_cmd
_old(editor, command)
File "aqt\editor.py", line 416, in onBridgeCmd
File "C:\Users\Laura Erickson\AppData\Roaming\Anki2\addons21\799647424\main.py", line 64, in paste_ipa
ipa = parse_ipa_transcription.transcript(words=words, language=lang_alias)
File "C:\Users\Laura Erickson\AppData\Roaming\Anki2\addons21\799647424\parse_ipa_transcription.py", line 81, in transcript
transcription_method = transcription_methods[language]
KeyError: ''

AttributeError: 'AnkiQt' object has no attribute 'CollectionOp'

Hello! I am currently using Windows 11 with Anki 2. The language that I am trying to use the IPA addon is with French. Everything runs smoothly (going to edit -> add IPA) and I have no issue up until the point where I press "Add". It gives me a warning about overwriting, so that's normal, but then it pops up the error

Debug info:
Anki 2.1.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-29 08:31:19

Caught exception:
Traceback (most recent call last):
  File "C:\Users\XXXX\AppData\Roaming\Anki2\addons21\799647424\batch_adding.py", line 170, in add_ipa_transcription
    mw.CollectionOp()
AttributeError: 'AnkiQt' object has no attribute 'CollectionOp'

I didn't want to bug you about this, so I tried going in and removing the 'CollectionOp' function myself (I just commented it out). However, doing this did not solve the problem. When I pressed 'Add' it would overwrite the field (that I wanted it to overwrite), but it would add absolutely nothing.

Here is a screenshot of once I press "proceed" after getting the overwritten error.
Screenshot 2023-11-29 130849

I'm really hoping the solution to this error is as easy as just updating my system. I just installed your addon a few days ago, so I don't think I have the outdated version of it. Have you ever seen this issue before?

Thank you
-Eveline

weird character for hill

For the hill I get IPA like this:
image

IPA:
hɪɫ

last character which I assumed should have been "l" is a bit weird (ɫ)... should it be like that?

At one website I get IPA for the same word like this: hɪl

Not work for french

Thanks for making this addon. It works very well with English. But when I try to make cards to learn french, something went wrong. It says "IPA not found".

Someone have this error like me:
image

Problem with Anki IPA

Hello,
Unfortunately, your application does not work for me.
I get an error:

For Anki 2.1.15
When loading 'Anki IPA':
Traceback (most recent call last):

File "/usr/share/anki/aqt/addons.py", line 80, in loadAddons __import__(dir)
File "/home/user_name/.local/share/Anki2/addons21/799647424/__init__.py", line 10, in <module>
from .import main
File "/home/user_name/.local/share/Anki2/addons21/799647424/main.py", line 18, in <module>
from .import batch_adding
File "/home/user_name/.local/share/Anki2/addons21/799647424/batch_adding", line 15, in <module>
from .typing import List
File "/home/user_name/.local/share/Anki2/addons21/799647424/typing.py", line 1357, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/user_name/.local/share/Anki2/addons21/799647424/typing.py", line 1005, in __new__
self ._abc_registry = extra._abc_registry
AttributeError:type object 'Callable' has no attribute' _abc_registry'

For Anki 2.1.19
When loading 'Anki IPA':
Traceback (most recent call last):

File "aqt/addons.py", line 97, in loadAddons
File "/home/user_name/.local/share/Anki2/addons21/799647424/__init__.py", line 10, in <module>
from . import main
File "/home/user_name/.local/share/Anki2/addons21/799647424/main.py", line 18, in <module>
from . import batch_adding
File "/home/user_name/.local/share/Anki2/addons21/799647424/batch_adding.py", line 15, in <module>
from .typing import List
File "/home/user_name/.local/share/Anki2/addons21/799647424/typing.py", line 1357, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/user_name/.local/share/Anki2/addons21/799647424/typing.py", line 1005, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'

I used:
Linux 5.4.13-3-MANJARO x86_64 GNU/Linux
Anki Version 2.1.15 (442df9d6) Python 3.8.1 Qt 5.14.0 PyQt 5.14.1
Anki Version 2.1.19 (3c8690ae) Python 3.8.1 Qt 5.14.0 PyQt 5.13.2

P.S. I'm using Version 2.1.15 now

Error in ENG IPA

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...

Handling of heteronyms

"A heteronym (also known as a heterophone) is a word that has a different pronunciation and meaning from another word but the same spelling"
For example, "close" can be pronounced in two ways. /ˈkloʊs/ as an adjective and /ˈkloʊz/ as a verb.

When adding the ipa pronunciation, there should at least be information that the word can be pronounced in several ways.

https://en.wikipedia.org/wiki/Heteronym_(linguistics)
https://www.oxfordlearnersdictionaries.com/definition/english/close1_1?q=close
https://www.oxfordlearnersdictionaries.com/definition/english/close2_1

Add CONTRIBUTE.md

Is your feature request related to a problem? Please describe.
It has full steps on how to contribute to your project

Describe the solution you'd like
Steps are given to clone your repository and how to contribute

@m-rtin assign this issue to me and I will add contribute.md and also add hacktoberfest tag

Keyboard shortcut support

It would be helpful to have a keyboard shortcut that triggers the action. It will be a simple change, I can even make it.
I have checked the code and description and took a quick look at the code, and I don't see anything related to this, so I'm opening the issue.

Describe the solution you'd like
The solution will be as simple as adding another parameter to the function that creates the button.
Another optional feature could be to add this to the setting parser.

Let me know what you think @m-rtin. If you want to proceed, I would ask you to add the hacktoberfest tag to the repo if you don't mind!

Spanish and English not working, other languages have strange behavior

Describe the bug
Spanish and English don't seem to work at the moment. Other languages produce strange results. For example, for the word "pelo" (in Spanish) I tried the French transcription and it resulted in this:
pelo, pˈelu, pˈelʊ, pˈeɛlʊ, pˈɛlʊ, ˈpelo, ˈpelos, ˈpelu, ˈpeːlo, ˈpɛlɔ, ’peli, ’pelo

Expected behavior
It gives the correct transcription.

There is a PR that seems to tackle this. However, I tried installing it and it didn't work for me. But maybe I did something wrong.

Allow the user to select a word separator

For example, when learning German, I add the plural form of the noun to the vocabulary
Zrzut ekranu 2022-08-02 144711
Currently, it appears that the addon is adding ipa for "die" and for "Hände". If I could set as a seperator ";" the words would add correctly. This could be an optional feature at the start of the addon.

Alternatively, an option could be added for the addon to omit certain punctuation marks. Then characters such as : ; were simply ignored by the addon.

[fr] Problem generating French IPA

I'm getting an error when I try to generate French IPA. I don't have any problem generating Russian or German. I'm seeing this problem on both Windows 10 and Linux Mint.
The debug info below is from my latest attempt. The only other add-ons installed were Review Heatmap and AwesomeTTS Google Cloud Text to Speech Unofficial.
Thanks for everything - this add-on is otherwise fantastic!

Debug info:
Anki 2.1.22 (0ecc189a) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-08-23 15:40:21

--- Logging error ---
Traceback (most recent call last):
File "logging_init_.py", line 1084, in emit
File "C:\python38\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u025b' in position 37: character maps to
Call stack:
File "runanki", line 4, in
File "aqt_init_.py", line 349, in run
File "aqt_init_.py", line 488, in run
File "aqt\webview.py", line 31, in cmd
File "aqt\webview.py", line 97, in onCmd
File "aqt\webview.py", line 500, in onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-2>", line 2, in onBridgeCmd
File "lib\site-packages\anki\hooks.py", line 666, in decorator_wrapper
File "lib\site-packages\anki\hooks.py", line 663, in repl
File "C:\Users\Cate\AppData\Roaming\Anki2\addons21\799647424\main.py", line 183, in on_bridge_cmd
old(editor, command)
File "aqt\editor.py", line 378, in onBridgeCmd
File "C:\Users\Cate\AppData\Roaming\Anki2\addons21\799647424\main.py", line 68, in paste_ipa
logging.debug(f"IPA transcription string: {ipa}")
File "logging_init
.py", line 2077, in debug
File "logging_init
.py", line 1422, in debug
File "logging_init
.py", line 1577, in log
File "logging_init
.py", line 1587, in handle
File "logging_init
.py", line 1649, in callHandlers
File "logging_init_.py", line 950, in handle
File "logging_init_.py", line 1183, in emit
File "logging_init_.py", line 1089, in emit
Message: 'IPA transcription string: ɛtʁ'
Arguments: ()

American English

I only want one transcription for American English or British English, not both. Like this:
I just want: agility -> /əˈdʒɪl.ə.t̬i/
not: agility -> əˈd͡ʒɪlɪti|əˈd͡ʒɪləti
it wasn't doing that in previous versions.

It's generating the wrong IPA

I've used this add-on before and it always generated just fine, now the add-on is generating IPA with absurd errors.
I've tried american (eng_a) and british english (eng_b).

For exemple,

Sentence: I've seen one before. Many, many years ago.
IPA: aɪv ˈsiːn|ˈsɪn|qual2=also wʌn ˈmɛni jɪɹz

error

Problem with notes with multiple Cards

First of all thank you very much for the add-on!! =D

Currently the add-on doesn't seem to work when I am marking multiple cards that belong to the same note at the same time.
For example, if the note type is "Front and Back" thus a note type with 2 cards per note and if I then mark all the cards (thus Front and Back of each note) and try to use the add-on it doesn't work.

All the best!

Error/bug - Extension not working

Using the extension to get IPA from English only words. It used to work in past few weeks and now don't. I've just tried to reinstall the extension and nothing changed.
Actually, if I use the option to add IPA in multiples cards it works, but the icon on the add cards bar or the editor in the sidebar doesn't work and I get the error below.

Informações de Depuração:
Anki 2.1.54 (b6a7760c) Python 3.9.10 Qt 6.3.1 PyQt 6.3.1
Platform: Linux
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-09-21 12:16:39
Extensões possivelmente envolvidas: ⁨Anki IPA⁩

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 "/home/marcos/.local/share/Anki2/addons21/799647424/init.py", line 178, in on_bridge_cmd
_old(editor, command)
File "aqt.editor", line 467, in onBridgeCmd
File "/home/marcos/.local/share/Anki2/addons21/799647424/init.py", line 60, in paste_ipa
ipa = parse_ipa_transcription.transcript(words=words, language=lang_alias)
File "/home/marcos/.local/share/Anki2/addons21/799647424/parse_ipa_transcription.py", line 159, in transcript
transcription_method = transcription_methods[language]
KeyError: ''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.