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