Japanese Support

Ok, so I’ve dig into the code and found the issue.

It seems that the noteTypes config isn’t case insensitive, but even more than that, entries are currently required to be lowercase for any match to be possible, since only the note name extracted from the collection is being lowerized, and not the one at the configured entry.

def isJapaneseNoteType(noteName):
    noteName = noteName.lower()
    for allowedString in config["noteTypes"]:
        if allowedString in noteName:
            return True

    return False

I could open a PR if someone where to point me to the repo, since I was not able to find it on my own.

2 Likes

Hi, I’m not sure if this has been brought up before, but I have this issue where the Kanji Statistics is showing the wrong number of unique kanji.

So I’ve got this RTK deck with 4570 total cards, 2 cards for each note (kanji → definition & vice versa).

Which means there should be around 2285 unique kanji.

Since there are only 2,136 jouyou kanji, I want to use the Kanji statistics to find out which of the 2285 are excessive and cut them out.

However, when I used Kanji statistics, it shows that I only have 1649 unique kanji. Where did the other 636 kanji go? That’s a massive difference.

I’ve double checked that all the notes in my deck have the word “Japanese” in their name. Am I missing something else?

Appreciate it if you could help, thanks!

**EDIT:
When using Kanji Grid, it recognizes 2288 unique kanji. The discrepancy between 2285 and 2288 can be explained by the fact that some of the definition fields may be blank. But why is Kanji grid able to recognize everything while Kanji Statistics cannot?

Maybe the other kanji lie outside the Expression field?

I was wondering if there was a way to remove the spacing when autogenerating the readings?

The spaces are required so that furigana can be placed in the correct spot.

Okay, thanks for the explanation :)) I appreciate your work!

1 Like

4 posts were merged into an existing topic: Segfaults for anki 2.1.45+ when launching KanjiStats/HanziStats with “Video Driver: Software”

Sometimes when I use “the tab method”, a box pops up that’s loading indefinitely. How do should I go about fixing this?

The add-on doesn’t show any progress window when you tab out of a field, so that may be Anki or another add-on. Maybe updating to the latest Anki beta will help.

Interesting… I usually get the popup when adding readings to a card. I’ve had that for many versions of Anki (I’ve used the add-on for more than 1,5 years, it has been really helpful) and have only reported it now because I thought it already was a known issue… and I have begun adding more cards which makes the bug more annoying. I have for the second time experienced that the addon would suddenly stop working too. The first time was around 2.1.45 I think and the second time (today) is on the 2.1.49. Should I formally submit these problems somewhere? I don’t want to spam.

This is the place to report issues. Please start by testing with all other add-ons disabled, and see if you can reproduce it in 2.1.50. https://betas.ankiweb.net/

I didn’t receive any notifications that you responded, so I had not seen your response to be completely honest. Still same specs since last time and the issue has not occurred even once (ironic, even though I have been using the function more frequently this month). I don’t really have the time to test it out with 2.1.50+ (especially if it’s only me dealing with this, once every few months). It is completely random as far as I can tell. On an unrelated note, I came on today to post about this. Is it a known thing?

Hello! Thank you for your addon.

Since Anki doesn’t support list fields, I thought I’d format my sentences for vocabulary in JSON format in one field and then create the HTML in my cards with Javascript. For example, this is a field with one sentence:

{
  "sentences" : [
    {
      "sentence" : "食べながら読んではいけません",
      "meaning" : "You must not read while eating.",
      "source" : "Jisho"
    }
  ]
}

I let your addon autogenerate a field with the furigana, which gives:

{" sentences":[{" sentence":" 食[た]べながら 読[よ]んではいけません"," meaning":" You must not read while eating."," source":" Jisho"}]}

and is turned into this HTML:

<div id="sentences">{"<ruby><rb>sentences":</rb><rt>{" sentence":" 食[た</rt></ruby>べながら<ruby><rb>読</rb><rt>よ</rt></ruby>んではいけません"," meaning":" You must not read while eating."," source":" Jisho"}]}</div>

which is obviously invalid JSON, and so I can’t grab this div's innerHTML and parse it for formatting with Javascript.

Why does your program add spaces, and why is the HTML output so mangled? I think this is an issue (feature? unintended use of Anki’s furigana because I’m annoyed Anki doesn’t have list fields?) with Anki too, but I thought I’d ask here first before raising an issue on GitHub.

Spaces delineate furigana boundaries. The add-on expects plain-text input, and you’ll need to modify it to your needs if you want to support JSON input.

Unfortunately I don’t have the time to understand and modify your code, so I will just add another translated sentence to display on hover. I’m afraid if I keep trying to wrestle with Anki on this I’m never going to actually use the program. I can live without autogenerated furigana. :stuck_out_tongue:

In saying that, an iterable list field would be a lovely feature … :slight_smile:

Hello, thanks for creating this add-on.

I want to say thank you for this amazing add-on.

It has helped me so much.

When I successfully downloaded and installed it and wanted to use it, this error message occurred. How can I solve it?

Anki 2.1.57 (6b7d372c) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0

Platform: Windows-10-10.0.19044

Flags: frz=True ao=True sv=2

Add-ons, last update check: 2023-02-03 11:29:04

Unexpected output from mecab. Perhaps your Windows username contains non-Latin text?: ‘tagger.cpp(151) [load_dictionary_resource(param)] param.cpp(71) [ifs] no such file or directory: C:\Users\089-�U�z\AppData\Roaming\Anki2\addons21\3918629684\support\mecabrc’

Your Windows username contains characters other than A-Z/0-9, which the add-on can’t handle.

I’ve been using this addon for a while now and really enjoy it, but it seems like whenever it tries to autofill on an audio card with a longer sentence it will get stuck on “processing”, forcing me to restart anki

Does it print any errors to the console when such a problem happens? Console Output - Writing Anki Add-ons