// engine/spec-format/copula-blacklist.ts — SPEC-724: Copula verb blacklist for BDD validator.
import { stripFencedBlocks } from './text-fences.js';
/** Spanish copulative verbs that indicate non-testable, state-describing criteria. */
export const COPULA_VERBS_ES = ['es', 'son', 'está', 'están', 'tiene', 'tienen'];
/** English copulative verbs that indicate non-testable, state-describing criteria. */
export const COPULA_VERBS_EN = ['is', 'are', 'has', 'have', 'exists', 'contains'];
/**
 * Check whether text contains a copulative verb outside of fenced code blocks.
 *
 * @param text - The markdown text to check (fences stripped before scanning).
 * @param lang - Language to check: 'es' (Spanish only), 'en' (English only), or 'auto' (both).
 * @returns Result with hit flag, matched verb, and character index in the stripped text.
 */
export function containsCopula(text, lang) {
    const stripped = stripFencedBlocks(text);
    const verbs = lang === 'es'
        ? COPULA_VERBS_ES
        : lang === 'en'
            ? COPULA_VERBS_EN
            : [...COPULA_VERBS_ES, ...COPULA_VERBS_EN];
    for (const verb of verbs) {
        // Word-boundary match, case-insensitive
        const regex = new RegExp(`\\b${verb}\\b`, 'i');
        const match = regex.exec(stripped);
        if (match !== null) {
            return { hit: true, verb, index: match.index };
        }
    }
    return { hit: false };
}
//# sourceMappingURL=copula-blacklist.js.map