The pressagio library

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.

Example

import configparser

import pressagio.callback
import pressagio

# Define and create PresageCallback object
class DemoCallback(pressagio.callback.Callback):
    def __init__(self, buffer):
        super().__init__()
        self.buffer = buffer

    def past_stream(self):
        return self.buffer
    
    def future_stream(self):
        return ''

config_file = "example_profile.ini"
config = configparser.ConfigParser()
config.read(config_file)

callback = DemoCallback("Des is a Te")
prsgio = pressagio.Pressagio(callback, config)

predictions = prsgio.predict()

License

The pressagio source code is distributed under the Apache 2.0 License.

Download

Downloads are available at PyPI. It is recommended that you install pressagio via easy_install.

Installation

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

Documentation

Visit our documentation website.

Support and bug reports

You can post comments and questions about pressagio in the Poio User Group. For bug reports please create an issue on Github.

Repository

The graf-python source code is hosted on Github.

CIDLeS Homepage

Support Us

CIDLeS on Facebook: cidles.eu/fb