UNPKG

llmverify

Version:

AI Output Verification Toolkit — Local-first LLM safety, hallucination detection, PII redaction, prompt injection defense, and runtime monitoring. Zero telemetry. OWASP LLM Top 10 aligned.

44 lines (43 loc) 1.09 kB
/** * Text Processing Utilities * * @module utils/text * @author Haiec * @license MIT */ /** * Split text into sentences */ export declare function splitSentences(text: string): string[]; /** * Split text into paragraphs */ export declare function splitParagraphs(text: string): string[]; /** * Truncate text to max length */ export declare function truncate(text: string, maxLen: number): string; /** * Extract surrounding context */ export declare function extractContext(text: string, index: number, windowSize: number): string; /** * Normalize whitespace */ export declare function normalizeWhitespace(text: string): string; /** * Count words in text */ export declare function countWords(text: string): number; /** * Check if text contains code blocks */ export declare function containsCodeBlocks(text: string): boolean; /** * Remove code blocks from text */ export declare function removeCodeBlocks(text: string): string; /** * Check if text is likely quoted/example content */ export declare function isLikelyQuoted(text: string, match: string): boolean;