3.1.3 • Published 3 years ago

t9-plus v3.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

T9 Plus

Word prediction for T9 keyboard.

Install

yarn add t9-plus

Usage

With Naive Dictionary

const { T9Search } = require("t9-plus");

const t9 = new T9Search();

const words = ["animal", "baseball", "capital", "elephant", "morning"];

t9.setDict(words);

console.log(t9.predict("6666"));

With Unigram Language Model

yarn add unigram
const { T9Search } = require("t9-plus");
const { unigram } = require("unigram");

const t9 = new T9Search();

const wordsWithWeight = unigram.slice(0, 20000);

const map = new Map();

for (let i = 0; i < wordsWithWeight.length; i++) {
  map.set(wordsWithWeight[i]["word"], wordsWithWeight[i]["freq"]);
}

t9.setDictWithWeight(map);

console.log(t9.predict("6666"));
3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago