Japanese Text Cleaner

AnkiWeb addon 1852987770

Cleans Japanese text in Anki notes by removing unnecessary spaces and furigana while preserving reading spaces and HTML, with preview, diff, undo, and change-log safeguards.
AI-generated summary; may contain mistakes.

note-managementformatting

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
3 (๐Ÿ‘ 3 ยท ๐Ÿ‘Ž 0)
Updated
2019-07-12
Anki versions
unknown
License
Apache-2.0 (from the GitHub repository)
Description language
en

Maintenance

stale

  • Last update or commit: 2026-04-13 (202 days before the snapshot).
  • Test files: 2.
  • GitHub Actions workflows: 1.
  • Commits in the last year: 0.
  • Issues: 3 open, 0 closed.
  • Pull requests: 1 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.0โ€“2019-07-12
History across monthly snapshots

Loadingโ€ฆ

Similar addons

SimpleFurigana

Adds or removes furigana on Japanese card content using editor toolbar buttons, with MeCab/Kakasi-generated readings and configurable output patterns and number reading support.

card-creationnote-managementformatting

34 votes 54% approval ๐Ÿ‘ 24 ยท ๐Ÿ‘Ž 10 โญ 11 Updated 2020-09-27
Bold Word in Sentences (JP)

Automatically bolds target Japanese vocabulary within sentence fields using morphology-aware matching, with dry-run preview, browser integration, custom readings, and optional furigana clearing.

note-managementformatting

1 votes 21% approval ๐Ÿ‘ 1 ยท ๐Ÿ‘Ž 0 Anki 2.1.1~ Updated 2025-12-31

Description

This is a plugin for Anki that can help clean up Japanese text in the ways outlined below. Issues should be reported on the Issues page for the project on Github. Clean unnecessary spaces, while preserving those spaces that are necessary for indicating the start of a Japanese reading (as in the Japanese Support plugin). Clean unnecessary furigana from the beginning, end, or within individual readings within text. Both are designed to:
  • Properly handle text with multiples lines
  • Properly handle text with HTML markup by allowing HTML tags to pass through unchanged
In addition, there are some features to guard against accidental changes or bugs in the plugin:
  • A Check action logs all changes that would be made without taking any action.
  • A Diff action produces a colorful HTML diff highlighting in green what will been added and in red what will be removed for each note.
  • A Fix action actually performs the changes.
  • Each batch of changes is recorded in the undo history within Anki.
  • A full change log is kept in a SQLite database within the plugin's local directory. Recent changes can be viewed in the UI and the full history of changes can be exported to a CSV file. This enables you to recover any previous values altered by the plugin.
Despite these safety features, it's a good idea to back up or export your collection before using this plugin just to be safe. You can access the dialogs by clicking Browse to open the card browser and then clicking Edit -> Japanese Text Cleaner. The fixer dialgos require you to select some cards first. These are the cards that will be checked. Support If you experience a problem or have any comments/ideas, please open an issue at the Issues page for the project on Github. Version History
  • 0.1: Initial Release
License Copyright 2019 Matthew Hayes Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

README

Anki Japanese Text Cleaner

Build Status Release

This is a plugin for Anki that can help clean up Japanese text in the following ways:

Clean unnecessary spaces, while preserving those spaces that are necessary for indicating the start of a Japanese reading (as in the Japanese Support plugin).

<b> ไธ€[ใ„ใก]</b>ใ‹ใ‚‰ ๅง‹[ใฏใ˜]ใ‚ใพใ—ใ‚‡ใ†ใ€‚
=>
<b>ไธ€[ใ„ใก]</b>ใ‹ใ‚‰ ๅง‹[ใฏใ˜]ใ‚ใพใ—ใ‚‡ใ†ใ€‚

ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚คใ‚ฟใƒชใ‚ข ่ชž[ใ”]ใŒ<b> ใงใใพใ™</b>ใ€‚
=>
ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚คใ‚ฟใƒชใ‚ข ่ชž[ใ”]ใŒ<b>ใงใใพใ™</b>ใ€‚

Clean unnecessary furigana from the beginning, end, or within individual readings within text.

ๅˆฅใซ[ในใคใซ]
=>
ๅˆฅ[ในใค]ใซ

ไธ–ใฎไธญ[ใ‚ˆใฎใชใ‹]
=>
ไธ–[ใ‚ˆ]ใฎ ไธญ[ใชใ‹]

Both are designed to:

  • Properly handle text with multiples lines
  • Properly handle text with HTML markup by allowing HTML tags to pass through unchanged

