/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Classifications, phraseMatchesScheme, Span } from "mailwoman/core";
import test from "tape";
const PositiveMatchID = "PositiveMatch";
const NegativeMatchID = "NegativeMatch";
Classifications.add(PositiveMatchID);
Classifications.add(NegativeMatchID);
test("match: scheme.is multi-token", (t) => {
    const scheme = {
        is: [PositiveMatchID],
    };
    const phrase = Span.from("Test Phrase");
    t.false(phraseMatchesScheme(scheme, phrase));
    phrase.classifications.add(PositiveMatchID);
    t.true(phraseMatchesScheme(scheme, phrase));
    t.end();
});
test("match: scheme.is single-token", (t) => {
    const scheme = {
        is: [PositiveMatchID],
    };
    const phrase = Span.from("Test");
    t.false(phraseMatchesScheme(scheme, phrase));
    const child = Span.from("Test");
    phrase.children.add(child);
    child.classifications.add(PositiveMatchID);
    t.true(phraseMatchesScheme(scheme, phrase));
    t.end();
});
test("match: scheme.not multi-token", (t) => {
    const scheme = {
        is: [PositiveMatchID],
        classification: PositiveMatchID,
        not: [NegativeMatchID],
    };
    const phrase = Span.from("Test Phrase");
    t.false(phraseMatchesScheme(scheme, phrase));
    phrase.classifications.add(PositiveMatchID);
    t.true(phraseMatchesScheme(scheme, phrase));
    phrase.classifications.add(NegativeMatchID);
    t.false(phraseMatchesScheme(scheme, phrase));
    t.end();
});
test("match: scheme.not single-token", (t) => {
    const scheme = {
        is: [PositiveMatchID],
        not: [NegativeMatchID],
    };
    const phrase = Span.from("Test");
    t.false(phraseMatchesScheme(scheme, phrase));
    const child = Span.from("Test");
    phrase.children.add(child);
    child.classifications.add(PositiveMatchID);
    t.true(phraseMatchesScheme(scheme, phrase));
    child.classifications.add(NegativeMatchID);
    t.false(phraseMatchesScheme(scheme, phrase));
    t.end();
});
//# sourceMappingURL=CompositeClassifier.test.js.map