Merge branch 'master' of gitlab.com:patek-devs/res-judicata

This commit is contained in:
František Kmječ
2021-01-23 09:21:34 +01:00
3 changed files with 29 additions and 10 deletions
+8 -4
View File
@@ -56,18 +56,18 @@ def validate_court(text_content: str) -> Union[Tuple[int, int], Literal[False]]:
return match.span()
def validate_accuser(text_content) -> Union[Tuple[int, int], Literal[False]]:
pass
return False
# hard to implement
def validate_topic(text_content) -> Union[Tuple[int, int], Literal[False]]:
pass
return False
# also hard to implement
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]]:
pass
return False
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]]:
@@ -82,6 +82,10 @@ def validate(text_content: str) -> object:
"checks": {
"court": validate_court(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,
}