/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Alpha2LanguageCode, prepareLocaleIndex, WordClassifier } from "mailwoman/core";
export class UnitDesignatorClassifier extends WordClassifier {
    async ready() {
        const languages = this.languages ?? [Alpha2LanguageCode.English];
        this.index = await prepareLocaleIndex(languages, "unit_types_numbered.txt");
        return this;
    }
    explore(span) {
        if (span.flags.has("numeral"))
            return;
        const languages = this.index.get(span.normalized);
        if (languages) {
            span.classifications.add({
                classification: "unit_designator",
                languages,
            });
        }
    }
}
//# sourceMappingURL=UnitDesignatorClassifier.js.map