Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fosskers/kanji
Haskell suite for determining what 級 (level) of the 漢字検定 (national Kanji exam) a given Kanji belongs to.
https://github.com/fosskers/kanji
haskell japanese kanji
Last synced: about 2 months ago
JSON representation
Haskell suite for determining what 級 (level) of the 漢字検定 (national Kanji exam) a given Kanji belongs to.
- Host: GitHub
- URL: https://github.com/fosskers/kanji
- Owner: fosskers
- License: bsd-3-clause
- Created: 2012-03-25T12:41:36.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2021-12-08T21:26:27.000Z (about 3 years ago)
- Last Synced: 2024-05-01T23:23:31.538Z (8 months ago)
- Topics: haskell, japanese, kanji
- Language: Haskell
- Homepage:
- Size: 417 KB
- Stars: 22
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Kanji
====`kanji` is a Japanese Kanji library and analysation program written in Haskell. Its main
function is to tell what Kanji belong to what Level of the Japanese National
Kanji Examination (漢字検定).`kanji` can be used to:
- determine what Level individual Kanji belong to
- determine the average Level (difficulty, in other words) of a group of Kanji
- apply the above to whole files of JapaneseINSTALLING `kanji`
---------------
First, get the source files from:https://github.com/fosskers/kanji
`kanji` is written in Haskell and uses the
[stack](http://docs.haskellstack.org/en/stable/README.html) tool. Once
`stack` is installed, move to the source directory and perform:stack install
USAGE
-----
Assuming you've made it so that you can run the executable, the following
command-line options are available:```
Usage: kanji [-d|--density] [-e|--elementary] [-l|--leveldist] [-s|--splits]
((-f|--file ARG) | JAPANESE)Available options:
-h,--help Show this help text
-d,--density Find how much of the input is made of Kanji
-e,--elementary Find density of Kanji learnt in elementary school
-l,--leveldist Find the distribution of Kanji levels
-s,--splits Show which Level each Kanji belongs to
-f,--file ARG Take input from a file
```#### NOTES ON CLOs
* All options above can be mixed to include their analysis result
in the output JSON.
* `-h` will over-ride any other options or arguments, discarding them and
printing a help message.#### Examples
*Single Kanji*
```
$> kanji -s 日
{
"levelSplit": {
"Ten": [
"日"
]
}
}
```*A Japanese sentence*
```
$> kanji -s これは日本語
{
"levelSplit": {
"Nine": ["語"],
"Ten": ["本", "日"]
}
}
```*All options*
```
$> kanji -sled これは日本語。串と糞
{
"levelSplit": {
"Nine": ["語"],
"Ten": ["本", "日"],
"Unknown": ["糞"],
"Two": ["串"]
},
"elementary": 0.6,
"density": 0.5,
"distributions": {
"Nine": 0.2,
"Ten": 0.4,
"Unknown": 0.2,
"Two": 0.2
}
}
```