Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/taylordotfish/markov-complete

(old/unmaintained) A hackathon project written with @alyssarosenzweig. Inspired by code written by @kach and me.
https://github.com/taylordotfish/markov-complete

Last synced: 2 days ago
JSON representation

(old/unmaintained) A hackathon project written with @alyssarosenzweig. Inspired by code written by @kach and me.

Lists

README

        

_
_ __ ___ __ _ _ __| | _______ __
| '_ ` _ \ / _` | '__| |/ / _ \ \ / /
| | | | | | (_| | | | < (_) \ V /
|_| |_| |_|\__,_|_| |_|\_\___/ \_/
_ _
___ ___ _ __ ___ _ __ | | ___| |_ ___
/ __/ _ \| '_ ` _ \| '_ \| |/ _ \ __/ _ \
| (_| (_) | | | | | | |_) | | __/ || __/
\___\___/|_| |_| |_| .__/|_|\___|\__\___|
|_|

markov-complete adds Markov chain text completion to GNU Readline, Vim, and
WeeChat.

Installation
------------

To install markov-complete, run:

$ make libs
$ sudo make install-libs
$ make
$ sudo make install

A Vim plugin will be installed in /etc/vimrc/plugin. WeeChat will be installed
in /usr/local/bin/ with new default keybindings for markov-complete. You may
need to regenerate ~/.weechat/weechat.conf. You can also add the bindings
manually under the [key] section of your weechat.conf. See weechat/keys.conf.

To patch readline once you've completed the above steps, run:

$ export LD_PRELOAD=/usr/local/lib/libreadline.so.7.0

Programs which dynamically link to readline will now use the patched version.

Generating the chain
--------------------

You will need a "markov-chain" file in order to receive suggestions. Once
you've installed markov-complete, run (from this directory):

$ cd markov/markov
$ cp corpus-text
$ cat corpus-text | ./generate.py
$ ./transpile.py chain.json > markov-chain
$ sudo cp markov-chain /usr/local/share/

You can also set the environment variable MARKOV_CHAIN to specify a different
chain to use.

Usage
-----

Once you've typed a few words in a program that uses markov-complete, press
` (backtick) to autocomplete the next word. Press Ctrl+o to cycle through
Markov suggestions. Ctrl+Shift+` will enter a normal backtick.

You can use `rlwrap` to enable markov-complete with any program that runs in
canonical mode (as opposed to raw mode).

System requirements
-------------------

markov-complete has been tested on Debian stretch (9.0). It may work on other
systems (possibly with some minor modifications).

Dependencies
------------

* gcc
* g++
* make
* cmake
* libncurses5-dev
* libcurl4-openssl-dev
* zlib1g-dev
* libgcrypt20-dev
* vim-nox