Skip to main content

Converts strings between two character sets

Project description

script_converter

This is a simple tool to transliterate a given string using two character sets. The mapping between the sets must be provided in a .csv file, which has two columns, IPA and Ortho

Use is script_converter.convert(STRING, MAPPING_FILE_PATH), which will return a transliterated string. Per default, the Ortho values will be replaced by the IPA values. If transliteration should happen the other way around, the option to_ipa=False can be used.

example

I illustrate the functionality using Vamale as an example. The IPA and orthographic representations of all Vamale phonemes are listed in a file vamale_mapping.csv:

IPA Ortho
xh x
x ɣ
xhw
â
ê
î
ô
û
g ᵑɡ
d ⁿd
j ᶮɟ
mw
pw
vw
fw
phw pʰʷ
bw ᵐbʷ
b ᵐb
ph
kh
th
hm
hny ɲ̊
ny ɲ
hn
hl
aa
ee
ii
oo
uu
ââ ãː
êê ẽː
îî ĩː
ôô õː
ûû ũː
a a
e e
i i
o o
u u
ng ŋ

Now, the example sentence i beeng a kon hnyimake ko li aman a a vwa ('My friend is thinking about the things he is doing') can be converted:

print(script_converter.convert("i beeng a kon hnyimake ko li aman a a vwa", "vamale_mapping.csv"))

This results in the output i ᵐbeːŋ a kon ɲ̊imake ko li aman a a vʷa. This, in turn, could be converted back to i beeng a kon hnyimake ko li aman a a vwa using the following command:

print(script_converter.convert("i ᵐbeːŋ a kon ɲ̊imake ko li aman a a vʷa", "vamale_mapping.csv", to_ipa=False))

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for script-converter, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size script_converter-0.0.2-py3-none-any.whl (15.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size script_converter-0.0.2.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page