Python Port of BDRC’s Tibetan Sort Library: Sorting Tibetan Strings Made Easy
In today’s globalized world, cultural preservation is of utmost importance. The Buddhist Digital Resource Center (BDRC) recognizes the significance of preserving and organizing Tibetan texts and resources. To facilitate the sorting of Tibetan strings, BDRC has developed a library called “tibetan-sort”. This article explores the Python port of BDRC’s Tibetan Sort Library, which provides an efficient and user-friendly way to sort Tibetan strings using Python.
Installation
To begin utilizing the power of the Tibetan Sort Library, follow these simple steps for installation:
pip3 install tibetan_sort
Once installed, you are ready to harness the sorting capabilities of this library in your Python projects.
API Documentation
The Tibetan Sort Library offers a user-friendly API with two main functions: sort_list
and compare
.
sort_list
This function allows you to sort a list of strings using the compare()
method. Pass in a list of strings, and the function will return the sorted list.
Parameters
-
a
(list): List of strings to be sorted.
Returns
- Sorted list.
compare
The compare()
function enables you to compare two strings in Tibetan Unicode. It is important to note that this function is not designed to work well with non-Tibetan strings.
Parameters
-
a
(string): First string to be compared. -
b
(string): Second string to be compared.
Returns
- 0 if the strings are equivalent
- 1 if
a
is greater thanb
- -1 if
a
is less thanb
Release History
Stay up to date with the latest developments by referring to the change log. The release history provides an overview of the updates and improvements made to the library over time.
Maintenance
For contributors or those interested in the maintenance of the Tibetan Sort Library, please follow the below steps:
- Build the source dist:
rm -rf dist/
python3 setup.py clean sdist
- Upload the source dist on twine (version >= 1.11.0) using the following command:
python3 -m twine upload dist/*
Contribute towards the continuous improvement and maintenance of this valuable resource.
Credits
This Python port of BDRC’s Tibetan Sort Library would not have been possible without the contributions of the following individuals:
- JS code by Elie Roux
- Ported to Python by [尤志中]()
- List sorting implemented by Drupchen
License
The Tibetan Sort Library is copyrighted by the Buddhist Digital Resource Center from 2017 to 2019 and is provided under the MIT License.
Harness the power of the Tibetan Sort Library to effectively sort Tibetan strings and preserve cultural resources. This Python port ensures that developers have a comprehensive and user-friendly tool to incorporate into their projects. Stay tuned for future updates and enhancements to this invaluable resource.
Leave a Reply