Metadata-Version: 2.4
Name: text-utils-vn
Version: 0.1.0
Summary: Các hàm tiện ích xử lý văn bản tiếng Việt
Author: Nguyen Bao Duy
License-Expression: MIT
Keywords: vietnamese,nlp,text-processing
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Vietnamese
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# text-utils-vn

Thư viện nhỏ gồm các hàm xử lý văn bản tiếng Việt: bỏ dấu, chuẩn hóa chuỗi, đếm từ và loại bỏ từ dừng (stopword).

## Cài đặt

```bash
pip install text-utils-vn
```

## Cách dùng

```python
from text_utils_vn import remove_accents, normalize_text, count_words, remove_stopwords

remove_accents("Tiếng Việt")          # 'Tieng Viet'
normalize_text("  Xin   CHÀO  bạn ")  # 'xin chào bạn'
count_words("hôm nay trời đẹp")       # 4
remove_stopwords("tôi là sinh viên")  # 'sinh viên'
```

## Các hàm

| Hàm | Mô tả |
|---|---|
| `remove_accents(text)` | Bỏ dấu tiếng Việt, kể cả chữ `đ` / `Đ` |
| `normalize_text(text)` | Chuẩn hóa Unicode (NFC), chuyển chữ thường, gộp khoảng trắng thừa |
| `count_words(text)` | Đếm số từ tách theo khoảng trắng |
| `remove_stopwords(text)` | Bỏ các từ dừng thông dụng trong một danh sách nhỏ có sẵn |

## Lưu ý

- `count_words` tách theo khoảng trắng nên thực chất đếm âm tiết, ví dụ "sinh viên" được tính là 2.
- Danh sách stopword có sẵn chỉ gồm một số từ phổ biến, mang tính minh họa.

## Chạy test

```bash
pip install -e ".[test]"
pytest
```

## Giấy phép

MIT License

