Smith-Walterman Scoring
This module is based on the Smith–Waterman algorithm. This algorithm allows us to compute the alignment of two arrays of elements.
The origin source is here
Install
$ yarn add smith-walterman-score
or
$ npm install smith-walterman-score
Usage
const smtihWaltermanScore = ; const options = gap: -1 mismatch: -2 match: 2; // example to compare two wordsconst test1A = 'Hello';const test1B = 'Helo';const result1 = ;console;/*=> { finalQ: [ 'H', 'e', 'l', 'l', 'o' ], finalP: [ 'H', 'e', {}, 'l', 'o' ], // {} is a gap score: 7 }*/ // example to compare two sentencesconst test2A = 'I\'m a little boy';const test2B = 'I\'m a big boy';const result2 = ;console;/*=> { finalQ: [ "I'm", 'a' ], finalP: [ "I'm", 'a' ], score: 4 }*/