Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

high-moctane/nextword

Repository files navigation

Nextword

🎉 NEW PREDICTION ENGINE MOCWORD IS AVAILABLE 🎉

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

Installing

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

  2. Visit 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

About

Predict next English words.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages