Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/high-moctane/nextword

Predict next English words.
https://github.com/high-moctane/nextword

english nextword

Last synced: 14 days ago
JSON representation

Predict next English words.

Awesome Lists containing this project

README

        

# Nextword

## **🎉 NEW PREDICTION ENGINE [MOCWORD](https://github.com/high-moctane/mocword) IS AVAILABLE 🎉**

[Mocword](https://github.com/high-moctane/mocword) is more advanced engine than Nextword.

- Less data file size
- 1.63GB (Nextword) -> 655MB (Mocword)
- Using latest Google Ngram dataset
- 2012 data (Nextword) -> 2020 data (Mocword)
- More appropriate prediction
- Less noisy vocabularies

---

Predict a next English word.

![gif](img/terminal.gif)

## Installing

1. [**IMPORTANT**] Install [Nextword-data (https://github.com/high-moctane/nextword-data)](https://github.com/high-moctane/nextword-data)

2. Visit [Releases](https://github.com/high-moctane/nextword/releases) page and
download an appropriate binary for your architecture.

NOTE: You can also compile this project manually if you want.

```
$ go get -u github.com/high-moctane/nextword
```

## Usage

```
$ nextword -h
Nextword prints the most likely English words that follow the stdin sentence.

Usage of /Users/moctane/go/bin/nextword:
-g
show as many result as possible
-n
max candidates number (default 10)
-d string
path to the data directory (default "/path/to/nextword-data")
-h show this message
-v show version

You need to install nextword-data and set "NEXTWORD_DATA_PATH" environment variable.
It available at https://github.com/high-moctane/nextword-data

The result depends on whether the input string ends with a space character.
If the string does not end with a space, nextword will print candidate words which
begin the last word in the sentence.

Example:
input: "Alice was "
output: "not a the in still born very so to beginning too at sitting ..."

input: "Alice w"
output: "was would were went with will who wrote when wants ..."
```

## Testing

For testing, you need to install nextword-data **LARGE** version and set
`NEXTWORD_TEST_DATA_PATH` environment variable in advance.

```
$ go test
```

## License

MIT