/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Span } from "mailwoman/core/tokenization";
export class PhraseClassifier {
    index;
    languages;
    constructor({ languages } = {}) {
        this.languages = languages ? Array.from(languages) : undefined;
    }
    /**
     * Perform classification on the given context.
     */
    classifyTokens(context) {
        for (const [sectionIndex, section] of context.sections.entries()) {
            const { phrases } = section;
            let phraseIndex = 0;
            for (const phrase of phrases) {
                this.explore(phrase, sectionIndex, phraseIndex);
                phraseIndex++;
            }
        }
    }
    classify(input) {
        const span = Span.from(input);
        this.explore(span);
        return span;
    }
}
//# sourceMappingURL=PhraseClassifier.js.map