Skip to main content

A simple module to translate plain English to Nigerian (Naija) pidgin English.

Project description

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.txt

    This command translates the entire file english.txt located in the current working directory.

  • Help text

    To print the help text, use:

    $ sabi -h
    $ sabi --help

    And 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.

Authors

  • Kolawole Olalekan (andrewolakola@gmail.com)

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.py file.

  • Fixed installation requirements bugs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sabi-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

sabi-0.1.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file sabi-0.1.2.tar.gz.

File metadata

  • Download URL: sabi-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for sabi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4240910d3b4f97f54718564292cf09b791903d0f728cbb6691b21eab66f50bf9
MD5 9351fe5d821001f2649b1a654c34a452
BLAKE2b-256 f69fe03b1e50bf2cfc151f3cbead1502b2f54e08457752fe667bcf9c230b38cc

See more details on using hashes here.

File details

Details for the file sabi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sabi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for sabi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a44dc446ee89435ccbf479893155e8ad6703cac8ec154705a80f4327ff00138a
MD5 fbfbd27f13f0844b00bfb187645b0052
BLAKE2b-256 db72f74c06790082fc804bb77da89eb61b6fae786f4e8db9ce86b4a1ce77525e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page