"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const characterClassifier = require("./characterClassifier.js");
class WordCharacterClassifier extends characterClassifier.CharacterClassifier {
  constructor(wordSeparators) {
    super(
      0
      /* Regular */
    );
    for (let i = 0, len = wordSeparators.length; i < len; i++) {
      this.set(
        wordSeparators.charCodeAt(i),
        2
        /* WordSeparator */
      );
    }
    this.set(
      32,
      1
      /* Whitespace */
    );
    this.set(
      9,
      1
      /* Whitespace */
    );
  }
}
function once(computeFn) {
  const cache = {};
  return (input) => {
    if (!cache.hasOwnProperty(input)) {
      cache[input] = computeFn(input);
    }
    return cache[input];
  };
}
const getMapForWordSeparators = once((input) => new WordCharacterClassifier(input));
exports.WordCharacterClassifier = WordCharacterClassifier;
exports.getMapForWordSeparators = getMapForWordSeparators;
