kanji-3.1.0.1: Perform 漢字検定 (Japan Kanji Aptitude Test) level analysis on Japanese Kanji

Copyright(c) Colin Woodbury 2015 2016
LicenseGPL3
MaintainerColin Woodbury <colingw@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Kanji.Types

Description

Types for this library. While a constructor for Kanji is made available here, you should prefer the kanji "smart constructor" unless you know for sure that the Char in question falls within the correct UTF8 range.

Synopsis

Documentation

newtype Kanji #

A single symbol of Kanji. Japanese Kanji were borrowed from China over several waves during the last 1,500 years. Japan names 2,136 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

Instances

Eq Kanji # 

Methods

(==) :: Kanji -> Kanji -> Bool #

(/=) :: Kanji -> Kanji -> Bool #

Ord Kanji # 

Methods

compare :: Kanji -> Kanji -> Ordering #

(<) :: Kanji -> Kanji -> Bool #

(<=) :: Kanji -> Kanji -> Bool #

(>) :: Kanji -> Kanji -> Bool #

(>=) :: Kanji -> Kanji -> Bool #

max :: Kanji -> Kanji -> Kanji #

min :: Kanji -> Kanji -> Kanji #

Show Kanji # 

Methods

showsPrec :: Int -> Kanji -> ShowS #

show :: Kanji -> String #

showList :: [Kanji] -> ShowS #

Generic Kanji # 

Associated Types

type Rep Kanji :: * -> * #

Methods

from :: Kanji -> Rep Kanji x #

to :: Rep Kanji x -> Kanji #

Hashable Kanji # 

Methods

hashWithSalt :: Int -> Kanji -> Int #

hash :: Kanji -> Int #

ToJSON Kanji # 
FromJSON Kanji # 
NFData Kanji # 

Methods

rnf :: Kanji -> () #

type Rep Kanji # 
type Rep Kanji = D1 * (MetaData "Kanji" "Data.Kanji.Types" "kanji-3.1.0.1-DfOfK5sX4gmGUdVNO0fVBI" True) (C1 * (MetaCons "Kanji" PrefixI True) (S1 * (MetaSel (Just Symbol "_kanji") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Char)))

kanji :: Char -> Maybe Kanji #

Construct a Kanji value from some Char if it falls in the correct UTF8 range.

data Level #

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 1,006 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 (2,136 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

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

Instances

Enum Level # 
Eq Level # 

Methods

(==) :: Level -> Level -> Bool #

(/=) :: Level -> Level -> Bool #

Ord Level # 

Methods

compare :: Level -> Level -> Ordering #

(<) :: Level -> Level -> Bool #

(<=) :: Level -> Level -> Bool #

(>) :: Level -> Level -> Bool #

(>=) :: Level -> Level -> Bool #

max :: Level -> Level -> Level #

min :: Level -> Level -> Level #

Show Level # 

Methods

showsPrec :: Int -> Level -> ShowS #

show :: Level -> String #

showList :: [Level] -> ShowS #

Generic Level # 

Associated Types

type Rep Level :: * -> * #

Methods

from :: Level -> Rep Level x #

to :: Rep Level x -> Level #

Hashable Level # 

Methods

hashWithSalt :: Int -> Level -> Int #

hash :: Level -> Int #

ToJSON Level # 
ToJSONKey Level # 
FromJSON Level # 
NFData Level # 

Methods

rnf :: Level -> () #

type Rep Level # 
type Rep Level = D1 * (MetaData "Level" "Data.Kanji.Types" "kanji-3.1.0.1-DfOfK5sX4gmGUdVNO0fVBI" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Ten" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "Nine" PrefixI False) (U1 *)) (C1 * (MetaCons "Eight" PrefixI False) (U1 *)))) ((:+:) * (C1 * (MetaCons "Seven" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "Six" PrefixI False) (U1 *)) (C1 * (MetaCons "Five" PrefixI False) (U1 *))))) ((:+:) * ((:+:) * (C1 * (MetaCons "Four" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "Three" PrefixI False) (U1 *)) (C1 * (MetaCons "PreTwo" PrefixI False) (U1 *)))) ((:+:) * (C1 * (MetaCons "Two" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "PreOne" PrefixI False) (U1 *)) (C1 * (MetaCons "One" PrefixI False) (U1 *))))))

numericLevel :: Level -> Float #

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

rankMap :: Map Level Float #

A mapping of Ranks to their numeric representation.

isKanji :: Char -> Bool #

Legal Kanji appear between UTF8 characters 19968 and 40959.