Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vectorizer

Convert an Array of Strings to an Array of Numbers with an Index and vice versa

usage

vectorize

const vectorize = require("vectorizer/vectorize");

const tokens = ["2x76882","8","2x10","8","2x2"];
const { index, vector } = vectorize(tokens);
// index is [ '8', '2x76882', '2x10', '2x2' ]
// vector is [ 1, 0, 2, 0, 3 ]

unvectorize

const unvectorize = require("vectorizer/unvectorize");

const index = [ '8', '2x76882', '2x10', '2x2' ];
const vector = [ 1, 0, 2, 0, 3 ];
const data = unvectorize({ index, vector });
// data is ["2x76882","8","2x10","8","2x2"]

support

Post an issue at https://github.com/Mak4Lab/vectorizer/issues

About

Convert an Array of Strings to an Array of Numbers with an Index and vice versa

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages