Фиксация изменений
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
_TEST_NEG_RE = re.compile(
|
||||
r"(?:не\s+про\s+тест|без\s+тест|кроме\s+тест|про\s+прод\s+код|только\s+прод|production\s+code)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
|
||||
class NegationDetector:
|
||||
def detect(self, text: str) -> set[str]:
|
||||
lowered = (text or "").lower()
|
||||
negations: set[str] = set()
|
||||
if _TEST_NEG_RE.search(lowered):
|
||||
negations.add("tests")
|
||||
return negations
|
||||
Reference in New Issue
Block a user