Customize a word set, and then use the words in this set to represent any sentence.
Project description
Animal Language
Customize a word set, and then use the words in this set to represent any sentence.
Install
pip install --upgrade animal-language
Usage
To encode a sentence with these characters and words:
m, oo, b, aa, z
(or use moo, baa, zzz, but it will increase the encoded string's length)
1) Create a Translater
from animal_language import ALTranslater
translater = ALTranslater(['m', 'oo', 'b', 'aa', 'z'])
2) Encode Any String
use the translater to encode any string you want.
encoded_str = translater.encode('hello, this is a test')
The encoded_str will be like :
oooombbooboozmmbaabbmooaaoobaambzzooaaaaaazmbmbooaam
3) Decode the Encoded String
Also use the translater to decode the encoded_str.
decoded_str = translater.decode(encoded_str)
The decoded_str is equal to the string you encoded
Other Information
- The word list must be like "prefix codes", lists like
['a', 'ab']
will not supported. - You can set the encoding of the input string.
- JUST HAVE FUN AND ENJOY THIS bmoooombaaooooaambooz !
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
animal-language-0.1.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for animal_language-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae57237011d87352f1e5719afe9783805d42aaac496a525d8c9810e54fff4eb |
|
MD5 | e982a8eed241d6023f9a015e3b6d3296 |
|
BLAKE2b-256 | eacd2a9d217c73f0ded783b55142263e515d627309c39189762834f387348083 |