Generate nonsense words in any language by corpus analysis
Project description
========
momblish
========
Momblish is a library for generating fake words in any phoenetic.
http://mentalfloss.com/article/69880/7-fake-words-ended-dictionary
It is named after a "fake" word put into the OED on accident.
Momblish uses trigram analysis to generate (mostly) pronounacble gibberish - so
it can be used for any language that can be n-gram analyzed.
Description
===========
To use moblish, import it -
.. code:: python
from momblish import Momblish
m = Momblish.english()
Currently - only the english corpus is available.
Each time you load the English momblish it will perform an analysis on
`/usr/share/dict` and use that data to generate nonsense words.
To avoid this computation overhead, you can save the pre-analyzed corpus
as a file and read it in on demand.
.. code:: python
from mombmlish import Momblish
from momblish.corpus import Corpus
m = Momblish.english()
m.corpus.save('/tmp/corpus.json')
c = Corpus.load('/tmp/corpus.json')
n = Momblish(c)
To get Momblish to generate words for you call `word` on a Momblish instance.
`sentence` will make a generator you can feed to your program to make word lists
of varying length.
.. code:: python
m.word() #= > 'PONESSAL'
m.word(10) #= > 'MIDONIHYLA'
w = m.sentence() #= > <generator object Momblish.sentence at 0x10513dc78>
next(w) #= > 'TICK'
next(w) #= > 'DRIXY'
next(w) #= > 'UNREA'
m.sentence(3, word_length=5) #= > ['LEDGE', 'DEAKA', 'HONGI']
Note
====
This project has been set up using PyScaffold 3.1. For details and usage
information on PyScaffold see https://pyscaffold.org/.
momblish
========
Momblish is a library for generating fake words in any phoenetic.
http://mentalfloss.com/article/69880/7-fake-words-ended-dictionary
It is named after a "fake" word put into the OED on accident.
Momblish uses trigram analysis to generate (mostly) pronounacble gibberish - so
it can be used for any language that can be n-gram analyzed.
Description
===========
To use moblish, import it -
.. code:: python
from momblish import Momblish
m = Momblish.english()
Currently - only the english corpus is available.
Each time you load the English momblish it will perform an analysis on
`/usr/share/dict` and use that data to generate nonsense words.
To avoid this computation overhead, you can save the pre-analyzed corpus
as a file and read it in on demand.
.. code:: python
from mombmlish import Momblish
from momblish.corpus import Corpus
m = Momblish.english()
m.corpus.save('/tmp/corpus.json')
c = Corpus.load('/tmp/corpus.json')
n = Momblish(c)
To get Momblish to generate words for you call `word` on a Momblish instance.
`sentence` will make a generator you can feed to your program to make word lists
of varying length.
.. code:: python
m.word() #= > 'PONESSAL'
m.word(10) #= > 'MIDONIHYLA'
w = m.sentence() #= > <generator object Momblish.sentence at 0x10513dc78>
next(w) #= > 'TICK'
next(w) #= > 'DRIXY'
next(w) #= > 'UNREA'
m.sentence(3, word_length=5) #= > ['LEDGE', 'DEAKA', 'HONGI']
Note
====
This project has been set up using PyScaffold 3.1. For details and usage
information on PyScaffold see https://pyscaffold.org/.
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
momblish-0.0.1.tar.gz
(18.2 kB
view details)
Built Distribution
File details
Details for the file momblish-0.0.1.tar.gz
.
File metadata
- Download URL: momblish-0.0.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fd785907b80092db992d9ae43270fff32c408e76477d93ef542cced2c2f5f8b |
|
MD5 | 40435e4433bd893b2775ed407846b810 |
|
BLAKE2b-256 | da003485fef1a537c7427da2664556319b1490a47e7a340995f0e8c086080052 |
Provenance
File details
Details for the file momblish-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: momblish-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d4016540ff8fe70dc18c81f667546f89493210bdb43480a12bc87428101fb65 |
|
MD5 | 8eb0602517ed00ff6e6cda6182385ec8 |
|
BLAKE2b-256 | 74730e22430c81cf28f59c3968410557188f1ea947c495ee4aa042fe8e85b398 |