code: function kmp(s, w) {
      if (kmp.isNumber(w)) w = ''+w;
      if (kmp.isNumber(s)) s = ''+s;
      if (!(kmp.isString(s) || kmp.isArray(s))) return -1;
      if (!(kmp.isString(w) || kmp.isArray(w))) return -1;
      var m = 0; // start of s
      var i = 0; // start of w
      var t = kmp.table(w);
  
      while (m + i < s.length) {
        if (w[i] === s[m+i]) {
          if (i === w.length - 1) {
            return m;
          }
          i = i + 1;
        } else {
          if (t[i] > -1) {
            m = m+i - t[i];
            i = t[i];
          } else {
            i = 0;
            m = m + 1;
          }
        }
      }
  
      return -1;
    }
docs: kmp
  @desc Search for occurances of word in string.
  @param {string} string - text string
  @param {string} word - search word