def make_doc_field_detector(self) -> DocumentFieldDetector:
     detector = DocumentFieldDetector()
     detector.exclude_regexps = 'cushion'
     detector.include_regexps = r'(?<=\D{3,3}\s\D{5,5}\s)\D+'
     detector.detected_value = 'shall'
     detector.extraction_hint = None
     return detector
Example #2
0
 def make_doc_field_detector(
         self,
         exclude_regexps: Optional[str] = None,
         include_regexps: Optional[str] = None,
         detected_value: Optional[str] = None) -> DocumentFieldDetector:
     detector = DocumentFieldDetector()
     detector.exclude_regexps = exclude_regexps if exclude_regexps is not None else 'cushion'
     detector.include_regexps = include_regexps if include_regexps is not None else r'(?<=\D{3,3}\s\D{5,5}\s)\D+'
     detector.detected_value = detected_value if detected_value is not None else 'shall'
     detector.extraction_hint = 'detected'
     return detector
 def make_doc_field_detector(exclude_regexps: Optional[str] = None,
                             include_regexps: Optional[str] = None,
                             detected_value: Optional[str] = None,
                             regexps_pre_process_lower: bool = True,
                             definition_words: Optional[str] = None) -> DocumentFieldDetector:
     detector = DocumentFieldDetector()
     detector.exclude_regexps = exclude_regexps if exclude_regexps is not None else 'cushion'
     detector.include_regexps = include_regexps if include_regexps is not None else r'(?<=\D{3,3}\s\D{5,5}\s)\D+'
     if detected_value is not None:
         detector.detected_value = detected_value
     detector.extraction_hint = 'TAKE_FIRST'  # 'detected'
     detector.text_part = 'INSIDE_REGEXP'
     detector.regexps_pre_process_lower = regexps_pre_process_lower
     detector.definition_words = definition_words
     return detector