docs: function ruleWeight (inside, text, maxSubseqLen, i, j, k, opt) {
    var rhsLen = opt.rhs.length
    if ((rhsLen === 0 && i !== j) || (rhsLen === 1 && k < j))
      return 0
    var w = opt.weight
    for (var pos = 0; w && pos < rhsLen; ++pos) {
      var node = opt.rhs[pos]
      var start = pos ? k : i, len = pos ? (j-k) : (k-i), idx = len
      if (start && len > maxSubseqLen) {
        if (start + len === text.length)
          idx = maxSubseqLen + 1
        else
          return 0
      }
      var insideCell
      w *= (node.type === 'term'
  	  ? (node.text.length === len && node.text === text.substr(start,len) ? 1 : 0)
  	  : (((insideCell = inside[start][idx]) && insideCell[node.rank]) || 0))
    }
    return w
  }