t9.js

1.0.0 • Public • Published

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']

Package Sidebar

Install

npm i t9.js

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

40.4 kB

Total Files

5

Last publish

Collaborators

  • hytea