import { ExtractionRule , ExtractionScore } from './base' ; export class NonAsciiExtractionRule extends ExtractionRule { name = 'non-ascii-characters' ; shouldExtract ( str ) { const words = str . match ( /\p{Letter}*/ug ) ?? [ ] ; const containsWordWithNonAsciiChar = words . some ( word => word . match ( /[^\u{0}-\u{7F}]/u ) ) ; if ( containsWordWithNonAsciiChar ) return ExtractionScore . MustInclude ; } }