In addition, there are some features to guard against accidental changes or bugs in the plugin:

  • A Check action logs all changes that would be made without taking any action.
  • A Diff action produces a colorful HTML diff highlighting in green what will been added and in red what will be removed for each note.
  • A 'Fix' action actually performs the changes.
  • Each batch of changes is recorded in the undo history within Anki.
  • A full change log is kept in a SQLite database within the plugin's local directory. Recent changes can be viewed in the UI and the full history of changes can be exported to a CSV file. This enables you to recover any previous values altered by the plugin.

Despite these safety features, it's a good idea to back up or export your collection before using this plugin just to be safe.

You can access the dialogs by clicking Browse to open the card browser and then clicking Edit -> Japanese Text Cleaner. The fixer dialgos require you to select some cards first. These are the cards that will be checked.

Screenshots

Dialog to check for unnecessary spacing:

Dialog to check for unnecessary furigana:

HTML diff of proposed spacing changes:

HTML diff of proposed furigana changes:

Viewing the log of changes:

Testing

I have tested against the following shared decks which I found on Anki's Japanese shared decks page. Below I include some stats as of July 10, 2019 when I lasted tested the plugin against the decks.

Deck Notes Field Spacing Fixes Furigana Fixes
Japanese Core 2000 2k - Sorted w/ Audio 2007 Reading 266 1
Japanese Visual Novel, Anime, Manga, LN Vocab - V2K 1988 Reading 4 55

To get a better idea about how the plugin works, I've included some examples from each deck.

Examples: Japanese Core 2000 2k

Unnecessary space removed from beginning of line:

<b> ไธ€[ใ„ใก]</b>ใ‹ใ‚‰ ๅง‹[ใฏใ˜]ใ‚ใพใ—ใ‚‡ใ†ใ€‚
=>
<b>ไธ€[ใ„ใก]</b>ใ‹ใ‚‰ ๅง‹[ใฏใ˜]ใ‚ใพใ—ใ‚‡ใ†ใ€‚
<b> ๆœˆๆ›œๆ—ฅ[ใ’ใคใ‚ˆใ†ใณ]</b>ใซ ไผš[ใ‚]ใ„ใพใ—ใ‚‡ใ†ใ€‚
=>
<b>ๆœˆๆ›œๆ—ฅ[ใ’ใคใ‚ˆใ†ใณ]</b>ใซ ไผš[ใ‚]ใ„ใพใ—ใ‚‡ใ†ใ€‚

Unnecessary space removed from within line:

ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚คใ‚ฟใƒชใ‚ข ่ชž[ใ”]ใŒ<b> ใงใใพใ™</b>ใ€‚
=>
ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚คใ‚ฟใƒชใ‚ข ่ชž[ใ”]ใŒ<b>ใงใใพใ™</b>ใ€‚

Redundant furigana removed from end of word:

ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚ˆใ<b>ๅ–‹ใ‚‹[ใ—ใ‚ƒในใ‚‹]</b>ใญใ€‚
=>
ๅฝผๅฅณ[ใ‹ใฎใ˜ใ‚‡]ใฏใ‚ˆใ<b>ๅ–‹[ใ—ใ‚ƒใน]ใ‚‹</b>ใญใ€‚

Examples: Japanese Visual Novel, Anime, Manga, LN Vocab

Redundant furigana removed from the end:

ๅˆฅใซ[ในใคใซ]
=>
ๅˆฅ[ในใค]ใซ
็–ฒใ‚Œใ‚‹[ใคใ‹ใ‚Œใ‚‹]
=>
็–ฒ[ใคใ‹]ใ‚Œใ‚‹
็›ธๅค‰ใ‚ใ‚‰ใš[ใ‚ใ„ใ‹ใ‚ใ‚‰ใš]
=>
็›ธๅค‰[ใ‚ใ„ใ‹]ใ‚ใ‚‰ใš

Redunant furigana removed from the middle:

ๅฝ“ใŸใ‚Šๅ‰[ใ‚ใŸใ‚Šใพใˆ]
=>
ๅฝ“[ใ‚]ใŸใ‚Š ๅ‰[ใพใˆ]
ๆŒฏใ‚Š่ฟ”ใ‚‹[ใตใ‚Šใ‹ใˆใ‚‹]
=>
ๆŒฏ[ใต]ใ‚Š ่ฟ”[ใ‹ใˆ]ใ‚‹
ไธ–ใฎไธญ[ใ‚ˆใฎใชใ‹]
=>
ไธ–[ใ‚ˆ]ใฎ ไธญ[ใชใ‹]

Unnecessary space removed:

ๆฏ[ใฏใ„],   ๆฏ[ใ•ใ‹ใšใ]
=>
ๆฏ[ใฏใ„], ๆฏ[ใ•ใ‹ใšใ]

Version History

  • 0.1: Initial Release

License

Copyright 2019 Matthew Hayes

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.