This project has limited documentation.
文档很少,将就着看吧。
Creates furigana based on Yahoo's api and a romaji transliteration.
Made for Moegirlpedia, but can be adapted to other use cases.
- Install required dependencies in
requirements.txt
. - Create file "user-password.py" according to the manual of pywikibot.
- Run main.py and input 1 for manual mode
- Input name of the page
- The program may prompt for manual intervention. If so, input the corresponding option.
- The program may either push the change automatically (if everything goes smoothly) or ask for manual confirmation if suspicious changes are made.
- Repeat 4 to 6 for more pages.
Note that auto mode will automatically create a list of all VJ songs and go through them one by one.
For example, given these as input
夏空を鮮明に
natsuzoraosenmeini
The program converts kana to romaji
- を becomes
['o', 'wo']
(both are valid transliterations) - に becomes
['ni']
It now searches in the romaji of Vocaloid Lyrics Wiki and match the remaining unmatched Kanji with the romaji. Thus, we have two possibilites
- 夏空 => natsuz; 鮮明 => raosenmei
- 夏空 => natsuzora; 鮮明 => senmei
Clearly, 1 is wrong and 2 is correct. 1 is listed as a possibility because を can be matched with either the first 'o' in 'zo' or the second 'o'.
The program employs multiple measures to determine which one is correct. For example, "natsuz" cannot be converted to hiragana since the "z" is inconvertible. Furthermore, Yahoo might have already determined that 鮮明 is "senmei". Correcting "seimei" with "raoseimei", which is not a valid pronunciation, will also decrease the likelihood that this conversion is correct.
Among all possible combinations, the program chooses the one most likely to be correct.