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

Add spaces after readings for bracket notation to delimit words in sentences #29

Closed
qntoine opened this issue Feb 22, 2023 · 6 comments
Closed

Comments

@qntoine
Copy link

qntoine commented Feb 22, 2023

As highlighted by another user on https://ankiweb.net/shared/info/678316993, spaces are not added between words (after the generated reading and before the next character), so that furigana are not rendered correctly in some situations unless fixed manually.

@ahlec
Copy link
Collaborator

ahlec commented Feb 23, 2023

Is this for the Ruby/HTML markup, or the bracket notation? The former is generating them correctly.

@qntoine
Copy link
Author

qntoine commented Feb 23, 2023

Indeed, that would be for the bracket notation — which I and other users may prefer for legacy & compatibility reasons.
It is also easier for copy-pasting or when needing to manually fix reading mistakes, which happens more often than not.

Merci :)

@ahlec
Copy link
Collaborator

ahlec commented Feb 24, 2023

Awesome, that helps narrow it down. When you say it's not "rendered correctly" in some situations: is there some other tool/plugin that you're using as well that's converting the bracket notation into some other format? Would you be able to provide a screenshot of a sentence that doesn't render correctly, so we have a test case to work with while we're coding the fix?

@qntoine
Copy link
Author

qntoine commented Feb 26, 2023

Sure, here is a screenshot of what I get after pasting a random sentence into Anki and running the plugin without any other modification or conversion:
image
For reference, the base text (unedited) with automatically generated furigana is as follows: 宅[たく]建[けん]業[ぎょう](宅地[たくち]建物[たてもの]取引[とりひき]業[ぎょう])とは、「宅地[たくち]・建物[たてもの]」の「取引[とりひき]」を「業[ぎょう]」として行[おこな]うことをいいます。宅[たく]建[けん]菜[さい]を営[いとな]むためには、免許[めんきょ](後[ご]込[こみ])を受[う]けなければなりません。

@vbomedeiros
Copy link

vbomedeiros commented Apr 24, 2023

The fix is probably to just add a space at this line: https://github.com/obynio/anki-japanese-furigana/blob/master/reading.py#L153

Before:

return '%s[%s]' % (self.text, self.reading)

After:

return ' %s[%s]' % (self.text, self.reading)

Changed it on my copy and observed that the plugin now does the annotation correctly.

@obynio
Copy link
Owner

obynio commented Feb 12, 2024

This issue was fixed and released in 1.4.6 🫡
Feel free to comment the pull request above in case of issues

@obynio obynio closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants