Source: stop_word_filter.js

 * lunr.stopWordFilter
 * Copyright (C) @YEAR Oliver Nightingale

 * lunr.generateStopWordFilter builds a stopWordFilter function from the provided
 * list of stop words.
 * The built in lunr.stopWordFilter is built using this generator and can be used
 * to generate custom stopWordFilters for applications or non English languages.
 * @function
 * @param {Array} token The token to pass through the filter
 * @returns {lunr.PipelineFunction}
 * @see lunr.Pipeline
 * @see lunr.stopWordFilter
lunr.generateStopWordFilter = function (stopWords) {
  var words = stopWords.reduce(function (memo, stopWord) {
    memo[stopWord] = stopWord
    return memo
  }, {})

  return function (token) {
    if (token && words[token.toString()] !== token.toString()) return token

 * lunr.stopWordFilter is an English language stop word list filter, any words
 * contained in the list will not be passed through the filter.
 * This is intended to be used in the Pipeline. If the token does not pass the
 * filter then undefined will be returned.
 * @function
 * @implements {lunr.PipelineFunction}
 * @params {lunr.Token} token - A token to check for being a stop word.
 * @returns {lunr.Token}
 * @see {@link lunr.Pipeline}
lunr.stopWordFilter = lunr.generateStopWordFilter([

lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')