Pressagio is a free and open source predictive text system written in Python. It is similar to the text disambiguation systems that are now common on modern smartphones, where the virtual keyboard displays several alternative proposals for the next word on the screen whenever the user writes another character in a text input box (e.g. a short message or e-mail). The user might then choose one of the proposed words by touching it. The software inserts the selected word into the text that the user is currently editing. In contrast to those systems, pressagio does not only disambiguate the currently edited word but is trying to predict what the user wants to write in the future. Pressagio is a pure Python port of the C++ library presage and uses smoothed n-gram models to predict text.
# Define and create PresageCallback object
def __init__(self, buffer):
self.buffer = buffer
config_file = "example_profile.ini"
config = configparser.ConfigParser()
callback = DemoCallback("Des is a Te")
prsgio = pressagio.Pressagio(callback, config)
predictions = prsgio.predict()
The pressagio source code is distributed under the Apache 2.0 License.
Downloads are available at PyPI. It is recommended that you install pressagio via easy_install.
Pressagio is available on PyPI , so you can install via easy_install:
$ easy_install pressagio
To install graf-python from the downloaded package you need to unpack the file and start "setup.py" on the command line. Change to the directory into which you downloaded the package and unpack it:
$ tar xzf pressagio-x.y.z.tar.gz $ cd pressagio-x.y.z
Then, to install the package locally into your python repository (you may need to have root privileges):
$ python setup.py install
Visit our documentation website.
The graf-python source code is hosted on Github.