mock remaining validations
This commit is contained in:
parent
487e1094ce
commit
2098ed7508
@ -41,18 +41,18 @@ def validate_court(text_content: str) -> Union[Tuple[int, int], Literal[False]]:
|
|||||||
return match.span()
|
return match.span()
|
||||||
|
|
||||||
def validate_accuser(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
def validate_accuser(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
||||||
pass
|
return False
|
||||||
|
|
||||||
# hard to implement
|
# hard to implement
|
||||||
def validate_topic(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
def validate_topic(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
||||||
pass
|
return False
|
||||||
|
|
||||||
# also hard to implement
|
# also hard to implement
|
||||||
def validate_intent(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
def validate_intent(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
||||||
pass
|
return False
|
||||||
|
|
||||||
def validate_signature(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
def validate_signature(text_content) -> Union[Tuple[int, int], Literal[False]]:
|
||||||
pass
|
return False
|
||||||
|
|
||||||
date_and_place_pat = re.compile(r"\bve?\s+[^\n]+(?:\s|[.,\-–—:])+(?:dne)?(?:\s|[.,\-–—:])+\d+\.", flags=re.IGNORECASE)
|
date_and_place_pat = re.compile(r"\bve?\s+[^\n]+(?:\s|[.,\-–—:])+(?:dne)?(?:\s|[.,\-–—:])+\d+\.", flags=re.IGNORECASE)
|
||||||
def validate_date_and_place(text_content: str) -> Union[Tuple[int, int], Literal[False]]:
|
def validate_date_and_place(text_content: str) -> Union[Tuple[int, int], Literal[False]]:
|
||||||
@ -67,6 +67,10 @@ def validate(text_content: str) -> object:
|
|||||||
"checks": {
|
"checks": {
|
||||||
"court": validate_court(text_content),
|
"court": validate_court(text_content),
|
||||||
"date_and_place": validate_date_and_place(text_content),
|
"date_and_place": validate_date_and_place(text_content),
|
||||||
|
"accuser": validate_accuser(text_content),
|
||||||
|
"topic": validate_topic(text_content),
|
||||||
|
"intent": validate_intent(text_content),
|
||||||
|
"signature": validate_signature(text_content),
|
||||||
},
|
},
|
||||||
"parsed_content": text_content,
|
"parsed_content": text_content,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user