Create extramath-test.js

This commit is contained in:
Namhyeon Go 2022-11-06 21:50:51 +09:00 committed by GitHub
parent 329f1b1bfe
commit e08df0578e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
extramath-test.js Normal file
View File

@ -0,0 +1,19 @@
var ExtraMath = require("lib/extramath");
function main(args) {
var a = "this is an apple";
var b = "this is red apple";
var dtm = new ExtraMath.DTM();
dtm.add(a);
dtm.add(b);
var mat = dtm.toArray();
console.log(mat[0].join(' '));
console.log(mat[1].join(' '));
console.log(String(ExtraMath.cos(mat[0], mat[1])));
console.log(String(ExtraMath.measureSimilarity(a, b)));
}
exports.main = main;