Differences From Artifact [7b239f9b34]:
- File graphspell-js/str_transform.js — part of check-in [8e5a2f5900] at 2018-08-07 08:09:50 on branch trunk — [graphspell][core][fx][tb][js] get rid of console.log() substitutes, assuming now default console is available from everywhere (eh, print now works as expected in JS! The JS pile of shit is decreasing a little) (user: olr, size: 8278) [annotate] [blame] [check-ins using]
To Artifact [63ae767339]:
- File graphspell-js/str_transform.js — part of check-in [874cb415e9] at 2018-10-05 20:22:57 on branch trunk — [graphspell] str_transform: function getNgrams() (user: olr, size: 8486) [annotate] [blame] [check-ins using]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + + + + + + + | //// STRING TRANSFORMATION /*jslint esversion: 6*/ "use strict"; // Note: 48 is the ASCII code for "0" var str_transform = { getNgrams: function (sWord, n=2) { let lNgrams = []; for (let i=0; i <= sWord.length - n; i++) { lNgrams.push(sWord.slice(i, i+n)); } return lNgrams; }, longestCommonSubstring: function (string1, string2) { // https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring // untested // init max value let longestCommonSubstring = 0; |
︙ |