So the raw text would look like this: “屋台[やたい]” (always with a space in front of every word with a kanji).
The weird thing is that if I highlight a word manually, it works just fine. But if I use your addon to do the exact same thing it doesn’t work right. The word does get highlighted, but the furigana won’t show correctly. It will still look like this. “屋台[やたい]”
Another problem I have is that all other brackets used for other words in the sentence get highlighted too.
@Xirai , thank you for reporting!
In this update I fixed some issues related to processing punctuation marks (including square brackets in furigana). Please, check that it works for you.
Thank you for all the updates! I noticed a couple of things after the new update.
Sometimes other parts of the sentence get highlighted too. I see this can be useful for English but I don’t see the use for it for Japanese personally.
example:
raw sentence: 新[あら]たな 能力[のうりょく]を 生[う]み 出[だ]した!
Target word: 新[あら]た
It doesn’t work right when the word in the sentence use a different form. Here, the target word is “沸かす”. But in the sentence it’s written like this: “沸いてる”. I’m not sure if you can do anything about that though.
example:
Sometimes other parts of the sentence get highlighted too.
The target word 新[あら]た is broke down (tokenized) by punctuation marks (square brackets in this case) into tokens:
新[あら]た
新
あら
た
Then each token is highlighted in the text individually.
There is no special logic for furigana.
Unfortunately, in this case, I can’t see an ability to distinguish the 2nd た to skip it. Language processing is a complex task where false-positive and false-negative matches sometimes happen. No magic
It doesn’t work right when the word in the sentence use a different form.
It requires using morphological analysis (word dictionaries) to support word forms for Japanese language. Current addon version relies on regular expressions only.
For English, word forms are handled by replacing 2 last characters (for words longer 3 symbols). E.g. study → stu* which matches study, studies, studying, studied, etc. But it doesn’t work for Japanese.
Maybe I’ll add morphological analysis in future versions, but in v1 I can provide only regular expressions.
Despite I can’t fix these 2 cases, please, proceed reporting any anomalies in highlighting or user interface. They allows me to fix issues I can’t mention with my dataset.
During highlighting or erasing, CFH addon marks modified notes with tag cross-field-highlighter::modified-by-latest-run.
Then you can see modified notes in Browser:
I’m afraid this use-case can’t work in current addon version (v1).
However, in version v2, I think to implement so-called “presets” where user can configure settings (one or several) for each note type and then the addon will be able to highlight notes automatically after editing note. This feature can cover your case.
Existing Browser menu will be preserved also.
Unfortunately, I can’t give any v2 release dates for now.
Always read configuration from the config file.
Don’t need to restart Anki if configuration was changed. Some settings (like hotkeys) require just to close and open the Browser.