https://github.com/bfontaine/trigrams
Trigrams-based random text generation
https://github.com/bfontaine/trigrams
library python text-generation trigrams
Last synced: about 1 year ago
JSON representation
Trigrams-based random text generation
- Host: GitHub
- URL: https://github.com/bfontaine/trigrams
- Owner: bfontaine
- License: mit
- Created: 2014-06-14T22:06:05.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T06:44:41.000Z (about 5 years ago)
- Last Synced: 2025-03-23T23:43:42.276Z (about 1 year ago)
- Topics: library, python, text-generation, trigrams
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
========
trigrams
========
.. image:: https://img.shields.io/travis/bfontaine/trigrams.png
:target: https://travis-ci.org/bfontaine/trigrams
:alt: Build status
.. image:: https://coveralls.io/repos/bfontaine/trigrams/badge.png?branch=master
:target: https://coveralls.io/r/bfontaine/trigrams?branch=master
:alt: Coverage status
.. image:: https://img.shields.io/pypi/v/trigrams.png
:target: https://pypi.python.org/pypi/trigrams
:alt: Pypi package
.. image:: https://img.shields.io/pypi/dm/trigrams.png
:target: https://pypi.python.org/pypi/trigrams
``trigrams`` is a simple trigrams-based random text generation Python module.
Install
-------
.. code-block::
[sudo] pip install trigrams
The library works with both Python 2.x and 3.x.
Usage
-----
`Read the docs`_. ::
from trigrams import TrigramsDB
db = TrigramsDB()
db.feed("My interesting text")
for f in ['source1.txt', 'source2.txt', 'source3.txt']:
db.feed(source=f)
print db.generate()
.. _Read the docs: http://trigrams.readthedocs.org/en/latest/api_reference.html