Japanese Support

They were empty in both cases.

I did some further investigating, and it turns out that at least in my case it was another addon causing the issue. I’ll edit this post when I figure out which one, for anyone else who runs into this problem.

Apparently I can’t edit my post, so sorry for the double post.

The addon causing the problem was Multi-column note editor.

1 Like

Hey, can you make a video on how to use your add on? Because rn, I can’t seem to find what I’m looking for on step 3. Thanks

I’m struggling to get the Kanji statistics functionality to work over my custom deck, and would welcome some help.

Just for context: my deck is one of many within my profile and contains 3 note types, each of which with 2 cards (for meaning and reading). Specifically, I have a note model “kanji Model” with “Kanji” as the primary field (it only ever contains a single Kanji). I’d like cards from these notes to be tracked, without much care for only one or both being required.

Here is my current addon config:

{
    "dstFields": [],
    "furiganaSuffix": " (furigana)",
    "noteTypes": [
        "kanji Model"
    ],
    "srcFields": [
        "Kanji"
    ]
}

Since I didn’t know what entailed the concept of a kanji being “seen”, I’ve manually matured both the meaning and reading cards for 一 (いち), which are counted at regular statistics as the only 2 matured cards in the deck (it’s mostly new). They do not show at Kanji statistics, though, which remains at a 0 count.

Any help would be much appreciated.

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: