Source code for decomp.semantics.predpatt.core.options
"""Options configuration for PredPatt extraction.This module contains the PredPattOpts class which configures the behaviorof predicate-argument extraction in the PredPatt system."""from__future__importannotationsfromtypingimportTYPE_CHECKINGifTYPE_CHECKING:pass
[docs]classPredPattOpts:"""Configuration options for PredPatt extraction. Controls various aspects of predicate-argument extraction including simplification, resolution of special constructions, and formatting. Parameters ---------- simple : bool, optional Extract simple predicates (exclude aux and advmod). Default: False. cut : bool, optional Cut: treat xcomp as independent predicate. Default: False. resolve_relcl : bool, optional Resolve relative clause modifiers. Default: False. resolve_appos : bool, optional Resolve appositives. Default: False. resolve_amod : bool, optional Resolve adjectival modifiers. Default: False. resolve_conj : bool, optional Resolve conjunctions. Default: False. resolve_poss : bool, optional Resolve possessives. Default: False. borrow_arg_for_relcl : bool, optional Borrow arguments for relative clauses. Default: True. big_args : bool, optional Use big argument extraction (include all subtree tokens). Default: False. strip : bool, optional Strip leading/trailing punctuation from phrases. Default: True. ud : str, optional Universal Dependencies version ("1.0" or "2.0"). Default: "1.0". Attributes ---------- simple : bool Extract simple predicates (exclude aux and advmod). cut : bool Cut: treat xcomp as independent predicate. resolve_relcl : bool Resolve relative clause modifiers. resolve_appos : bool Resolve appositives. resolve_amod : bool Resolve adjectival modifiers. resolve_conj : bool Resolve conjunctions. resolve_poss : bool Resolve possessives. borrow_arg_for_relcl : bool Borrow arguments for relative clauses. big_args : bool Use big argument extraction. strip : bool Strip leading/trailing punctuation. ud : str Universal Dependencies version string. """
[docs]def__init__(self,simple:bool=False,cut:bool=False,resolve_relcl:bool=False,resolve_appos:bool=False,resolve_amod:bool=False,resolve_conj:bool=False,resolve_poss:bool=False,borrow_arg_for_relcl:bool=True,big_args:bool=False,strip:bool=True,ud:str="1.0"# dep_v1.VERSION)->None:"""Initialize PredPattOpts with configuration values. Parameters are assigned in the exact same order as the original to ensure identical behavior and initialization. """# maintain exact initialization order as originalself.simple=simpleself.cut=cutself.resolve_relcl=resolve_relclself.resolve_appos=resolve_apposself.resolve_amod=resolve_amodself.resolve_poss=resolve_possself.resolve_conj=resolve_conjself.big_args=big_argsself.strip=stripself.borrow_arg_for_relcl=borrow_arg_for_relcl# validation logic - must be exactly "1.0" or "2.0"assertstr(ud)in{"1.0","2.0"},(f'the ud version "{ud!s}" is not in {{"1.0", "2.0"}}')self.ud=str(ud)