Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence-feature [generating pitch accent information for new or existing cards] works inconsistently #47

Open
Kohes opened this issue Feb 10, 2020 · 3 comments

Comments

@Kohes
Copy link

@Kohes Kohes commented Feb 10, 2020

Type:

  • bug
  • feature
  • enhancement
  • question

Environment:

  • OS: Windows 10

I'm going to open a PR to resolve the issue:

  • yes
  • [x ] no

Description:

Edit: It seems like the errors I'm receiving may have something to do with the restrictions on my work computer, where I do most of my Anki'ing. I tried on my personal computer and the program worked fine, both for individual cards and mass generation. I generated accents for ~20 individual cards and mass generated information for 3 decks, just for the sake of testing, but had ran into zero errors.

I'm attempting to add colored pitch accent information to this Core 2k deck. The majority of the time, clicking the expression field and then pressing the sentence button yields a failure with the below code, but if I cancel out of the error message and continually press the sentence button, it will occasionally generate color-coded words to display pitch accent information in what appears to be the intended fashion.

Error message:
`Anki 2.1.19 (3c8690ae) Python 3.8.0 Qt 5.14.0 PyQt 5.13.2
Platform: Windows 10
Flags: frz=True ao=True sv=2

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 28, in cmd
File "aqt\webview.py", line 94, in _onCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-24>", line 2, in _onBridgeCmd
File "lib\site-packages\anki\hooks.py", line 82, in decorator_wrapper
File "lib\site-packages\anki\hooks.py", line 73, in repl
File "aqt\webview.py", line 407, in _onBridgeCmd
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\main.py", line 311, in bridgeReroute
mw.Exporter.finalizeGroupExport(self, splitList[1], field, self.note)
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\accentExporter.py", line 585, in finalizeGroupExport
results = self.wordData(results)
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\accentExporter.py", line 699, in wordData
del wordResults[-1]
IndexError: list assignment index out of range`

I've tried the following things:

  • Copied a random Japanese sentence and pasted it into the expression field of a new MIA Japanese type note.
  • Changed all of the cards in my Core 2k deck to MIA Japanese card type
  • Used the Active Fields settings feature to inject MIA Japanese's javascript into my Core2k note type
  • Updated Anki from 2.1.15 > 2.1.19
  • Tried to use the addon from a different computer
  • Deleted Anki and all Anki-related files, re-installed Anki and created a new user profile, re-downloaded the addon and audio files, attempted to generate information for an MIA Japanese type note
@Kohes Kohes changed the title Sentence feature only occasionally works Sentence-feature [generating pitch accent information for new or existing cards] works inconsistently Feb 11, 2020
@LucasMIA
Copy link
Collaborator

@LucasMIA LucasMIA commented Feb 20, 2020

Can you try the again with the fixes in the latest commit and report back?

@Kohes
Copy link
Author

@Kohes Kohes commented Feb 21, 2020

I got a different error this time. That may be because of how I did it: I don't have any experience coding and I haven't used github before. I downloaded the commit's zipfile, unzipped it, then replaced all of my existing files in the addon's folder in with the files from .src in the commit.

That being said, the program again failed to generate pitch accent information and yielded the following (new) debug info:

Edit: I normally use Anki on my work computer, which is where I'm having this issue. I recently tested the program on my personal computer and did not run into this problem.

`
Debug info:
Anki 2.1.19 (3c8690ae) Python 3.8.0 Qt 5.14.0 PyQt 5.13.2
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 28, in cmd
File "aqt\webview.py", line 94, in _onCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-4>", line 2, in _onBridgeCmd
File "lib\site-packages\anki\hooks.py", line 82, in decorator_wrapper
File "lib\site-packages\anki\hooks.py", line 73, in repl
File "aqt\webview.py", line 407, in _onBridgeCmd
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\main.py", line 311, in bridgeReroute
return
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\accentExporter.py", line 585, in finalizeGroupExport
newText = text
File "C:\Users\1910018\AppData\Roaming\Anki2\addons21\278530045\accentExporter.py", line 699, in wordData
wordList+= rest.split(',')
IndexError: list assignment index out of range
`

@LucasMIA
Copy link
Collaborator

@LucasMIA LucasMIA commented Feb 21, 2020

That is not the correct way to apply those fixes. Uninstall the add-on and then dl the add-on at the link below and simply double click it when Anki is @OPEN to install it. Note that you must be on Anki 2.1.20, so if you are using an earlier version it will not work. Let me know if it works.

http://www.mediafire.com/file/3bp8usm6f5slggs/MIADictionary2120v2.ankiaddon/file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.