(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "natural", "rxjs/operators"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("natural"), require("rxjs/operators"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.natural, global.operators);
    global.stem = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _natural, _operators) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;

  const stem = function stem(options = {
    stemmer: 'porter'
  }) {
    const stemMapper = options.stemmer === 'lancaster' ? _natural.LancasterStemmer.stem : _natural.PorterStemmer.stem;
    return source$ => source$.pipe((0, _operators.map)(stemMapper));
  };

  var _default = stem;
  _exports.default = _default;
});
//# sourceMappingURL=stem.js.map