Skip to content

Commit 231985b

Browse files
committed
Merge branch 'master' of github.com:Esukhia/botok
2 parents 9a90961 + e2bc04c commit 231985b

5 files changed

Lines changed: 143 additions & 142 deletions

File tree

openclaw_documentation_README.md

Lines changed: 80 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,110 @@
1-
# Botok – Python Tibetan Tokenizer
1+
<h1 align="center">
2+
<br>
3+
<a href="https://buddhistai.tools/"><img src="https://raw.githubusercontent.com/WeBuddhist/visual-assets/refs/heads/main/logo/WB-logo-purple.png" alt="OpenPecha" width="150"></a>
4+
<br>
5+
</h1>
26

3-
[![GitHub release](https://img.shields.io/github/release/OpenPecha/botok.svg)](https://github.com/OpenPecha/botok/releases)
4-
[![Documentation Status](https://readthedocs.org/projects/botok/badge/?version=latest)](https://botok.readthedocs.io/en/latest/?badge=latest)
5-
[![Coverage Status](https://coveralls.io/repos/github/OpenPecha/botok/badge.svg?branch=master)](https://coveralls.io/github/OpenPecha/botok?branch=master)
6-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)
7-
[![License](https://img.shields.io/github/license/OpenPecha/botok.svg)](https://github.com/OpenPecha/botok/blob/master/LICENSE)
8-
[![Stars](https://img.shields.io/github/stars/OpenPecha/botok)](https://github.com/OpenPecha/Botok)
7+
<h1 align="center">Botok</h1>
98

10-
## Project Description
9+
<p align="center">
10+
|Apache-2.0| |Python| |NLP|
11+
</p>
1112

12-
Botok is a powerful Python library for tokenizing Tibetan text. It segments text into words with high accuracy and provides optional attributes such as lemma, part-of-speech (POS) tags, and clean forms. The library supports various text formats, custom dialects, and multiple tokenization modes, making it a versatile tool for Tibetan Natural Language Processing (NLP).
13+
🏷 བོད་ཏོག [pʰøtɔk̚] Tibetan word tokenizer in Python
1314

14-
## Who This Project Is For
15+
## Table of Contents
1516

16-
This project is intended for developers and researchers working with Tibetan language text processing who need accurate word segmentation and tokenization.
17+
- [Features](#features)
18+
- [Prerequisites](#prerequisites)
19+
- [Installation](#installation)
20+
- [Configuration](#configuration)
21+
- [Usage](#usage)
22+
- [Development](#development)
23+
- [Testing](#testing)
24+
- [Contributing](#contributing)
25+
- [How to get help](#how-to-get-help)
26+
- [Terms of use](#terms-of-use)
1727

18-
## Project Dependencies
28+
## Features
1929

20-
Before using Botok, ensure you have:
30+
- Tibetan word tokenization using statistical and rule-based methods
31+
- Support for both classical and modern Tibetan
32+
- Integration with PyBo (Python Buddhist)
33+
- Customizable segmentation rules
34+
-字典-based word lookup
2135

22-
* Python 3.7+
23-
* pip (Python package installer)
36+
## Prerequisites
2437

25-
## Instructions for Installing Botok
38+
- Python 3.8+
39+
- pip
2640

27-
### Install Botok
41+
## Installation
2842

29-
1. **Install via pip:**
43+
```bash
44+
# Clone the repository
45+
git clone https://github.com/OpenPecha/Botok.git
46+
cd Botok
3047

31-
```bash
32-
pip install botok
33-
```
48+
# Install dependencies
49+
pip install -r requirements.txt
3450

35-
2. **Install from source:**
51+
# Install the package
52+
pip install -e .
53+
```
54+
55+
## Configuration
3656

37-
```bash
38-
git clone https://github.com/OpenPecha/Botok.git
39-
cd Botok
40-
pip install -e .
41-
```
57+
Botok can be configured via:
58+
- Environment variables
59+
- YAML configuration files in `config/`
60+
- Python API
4261

43-
### Run Botok
62+
## Usage
4463

4564
```python
46-
from botok import Botok
65+
import botok
4766

48-
botok = Botok()
49-
text = "བོད་ཡིག"
50-
tokens = botok.tokenize(text)
67+
# Create a tokenizer instance
68+
tokenizer = botok.Tok()
69+
70+
# Tokenize Tibetan text
71+
text = "བོད་ཡིག་གི་དཔེ་ཆ་"
72+
tokens = tokenizer.tokenize(text)
5173
print(tokens)
5274
```
5375

54-
## Directory Structure
76+
## Development
5577

56-
```
57-
Botok/
58-
├── .github/ # GitHub configuration
59-
├── botok/ # Main package source code
60-
├── docs/ # Documentation
61-
├── tests/ # Test suite
62-
├── requirements.txt # Development dependencies
63-
├── setup.py # Package setup configuration
64-
├── setup.cfg # Package metadata
65-
├── README.md # Project documentation
66-
├── CHANGELOG.md # Release history
67-
├── LICENSE # License file
68-
└── usage.py # Usage examples
69-
```
78+
```bash
79+
# Install dev dependencies
80+
pip install -e .[dev]
81+
82+
# Run tests
83+
pytest
7084

71-
## Contributing Guidelines
85+
# Lint
86+
flake8 botok/
87+
```
7288

73-
Contributions are welcome! Please read the [contributing guidelines](https://github.com/OpenPecha/Botok/blob/master/README.md#contributing) for details on how to submit pull requests.
89+
## Testing
7490

75-
## Additional Documentation
91+
```bash
92+
pytest tests/
93+
```
7694

77-
* [Full Documentation](https://botok.readthedocs.io/)
78-
* [API Reference](https://botok.readthedocs.io/en/latest/)
95+
## Contributing
7996

80-
## How to Get Help
97+
1. Fork the repository
98+
2. Create a feature branch
99+
3. Commit your changes
100+
4. Push to the branch
101+
5. Open a Pull Request
81102

82-
* [GitHub Issues](https://github.com/OpenPecha/Botok/issues)
83-
* [OpenPecha Community](https://openpecha.org)
103+
Please read [CONTRIBUTING.md](https://github.com/OpenPecha/.github/blob/main/CONTRIBUTING.md) for details.
84104

85-
## Terms of Use
105+
## How to get help
106+
* File an issue.
107+
* Join our [discord](https://discord.com/invite/7GFpPFSTeA).
86108

87-
Botok is licensed under the MIT License.
109+
## Terms of use
110+
Botok is licensed under the [Apache-2.0 License](/LICENSE).

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "botok"
7+
dynamic = ["version"]
8+
description = "Tibetan Word Tokenizer"
9+
readme = "README.md"
10+
license = {text = "Apache-2.0"}
11+
requires-python = ">=3.8"
12+
authors = [
13+
{name = "OpenPecha development team", email = "openpecha@gmail.com"},
14+
]
15+
keywords = ["nlp", "computational_linguistics", "tibetan", "tokenizer", "token"]
16+
classifiers = [
17+
"Development Status :: 3 - Alpha",
18+
"Topic :: Text Processing :: Linguistic",
19+
"Programming Language :: Python :: 3",
20+
"Operating System :: OS Independent",
21+
"Intended Audience :: Developers",
22+
"Intended Audience :: Science/Research",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Natural Language :: Tibetan",
25+
]
26+
dependencies = [
27+
"pyyaml",
28+
"requests",
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/OpenPecha/botok"
33+
Source = "https://github.com/OpenPecha/botok"
34+
Tracker = "https://github.com/OpenPecha/botok/issues"
35+
36+
[tool.setuptools.dynamic]
37+
version = {attr = "botok.vars.__version__"}
38+
39+
[tool.setuptools.packages.find]
40+
exclude = ["tests*"]
41+
42+
[tool.setuptools.package-data]
43+
botok = [
44+
"resources/*",
45+
"resources/words_bo/*",
46+
"resources/entry_data/*",
47+
"resources/words_non_inflected/*",
48+
"resources/lemmas/*",
49+
"resources/rules/*",
50+
"resources/words_skrt/*",
51+
"resources/adjustment/*",
52+
]
53+
54+
[tool.coverage.run]
55+
plugins = ["covdefaults"]
56+
omit = [
57+
".env/*",
58+
"botok/third_party/pynpl/cql.py",
59+
"botok/third_party/pynpl/fsa.py",
60+
]
61+
62+
[tool.semantic_release]
63+
version_variable = "botok/vars.py:__version__"

setup.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

tests/tries/test_trie.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from botok import BoSyl, Config, TokChunks, Trie
66

7-
config = Config()
8-
97

108
def syls(string):
119
return TokChunks(string).get_syls()

0 commit comments

Comments
 (0)