1.0.0 • Published 1 year ago

t9.js v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

T9.JS

A T9 phone number pad text predictor.

Initialized with a dictionary of word possibilities and a numeric input, the t9 library will search the dictionary for all possible matches.

Installation

npm install t9

Usage

var t9 = require('t9');

var dictionary = [
  'gelatin',
  'hair gel',
  'hello',
  'help',
  'today',
  'tomorrow',
  'world',
  'yesterday',
];

var input = '435';

var obj = t9(dictionary);

var results = obj.getWords(input);

console.log(results); // ['gelatin', 'hairgel', 'hello', 'help']