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

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  const defaultTokenizer = new _natural.WordTokenizer();
  const defaultOptions = {
    tokenizer: params => defaultTokenizer.tokenize(params)
  };

  const tokenize = function tokenize(options = defaultOptions) {
    return string$ => string$.pipe((0, _operators.map)(str => options.tokenizer(str)), (0, _operators.mergeMap)(words => (0, _rxjs.of)(...words)));
  };

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