mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Create extramath-test.js
This commit is contained in:
parent
329f1b1bfe
commit
e08df0578e
19
extramath-test.js
Normal file
19
extramath-test.js
Normal 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;
|
Loading…
Reference in New Issue
Block a user