index.js
function grams(value) {
    var nGrams = []
    var index

    if (value === null || value === undefined) {
      return nGrams
    }

    value = value.slice ? value : String(value)
    index = value.length - n + 1

    if (index < 1) {
      return nGrams
    }

    while (index--) {
      nGrams[index] = value.slice(index, index + n)
    }

    return nGrams
  }
function grams(value) {
    var nGrams = []
    var index

    if (value === null || value === undefined) {
      return nGrams
    }

    value = value.slice ? value : String(value)
    index = value.length - n + 1

    if (index < 1) {
      return nGrams
    }

    while (index--) {
      nGrams[index] = value.slice(index, index + n)
    }

    return nGrams
  }
function grams ( value ) { var nGrams = [ ] var index if ( value === null || value === undefined ) { return nGrams } value = value . slice ? value : String ( value ) index = value . length - n + 1 if ( index < 1 ) { return nGrams } while ( index -- ) { nGrams [ index ] = value . slice ( index , index + n ) } return nGrams }
Create n-grams from a given value.
Create n - grams from a given value .