@hackage devanagari-transliterations0.1.0.0

Conversion between Devanagari Unicode, Harvard-Kyoto, IAST and ISO15919.

devanagari-transliterations

License BSD3 Actions Status codecov Available on Hackage

This library provides conversions between Devanagari (unicode block 0900-097F) and the transliterations Harvard-Kyoto, IAST and ISO15919.

It is particulary useful to produce Devanagari output from a Harvard-Kyoto (ASCII-only) source. This is shown in the example below.

Usage

{-# LANGUAGE OverloadedStrings #-}

import Data.Char.Devanagari (tokenize, toDevanagari, toHarvard, toIast, toIso)
import qualified Data.Text.IO as TIO

main :: IO ()
main = do
  let tokens = tokenize "zubha lAbha" -- meaning "good luck"
  TIO.putStrLn $ "Devanagari:    " <> toDevanagari tokens 
  TIO.putStrLn $ "IAST:          " <> toIast tokens
  TIO.putStrLn $ "ISO15919:      " <> toIso tokens
  TIO.putStrLn $ "Harvard Kyoto: " <> toHarvard tokens

Output:

Devanagari:    शुभ लाभ
IAST:          śubha lābha
ISO15919:      śubha lābha
Harvard Kyoto: zubha lAbha

Available on Hackage

[https://hackage.haskell.org/package/devanagari-transliterations](https://hackage.haskell.org/package/devanagari-transliterations)

Add the following to your package.yaml file:

dependencies:
- devanagari-transliterations

The complete conversion table

Harvard-Kyoto Devanagari IAST ISO15919
a a a
A ā ā
i i i
I ī ī
u u u
U ū ū
R
RR r̥̄
lR
lRR l̥̄
e e ē
o o ō
ai ai ai
au au au
k क् k k
c च् c c
T ट्
t त् t t
p प् p p
g ग् g g
j ज् j j
D ड्
d द् d d
b ब् b b
G ङ्
J ञ् ñ ñ
N ण्
n न् n n
m म् m m
h ह् h h
y य् y y
r र् r r
l ल् l l
v व् v v
Z ज़् z z
f फ़् f f
z श् ś ś
S ष्
s स् s s
kh ख् kh kh
ch छ् ch ch
Th ठ् ṭh ṭh
th थ् th th
ph फ् ph ph
gh घ् gh gh
jh झ् jh jh
Dh ढ् ḍh ḍh
dh ध् dh dh
bh भ् bh bh
ġ ग़् ġ ġ
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
M
MM
H
' ' '
OM oṃ ōṁ
_ _ _
|‍ ||