nanq-2.0.0: Performs 漢字検定 (National Kanji Exam) level analysis on given Kanji.

Copyright(c) Colin Woodbury, 2015, 2016
LicenseGPL3
MaintainerColin Woodbury <colingw@gmail.com>
Safe HaskellSafe
LanguageHaskell98

Data.Kanji.Types

Description

Types for this library.

Synopsis

Documentation

class AsKanji a where Source

Anything that can be transformed into a list of Kanji.

Minimal complete definition

len

Methods

_Kanji :: Traversal' a Kanji Source

Traverse into this type to find 0 or more Kanji.

Despite what the Haddock documentation says, this is part of the minimal complete definition.

len :: Num b => a -> b Source

How long is this input source?

asKanji :: a -> [Kanji] Source

Transform this string type into a list of Kanji. The source string and the resulting list might not have the same length, if there were Char in the source that did not fall within the legal UTF8 range for Kanji.

newtype Kanji Source

A single symbol of Kanji. Japanese Kanji were borrowed from China over several waves during the past millenium. Japan names 2136 of these as their standard set, with rarer characters being the domain of academia and esoteric writers.

Japanese has several Japan-only Kanji, including:

  • 畑 (a type of rice field)
  • 峠 (a narrow mountain pass)
  • 働 (to do physical labour)

Constructors

Kanji 

Fields

_kanji :: Char
 

data Level Source

A Level or Kyuu (級) of Japanese Kanji ranking. There are 12 of these, from 10 to 1, including intermediate levels between 3 and 2, and 2 and 1.

Japanese students will typically have Level-5 ability by the time they finish elementary school. Level-5 accounts for 1006 characters.

By the end of middle school, they would have covered up to Level-3 (1607 Kanji) in their Japanese class curriculum.

While Level-2 (2136 Kanji) is considered "standard adult" ability, many adults could not pass the Level-2, or even the Level-Pre2 (1940 Kanji) exam without considerable study.

Level data for Kanji above Level-2 is currently not provided by this library.

Constructors

Level 

Fields

_allKanji :: Set Kanji
 
_rank :: Rank
 

data Rank Source

A numeric representation of a Level.

Constructors

Ten 
Nine 
Eight 
Seven 
Six 
Five 
Four 
Three 
PreTwo 
Two 
PreOne 
One 

fromRank :: Rank -> Float Source

Discover a Rank's numeric representation, as a Float.

rankMap :: [(Rank, Float)] Source

A mapping of Ranks to their numeric representation.

isKanji :: Char -> Bool Source

Legal Kanji appear between UTF8 characters 19968 and 40959.