pybo tokenizes Tibetan text into words.
Requires to have Python3 installed.
pip3 install --user pybo
drupchen@drupchen:~$ pybo tok-string "༄༅། །རྒྱ་གར་སྐད་དུ། བོ་དྷི་སཏྭ་ཙརྻ་ཨ་བ་ཏ་ར། བོད་སྐད་དུ། བྱང་ཆུབ་སེམས་དཔའི་སྤྱོད་པ་ལ་འཇུག་པ། །
སངས་རྒྱས་དང་བྱང་ཆུབ་སེམས་དཔའ་ཐམས་ཅད་ལ་ཕྱག་འཚལ་ལོ། །བདེ་གཤེགས་ཆོས་ཀྱི་སྐུ་མངའ་སྲས་བཅས་དང༌། །ཕྱག་འོས་ཀུན་ལའང་གུས་པར་ཕྱག་འཚལ་ཏེ། །བདེ་གཤེགས་
སྲས་ཀྱི་སྡོམ་ལ་འཇུག་པ་ནི། །ལུང་བཞིན་མདོར་བསྡུས་ནས་ནི་བརྗོད་པར་བྱ། །"
Loading Trie... (2s.)
༄༅།_། རྒྱ་གར་ སྐད་ དུ །_ བོ་ དྷི་ སཏྭ་ ཙརྻ་ ཨ་བ་ ཏ་ ར །_ བོད་སྐད་ དུ །_ བྱང་ཆུབ་ སེམས་དཔ འི་ སྤྱོད་པ་ ལ་ འཇུག་པ །_། སངས་རྒྱས་ དང་ བྱང་ཆུབ་
སེམས་དཔའ་ ཐམས་ཅད་ ལ་ ཕྱག་ འཚལ་ ལོ །_། བདེ་གཤེགས་ ཆོས་ ཀྱི་ སྐུ་ མངའ་ སྲས་ བཅས་ དང༌ །_། ཕྱག་འོས་ ཀུན་ ལ འང་ གུས་པ ར་ ཕྱག་ འཚལ་
ཏེ །_། བདེ་གཤེགས་ སྲས་ ཀྱི་ སྡོམ་ ལ་ འཇུག་པ་ ནི །_། ལུང་ བཞིན་ མདོར་བསྡུས་ ནས་ ནི་ བརྗོད་པ ར་ བྱ །_།
The command to tokenize a file is:
pybo tok <path-to-file>
For example to tokenize the file text.txt
with the following content:
བཀྲ་ཤི་ས་བདེ་ལེགས་ཕུན་སུམ་ཚོགས། །རྟག་ཏུ་བདེ་བ་ཐོབ་པར་ཤོག། །
I use the command:
drupchen@drupchen:~$ pybo tok-file ~\Documents\text.txt
...which create text_pybo.txt
containing:
བཀྲ་ ཤི་ ས་ བདེ་ལེགས་ ཕུན་སུམ་ ཚོགས །_། རྟག་ ཏུ་ བདེ་བ་ ཐོབ་པ ར་ ཤོག །_།
drupchen@drupchen:~$ pybo kakha to-sort.txt
The expected input is one word or entry per line in a .txt file. The file will be overwritten.
pybo fnr <in-dir> <regex-file> -o <out-dir> -t <tag>
-o
and -t
are optional
Text files should be UTF-8 plain text files. The regexes should be in the following format:
<find-pattern><tab>-<tab><replace-pattern>
- pybo is an open source library for Tibetan NLP.
We are always open to cooperation in introducing new features, tool integrations and testing solutions.
Many thanks to the companies and organizations who have supported pybo's development, especially:
- Khyentse Foundation for contributing USD22,000 to kickstart the project
- The Barom/Esukhia canon project for sponsoring training data curation
- BDRC for contributing 2 staff for 6 months for data curation
third_party/rules.txt
is taken from tibetan-collation.
Build the source dist:
rm -rf dist/
python3 setup.py clean sdist
and upload on twine (version >= 1.11.0
) with:
twine upload dist/*
The Python code is Copyright (C) 2019 Esukhia, provided under Apache 2.
contributors:
- Drupchen
- Élie Roux
- Ngawang Trinley
- Joyce Mackzenzie for reworking the logo