Hikidashi documentation
Hikidashi 引き出し — Japanese text tools for JavaScript
Era dates (和暦) and kanji numerals both ways, the dictionary forms of a conjugated word, a reading shared out over its kanji, words pulled from pasted text, and how hard a sentence is to read.
Install
npm install @johnmorrisdotca/hikidashi
Start here
Entry points
| Import it | What it is | Size |
|---|---|---|
@johnmorrisdotca/Era years · 10 exports | 和暦: Japanese era years, and the Western years and dates they name, both ways. | 1.3 kB |
@johnmorrisdotca/Kanji numerals · 5 exports | 漢数字: numbers, in both directions between the two ways of writing them. | 1.8 kB |
@johnmorrisdotca/Dictionary forms · 7 exports | 活用: the dictionary form a conjugated word was written from. | 1.9 kB |
@johnmorrisdotca/Reading alignment · 12 exports | 読みの割り当て: a word's reading shared out over its kanji, the way a school's かん字テスト sets it. | 1.1 kB |
@johnmorrisdotca/Pasted text · 7 exports | 抽出: Japanese words and kanji pulled out of pasted text. | 2.2 kB |
@johnmorrisdotca/Sentence difficulty · 5 exports | 難しさ: how hard an example sentence is to read, so the easiest one can lead. | 0.3 kB |
@johnmorrisdotca//element · 9 exports | 5.4 kB | |
@johnmorrisdotca//element/define · 9 exports | 5.4 kB | |
@johnmorrisdotca/Everything · 47 exports | Hikidashi 引き出し: a drawer of small Japanese text tools. | 6.4 kB |
Guides
How-to
- Read era years on a formAccept a year the way people write it on a Japanese form, in either calendar, and store the Western year.
- Pull words out of a paste with your own dictionaryTurn a pasted page into the words and kanji your dictionary knows, asking the database once.
- Make a kanji testBuild a seeded writing and reading test from a word list, the way a Japanese school's かん字テスト sets it.
- Sort example sentences by difficultyScore every example sentence once from the kanji data you hold, so the easiest can be shown first.
- Write amounts in kanji, and read them aloudShow an amount the way a Japanese page writes it, in the formal characters a contract uses, and as it is said.
- Embed furigana, era years and numbersAdd native Japanese text tools to an article or form with a custom element or a private iframe.
Explanation
- How each drawer worksThe rules behind each drawer's answers, and the cases each one refuses.
- Why it is built this wayThe choices behind Hikidashi: no data of its own, a refusal rather than a guess, pure functions, one entry point per drawer.