/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Span } from "mailwoman/core/tokenization";
export class SectionClassifier {
    classifyTokens(context) {
        for (const section of context.sections) {
            this.explore(section);
        }
    }
    classify(input) {
        const span = Span.from(input);
        this.explore(span);
        return span;
    }
    /**
     * Find all phrases containing a child span.
     */
    static findPhrasesContaining(section, child) {
        return Iterator.from(section.phrases).filter((phrase) => {
            return Iterator.from(phrase.children).some((phraseChild) => phraseChild === child);
        });
    }
}
//# sourceMappingURL=SectionClassifier.js.map