Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(
self,
nlp,
language="en",
ent_types=list(),
psuedo_negations=list(),
preceding_negations=list(),
following_negations=list(),
termination=list(),
chunk_prefix=list(),
):
if not language in LANGUAGES:
raise KeyError(
f"{language} not found in languages termset. "
"Ensure this is a supported language or specify "
"your own termsets when initializing Negex."
)
termsets = LANGUAGES[language]
if not Span.has_extension("negex"):
Span.set_extension("negex", default=False, force=True)
if not psuedo_negations:
if not "psuedo_negations" in termsets:
raise KeyError("psuedo_negations not specified for this language.")
psuedo_negations = termsets["psuedo_negations"]
if not preceding_negations:
if not "preceding_negations" in termsets: