Finalised Tone is color

By Serge Bertrand Last update Aug 13, 2009 — Installed 129 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Script Summary:
Colorise chinese character according to tone. need the dictionary of ChinesePera kun from Adso under the name of adso.dat and its index simp.idx (to be added in the same directory as this user script).

Script homepage

This script has no discussions.

start the discussion

This script has no reviews.

This script detect Chinese characters, find their most probable tone and colorise them according to a color scheme that can be changed in the first line of the script.
As, when this is done, chineseperakun doesn't work (for words over 1 character long) I rewrote a very simple equivalent part to overcome this pb, so the script also provide translation when the mouse is over a character.
I have reused in this code a module or two from chineseperakun, hope they are not too sensitive.
Sorry the code is not very well commented, I though I would need less than 400 lines when I started.
Nota : the last version optimise the search in the dictionary, but very brutally, so the script is slow ( around 3s to load dictionary and colorisation of more than 1000 characters per second) and during its execution it blocks the browser.
It work well on simple pages, but I have blocked iframe not to have the dic loaded several times. The dictionary and index can be found at the home page