How to use the wuzzy.tanimoto function in wuzzy

To help you get started, we’ve selected a few wuzzy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linanqiu / lexrank / lexrank.js View on Github external
function constructMatrix(sentences, threshold) {
    var matrix = [];
    for (var i = 0; i < sentences.length; i++) {
      matrix[i] = [];

      var sentenceA = sentences[i];

      for (var j = 0; j < sentences.length; j++) {
        var sentenceB = sentences[j];
        var value = wuzzy.tanimoto(sentenceB, sentenceA);
        if(!!threshold && value < threshold) {
          value = 0;
        }
        matrix[i][j] = value;
      }

      matrix[i] = normalize(matrix[i]);
    }
    return matrix;
  }

wuzzy

library for simularity identification

MIT
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis

Popular wuzzy functions