Qieyun
- Package
- purescript-qieyun
- Repository
- nk2028/purescript-qieyun
A PureScript library for the Qieyun phonological system (切韻音系).
#initial Source
initial :: PhonologicalPosition -> String
Get the initial (母) from a phonological position (音韻地位).
initial $ fromPhonologicalDescription "幫三凡入" = "幫"
initial $ fromPhonologicalDescription "羣開三A支平" = "羣"
#rounding Source
rounding :: PhonologicalPosition -> Maybe String
Get the rounding (開合) from a phonological position (音韻地位).
rounding $ fromPhonologicalDescription "幫三凡入" = Nothing
rounding $ fromPhonologicalDescription "羣開三A支平" = Just "開"
#division Source
division :: PhonologicalPosition -> String
Get the division (等) from a phonological position (音韻地位).
division $ fromPhonologicalDescription "幫三凡入" = "三"
division $ fromPhonologicalDescription "羣開三A支平" = "三"
#repeatedInitial Source
repeatedInitial :: PhonologicalPosition -> Maybe String
Get the repeated initial (重紐) from a phonological position (音韻地位).
repeatedInitial $ fromPhonologicalDescription "幫三凡入" = Nothing
repeatedInitial $ fromPhonologicalDescription "羣開三A支平" = Just "A"
#rhyme Source
rhyme :: PhonologicalPosition -> String
Get the rhyme (韻) from a phonological position (音韻地位).
rhyme $ fromPhonologicalDescription "幫三凡入" = "凡"
rhyme $ fromPhonologicalDescription "羣開三A支平" = "支"
#tone Source
tone :: PhonologicalPosition -> String
Get the tone (聲) from a phonological position (音韻地位).
tone $ fromPhonologicalDescription "幫三凡入" = "入"
tone $ fromPhonologicalDescription "羣開三A支平" = "平"
#placeOfArticulation Source
placeOfArticulation :: PhonologicalPosition -> String
Get the place of articulation (音) from a phonological position (音韻地位).
placeOfArticulation $ fromPhonologicalDescription "幫三凡入" = "脣"
placeOfArticulation $ fromPhonologicalDescription "羣開三A支平" = "牙"
#voicing Source
voicing :: PhonologicalPosition -> String
Get the voicing (清濁) from a phonological position (音韻地位).
voicing $ fromPhonologicalDescription "幫三凡入" = "全清"
voicing $ fromPhonologicalDescription "羣開三A支平" = "全濁"
#phonologicalClass Source
phonologicalClass :: PhonologicalPosition -> String
Get the class (攝) from a phonological position (音韻地位).
phonologicalClass $ fromPhonologicalDescription "幫三凡入" = "咸"
phonologicalClass $ fromPhonologicalDescription "羣開三A支平" = "止"
#phonologicalDescription Source
phonologicalDescription :: PhonologicalPosition -> String
Get the phonological description (音韻描述) of a phonological position (音韻地位).
phonologicalDescription $ fromPhonologicalDescription "幫三凡入" = "幫三凡入"
phonologicalDescription $ fromPhonologicalDescription "羣開三A支平" = "羣開三A支平"
#phonologicalEncoding Source
phonologicalEncoding :: PhonologicalPosition -> String
Get the phonological encoding (音韻編碼) of a phonological position (音韻地位).
phonologicalEncoding $ fromPhonologicalDescription "幫三凡入" = "A9D"
phonologicalEncoding $ fromPhonologicalDescription "羣開三A支平" = "fFA"
#phonologicalExpression Source
phonologicalExpression :: PhonologicalPosition -> String
Get the phonological expression (音韻表達式) of a phonological position (音韻地位).
phonologicalExpression $ fromPhonologicalDescription "幫三凡入" = "幫母 三等 凡韻 入聲"
phonologicalExpression $ fromPhonologicalDescription "羣開三A支平" = "羣母 開口 三等 重紐A類 支韻 平聲"
#satisfies Source
satisfies :: PhonologicalPosition -> String -> Boolean
Check if a phonological position (音韻地位) satisfies the given phonological expression (音韻表達式).
fromPhonologicalDescription "幫三凡入" `satisfies` "章母" = false
fromPhonologicalDescription "幫三凡入" `satisfies` "一四等" = false
fromPhonologicalDescription "幫三凡入" `satisfies` "幫組 或 陽韻" = true
#phonologicalPosition Source
phonologicalPosition :: String -> Maybe String -> String -> Maybe String -> String -> String -> PhonologicalPosition
Construct a phonological position (音韻地位) by the given six elements of a phonological position.
phonologicalPosition "幫" Nothing "三" Nothing "凡" "入" = #幫三凡入
phonologicalPosition "羣" (Just "開") "三" (Just "A") "支" "平" = #羣開三A支平
Unsafe: throw a runtime exception if the given six elements of a phonological position is invalid.
#fromPhonologicalDescription Source
fromPhonologicalDescription :: String -> PhonologicalPosition
Convert a phonological description (音韻描述) to the corresponding phonological position (音韻地位).
fromPhonologicalDescription "幫三凡入" = #幫三凡入
fromPhonologicalDescription "羣開三A支平" = #羣開三A支平
Unsafe: throw a runtime exception if the given phonological description is invalid.
#fromPhonologicalEncoding Source
fromPhonologicalEncoding :: String -> PhonologicalPosition
Convert a phonological encoding (音韻編碼) to the corresponding phonological position (音韻地位).
fromPhonologicalEncoding "A9D" = #幫三凡入
fromPhonologicalEncoding "fFA" = #羣開三A支平
Unsafe: throw a runtime exception if the given phonological encoding is invalid.
#representativeCharacter Source
representativeCharacter :: PhonologicalPosition -> Maybe String
Get the representative character (代表字) of a phonological position (音韻地位).
representativeCharacter $ fromPhonologicalDescription "幫三凡入" = Just "法"
representativeCharacter $ fromPhonologicalDescription "羣開三A支平" = Just "祇"
representativeCharacter $ fromPhonologicalDescription "常開三麻去" = Nothing
#fanqie Source
fanqie :: String -> PhonologicalPosition -> Maybe String
Get the fanqie (反切) of a phonological position (音韻地位).
fanqie "法" $ fromPhonologicalDescription "幫三凡入" = Just "方乏"
fanqie "祇" $ fromPhonologicalDescription "羣開三A支平" = Just "巨支"
If you want to get the default fanqie of a phonological position, you can provide some random characters
as the first parameter, such as "?"
.
fanqie "?" $ fromPhonologicalDescription "幫三凡入" = Just "方乏"
fanqie "?" $ fromPhonologicalDescription "羣開三A支平" = Just "巨支"
fanqie "?" $ fromPhonologicalDescription "常開三麻去" = Nothing
#entries Source
entries :: PhonologicalPosition -> Array { character :: String, explanation :: String }
Get the corresponding characters and their explanations of a phonological position (音韻地位).
entries $ fromPhonologicalDescription "影開二銜去" = [{ character: "𪒠", explanation: "叫呼仿佛𪒠然自得音黯去聲一" }]
entries $ fromPhonologicalDescription "常開三麻去" = []
#queryCharacter Source
queryCharacter :: String -> Array { explanation :: String, phonologicalPosition :: PhonologicalPosition }
Get the explanations and phonological positions (音韻地位) of a character.
queryCharacter "結" = [{ explanation: "締也古屑切十五", phonologicalPosition: #見開四先入 }]
#getPhonologicalPositions Source
getPhonologicalPositions :: Unit -> Array PhonologicalPosition
Get an array of all the phonological positions (音韻地位) which correspond to at least one character.
- Modules
- Qieyun