Skip to content

Latest commit

ย 

History

History
81 lines (60 loc) ยท 4.52 KB

File metadata and controls

81 lines (60 loc) ยท 4.52 KB

NihongoColor Logo

ๆ—ฅๆœฌใฎ่‰ฒ โ€” NihongoColor

Languages Manifest V3 Kuromoji MIT License


Multi-language grammar highlighter for the browser. Real-time morphological analysis that color-codes particles, verb forms, adjectives, and grammar structures โ€” right on any webpage.

Demonstration

โœจ What is this?

NihongoColor is a Chrome Extension (Manifest V3) that performs real-time grammar highlighting on any webpage. Instead of modifying the DOM, it uses the native CSS Custom Highlight API for zero-impact rendering โ€” fully compatible with SPAs, Google Translate, and dynamic content.

For Japanese, it uses Kuromoji.js for morphological analysis (tokenization + POS tagging). For Korean and Chinese, it uses pattern-based regex matching. New languages can be added by simply dropping a JSON file โ€” no code changes needed.

Hover over any highlighted word to see a tooltip explaining its grammatical function in your preferred language (English, Portuguese, Japanese, Korean, or Chinese).

๐Ÿ”ฅ Features

  • ๐ŸŽจ Full UI Customization: Open the extension popup to instantly toggle grammar categories on/off or change their colors using the built-in color picker. Your preferences are saved automatically!
  • ๐Ÿง  Subject-Object-Verb (SOV) Engine: A revolutionary dual-layer parser! While grammatical particles have their text colored, their corresponding Subject, Object, and Verb clauses receive an elegant background highlight + colored border for deeper syntactical understanding.
  • ๐ŸŽฌ Instant Subtitle Sync (Netflix & YouTube): The engine detects when you are watching a video (YouTube, Netflix, Crunchyroll, Prime Video, etc.) and drops the internal analysis latency to 10ms. Grammars are highlighted instantly the moment a subtitle appears on screen!

Demonstation YouTube

๐Ÿ—๏ธ Architecture

nihongo-color/
โ”œโ”€โ”€ languages/                 # ๐Ÿ—„๏ธ Scalable language database
โ”‚   โ”œโ”€โ”€ registry.json          # Central index of all languages
โ”‚   โ”œโ”€โ”€ japanese.json          # Full pack: particles, verbs, adjectives
โ”‚   โ”œโ”€โ”€ korean.json            # Korean particles + regex rules
โ”‚   โ””โ”€โ”€ chinese.json           # Chinese grammar patterns
โ”œโ”€โ”€ lang-loader.js             # Loads registry + packs โ†’ compiled tables
โ”œโ”€โ”€ content.js                 # Dual-engine highlighter (Kuromoji + Regex)
โ”œโ”€โ”€ popup.html / popup.js      # Multi-language popup UI
โ”œโ”€โ”€ manifest.json              # Chrome Extension Manifest V3
โ”œโ”€โ”€ lib/kuromoji.js             # Kuromoji tokenizer (bundled)
โ””โ”€โ”€ dict/                      # IPAdic dictionary files (~16MB)

Data-Driven Design

All grammar rules, colors, and tooltips live in JSON files โ€” not in code. The extension reads registry.json to discover languages, loads each pack, and compiles fast lookup tables at runtime.

๐Ÿš€ Installation

From source (Developer mode)

Using git

  1. Clone the repository: git clone https://github.com/YOUR_USERNAME/nihongo-color.git
  2. Open Chrome โ†’ chrome://extensions/
  3. Enable Developer mode (top-right toggle)
  4. Click Load unpacked โ†’ select the cloned folder
  5. Navigate to any page with Japanese/Korean/Chinese text and click the extension icon

Download ZIP

URL: https://github.com/GHagui/nihongo-color

  1. Click in the button < > Code in the repository page
  2. Click in the Download ZIP button
  3. Unzip the downloaded file
  4. Open Chrome โ†’ chrome://extensions/
  5. Enable Developer mode (top-right toggle)
  6. Click Load unpacked โ†’ select the cloned folder
  7. Navigate to any page with Japanese/Korean/Chinese text and click the extension icon

้ ‘ๅผตใฃใฆใใ ใ•ใ„๏ผ โ€” Happy studying! ๐Ÿ’œ