Skip to content

Add cli wrapper#23

Merged
andreihar merged 1 commit into
andreihar:mainfrom
kylefeng28:main
Jul 1, 2026
Merged

Add cli wrapper#23
andreihar merged 1 commit into
andreihar:mainfrom
kylefeng28:main

Conversation

@kylefeng28

Copy link
Copy Markdown
Contributor

Hello, I'm trying to learn Taigi right now, and I found your Taibun transliterator website pretty useful, especially the TTS feature which lets me hear the words and especially tone sandhi in context. Awesome work by the way!

I found that there was also a Python library, so I added a simple CLI wrapper which could be useful for quick usage in the shell (there's a text segmentation / morphological analyzer for Japanese called MeCab which is primarily CLI driven)

usage: taibun [-h] {convert,tokenise} ...

Taiwanese Hokkien transliterator and tokeniser

taibun convert:
  -s, --system {Tailo,POJ,Zhuyin,TLPA,Pingyim,Tongiong,IPA}
                        transliteration system (default: Tailo)
  -d, --dialect {south,north,singapore}
                        dialect variant (default: south)
  -f, --format {mark,number,strip}
                        tone representation (default: mark)

taibun tokenise:
  --no-keep-original  normalise tokens to traditional characters instead of preserving original input

Examples:

$ taibun convert '我今仔日想欲去買菜' # (default: -s Tailo -d south)
Guá kin-á-ji̍t siūnn-beh khì bé tshài

$ taibun convert '我今仔日想欲去買菜' -s POJ
Góa kin-á-ji̍t siūⁿ-beh khì bé chhài

$ taibun convert '我今仔日想欲去買菜' -s Zhuyin
ㆣㄨㄚˋ ㄍㄧㄣ ㄚˋ ㆢㄧㆵ˙ ㄒㄧㆫ˫ ㆠㆤㆷ ㄎㄧ˪ ㆠㆤˋ ㄘㄞ˪

$ taibun convert '我今仔日想欲去買菜' -s TLPA -d north
Gua2 kin1 a2 lit8 siunn7 bueh4 khi3 bue2 chai3

@andreihar andreihar self-assigned this Jul 1, 2026
@andreihar andreihar added the enhancement New feature or request label Jul 1, 2026
@andreihar andreihar merged commit b649941 into andreihar:main Jul 1, 2026
24 checks passed
@andreihar

Copy link
Copy Markdown
Owner

Thank you very much for your contribution! Sorry for the long delay in approving the PR. I'll release a new version on PyPI soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants