Sabi - Translate plain English to Naija pidgin
A simple module to translate plain English to Nigerian (Naija) pidgin English.
I had been planning on writing a Python package (academic reasons) and had been researching. Then I encountered arrr.py while doing some Python study - so I decided, why not? And the result? na you SABI.
There is the pidginUNMT project, which is more than capable for the job, but then - there’s numpy and there’s pandas.
sabi - tok like sabi pesin
Installation
To install using pip, run:
$ pip install sabi
Usage Example
Here are some examples of how to use the sabi package:
A simple translation
from sabi import translate text = "Hello World" pidgin = translate(text) print(pidgin)Translating from a file into another file
from sabi import Translator with Translator('english.txt', 'pidgin.txt', ajasa=False) as translated: if translated is True: print('Translated!')Using a decorator
from sabi import translator @translator(ajasa=True) def word(text: str) -> str: return text word("How are you")
Trivial right? Uuugh! I know.
Command-line Usage
After installing sabi, you can run it from your shell as follows:
Translate text
$ sabi --oyinbo 'how are you'This command will translate the text how are you into its pidgin equivalent.
Translate a file
$ sabi --long-tok english.txt --out-file pidgin.txtThis command translates the entire file english.txt located in the current working directory.
Help text
To print the help text, use:
$ sabi -h $ sabi --helpAnd for a more sabi boi help text, use:
$ sabi
Contribution
This project is still quite buggy and is under active development. Contributing to this project would be greatly appreciated. Currently, there are no codes of conduct (working on it).
The source code for this project is hosted on GitHub: https://github.com/techkaduna/sabi. Everyone is free to contribute, and I’d really appreciate it.
Release History
0.0.1
Initial Release.
0.1.1
Sabi boy don land: sabi package was published.
0.1.2
Added more sabi boi tunes.
Added output file as a Translator context manager parameter.
Added tests.
Fixed installation requirements bugs.
0.1.3
Added some more sabi boi tunes, removed some ambigious ones.
Fixed the actual install_requires ‘slip-of-the-mind’.
Handled error with sability.
Added version arguments.
Metadata
Release files for sabi 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sabi-0.1.3.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sabi-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / sabi-0.1.3.tar.gz
| Download URL | sabi-0.1.3.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c646b684a7ec5c63db363d23471c1aad11eb23ba1b78ed5624ba6011d0ff4965
|
|
BLAKE2b-256 checksum How to use checksums |
01d0ad2d838cfa7c274fc40c4ae51db3721c544b4cc3e46be2b9561cd30b0cf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / sabi-0.1.3-py3-none-any.whl
| Download URL | sabi-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3423d4efaff67a89a4471d923841bec8d1f1c6f10cdc86cc558c5fbdd987678
|
|
BLAKE2b-256 checksum How to use checksums |
6f9eac318e3ed731788b5dfd3cc9f29a3f4c6df42fcc0d6599e3ab4491bbff24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|