Skip to main content

Transliter

Hits

Transliter transliterates multilingual text into Latin script | by Hoyeol Kim

Currently, Transliter supports Korean, Japanese, Russian, Ukrainian, Bulgarian, Macedonian, Mongolian, Montenegrin, Serbian, and Tajiki. More languages will be added to Transliter in the future.

There are several functions in Transliter, such as tl.ko, tl.transliter_ko, tl.txt_ko, and tl.csv_ko, in addition to spacing functions (tl.spacing and tl.spacing_file). To transliaterate from a language other than Korean, simply replace the language code ko with your desired language code.

Language codes are as follows: ko (Korean), jp (Japanese), ru (Russian), ua (Ukrainian), bg (Bulgarian), mk (Macedonian), mn (Mongolian), me (Montenegrin), sr (Serbian), and tj (Tajiki).


Install

$ pip install transliter

Load Transliter in Python

$ Python

> import transliter as tl

1. Korean

1-1. Simple functions.

> tl.ko("안녕하세요. 날씨가 좋네요!")
'annyeonghaseyo. nalssiga jotneyo!'

If you want to use the transliteration function several times in a row:

> tl.transliter_ko()

> Please enter Korean text: 안녕하세요. 날씨가 좋네요!
annyeonghaseyo. nalssiga jotneyo!

> Please enter Korean text: 우리나라 만세!
urinara manse!

To exit Transliter, please press enter without any text.

1-2. File Export (txt -> txt)

The output is saved as filename_output.txt in your current directory.

> tl.txt_ko("test_ko.txt")
안녕하세요.
annyeonghaseyo.
오늘 날씨 좋네요!
oneul nalssi jotneyo!
행복한 하루 되세요.
haengbokhan haru doeseyo.
저는 독서가 취미입니다.
jeoneun dokseoga chwimiibnida.
하루하루 재미있게 살아요.
haruharu jaemiitge salayo.
가족들과 저녁을 먹어요.gajokdeulgwa jeonyeokeul meokeoyo.

1-3. File Export (txt -> csv)

The output is saved as filename_output.csv in your current directory.

> tl.csv_ko("test_ko.txt")
    Original Text                 Transliterated Text
0          안녕하세요.                     annyeonghaseyo.
1      오늘 날씨 좋네요!               oneul nalssi jotneyo!
2     행복한 하루 되세요.           haengbokhan haru doeseyo.
3   저는 독서가 취미입니다.      jeoneun dokseoga chwimiibnida.
4  하루하루 재미있게 살아요.          haruharu jaemiitge salayo.
5   가족들과 저녁을 먹어요.  gajokdeulgwa jeonyeokeul meokeoyo.

2. Japanese

2-1. Simple functions

> tl.jp("天気がいいですね。")
tenkigaiidesune。

If you want to use the transliteration function several times in a row:

> tl.transliter_jp()

> Please enter Japanese text: おねがいします。
onegaishimasu。

> Please enter Japanese text: 天気がいいですね。
tenkigaiidesune。

> Please enter Japanese text: 毎日運動をします。
mainichiundouwoshimasu。

To exit Transliter, please press enter without any text.

2-2. File Export (txt -> txt)

The output is saved as filename_output.txt in your current directory.

> tl.txt_jp("test_jp.txt")
気を付けて。
kiwotsukete。
良いニュースです。
yoinyuーsudesu。
おやすみなさい。
oyasuminasai。
おねがいします。
onegaishimasu。
気をつけてください。
kiwotsuketekudasai。
それはいい考えですね。sorehaiikangaedesune。

2-3. File Export (txt -> csv)

The output is saved as filename_output.csv in your current directory.

> tl.csv_jp("test_jp.txt")
  Original Text    Transliterated Text
0        気を付けて。           kiwotsukete。
1     良いニュースです。         yoinyuーsudesu。
2      おやすみなさい。          oyasuminasai。
3      おねがいします。         onegaishimasu。
4    気をつけてください。    kiwotsuketekudasai。
5   それはいい考えですね。  sorehaiikangaedesune。

3. Spacing

Some languages such as Japanese don't have spacing between words. If there is spacing between the characters or words for text in those languages, you might bump into errors. To avoid the errors, the spacing needs to be removed.

> tl.spacing("良 い ニ ュ ー ス で す。")
良いニュースです。

If you want to remove all spacing from a file, use spacing_file("filename"). The result is saved as filename_rmspace.txt.

> tl.spacing_file("test.txt")

4. Cyrillic

Transliter currently supports Russian and Serbian between languages written in Cyrillic. More languages will be added soon.

4-1. Simple functions

# Russian
> tl.ru("Привет")
'Privet'

# Serbian
> tl.sr("Здраво")
'Zdravo'

If you want to use the transliteration function several times in a row:

# Russian
> tl.transliter_ru()

> Please enter Russian text: Привет.
Privet.

> Please enter Russian text: Как дела?
Kak dela?

# Serbian
> tl.transliter_sr()

> Please enter Serbian text: Жао ми је
Žao mi je

> Please enter Serbian text: Добро јутро
Dobro jutro

To exit Transliter, please press enter without any text.

4-2. File Export (txt -> txt)

The output is saved as filename_output.txt in your current directory.

# Russian
> tl.txt_ru("test_ru.txt")
Доброе утро.
Dobroe utro.
Меня зовут Мандли.
Menya zovut Mandli.
Рад познакомиться с тобой.
Rad poznakomit'sya s toboj.
Как дела?Kak dela?

# Serbian
> tl.txt_sr("test_sr.txt")
Добро јутро
Dobro jutro
Драго ми је
Drago mi je
Пријатан дан желим
Prijatan dan želim
Не разумем
Ne razumem
Извините!Izvinite!

4-3. File Export (txt -> csv)

The output is saved as filename_output.csv in your current directory.

# Russian
> tl.csv_ru("test_ru.txt")
                Original Text          Transliterated Text
0                Доброе утро.                 Dobroe utro.
1          Меня зовут Мандли.          Menya zovut Mandli.
2  Рад познакомиться с тобой.  Rad poznakomit'sya s toboj.
3                   Как дела?                    Kak dela?

# Serbian
> tl.csv_sr("test_sr.txt")
        Original Text Transliterated Text
0         Добро јутро         Dobro jutro
1         Драго ми је         Drago mi je
2  Пријатан дан желим  Prijatan dan želim
3          Не разумем          Ne razumem
4           Извините!           Izvinite!

Metadata

Release files for transliter 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transliter 0.4.1
File Size Uploaded
transliter-0.4.1.tar.gz 18.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transliter 0.4.1
File Interpreter ABI Platform
transliter-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / transliter-0.4.1.tar.gz

Download URL transliter-0.4.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3990aa02614b97e5cc0112279db4e0324b6739283f24f79b5e3b1f6c63d9bd91
BLAKE2b-256 checksum
How to use checksums
1ea4fa1f4b3a809a1846b9d79509b127e3a5ab90afae04f3f5b1f0f2033ba803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / transliter-0.4.1-py3-none-any.whl

Download URL transliter-0.4.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dfaf88535ef95838e4ba3d6bce1634543222ea912a4df360fedf74df9fa43b5
BLAKE2b-256 checksum
How to use checksums
9823edeec79ea7839060c79a72dd86dc77503234364925b5e42529fa0419ab40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page