bekindprofanityfilter 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * Universal context patterns for multi-language profanity detection
3
3
  */
4
4
  export interface UniversalContextPattern {
5
- type: "negation" | "possessive" | "compound" | "proper_noun" | "article" | "quotation" | "medical" | "anatomical" | "sexual_verb_before" | "sexual_verb_after" | "compound_slur" | "insult_construction" | "direct_address" | "pejorative_adj";
5
+ type: "negation" | "possessive" | "compound" | "proper_noun" | "article" | "quotation" | "medical" | "anatomical" | "sexual_verb_before" | "sexual_verb_after" | "compound_slur" | "insult_construction" | "direct_address" | "pejorative_adj" | "bird_species" | "bird_species_after" | "birdwatching_context";
6
6
  pattern: RegExp;
7
7
  weight: number;
8
8
  delta: number;
@@ -344,6 +344,10 @@ export interface ScoredWord {
344
344
  word: string;
345
345
  /** Severity classification for this specific word */
346
346
  severity: WordSeverity;
347
+ /** Which detection method found this match (for debugging/reproduction) */
348
+ detectionMethod?: DetectionMethod;
349
+ /** Context snippet showing the match within surrounding text, e.g. "for [a hou]se after" */
350
+ context?: string;
347
351
  }
348
352
  /**
349
353
  * Result object returned from profanity detection operations.
@@ -444,6 +448,8 @@ export interface SuspiciousPhrase {
444
448
  originalText: string;
445
449
  /** Surrounding context: ±5 words around the suspicious match */
446
450
  context: string;
451
+ /** Context with match boundaries highlighted, e.g. "for [a hou]se after" */
452
+ contextWithMatch: string;
447
453
  /** Start position of the match in the original text */
448
454
  start: number;
449
455
  /** End position of the match in the original text */
@@ -456,6 +462,8 @@ export interface SuspiciousPhrase {
456
462
  /** Number of space boundaries crossed to form this match */
457
463
  spaceBoundaries: number;
458
464
  }
465
+ /** How a profane word was detected — useful for debugging false positives */
466
+ export type DetectionMethod = "direct" | "leet-symbol" | "leet-full" | "separator-tolerant" | "embedded";
459
467
  /**
460
468
  * BeKind - Professional-grade multilingual profanity detection and filtering library.
461
469
  *