Example #1
0
 def parse(self, log: ProcessLogger, text, text_unit_id, _text_unit_lang, **kwargs) -> ParseResults:
     found = list(regulations.get_regulation_annotations(text))
     if found:
         unique = set(found)
         return ParseResults({RegulationUsage: [RegulationUsage(text_unit_id=text_unit_id,
                                                                regulation_type=item.source,
                                                                regulation_name=item.name,
                                                                count=found.count(item)) for item in unique]})
Example #2
0
 def parse(self, text, text_unit_id, _text_unit_lang,
           **kwargs) -> ParseResults:
     found = list(regulations.get_regulations(text))
     if found:
         unique = set(found)
         return ParseResults({
             RegulationUsage: [
                 RegulationUsage(text_unit_id=text_unit_id,
                                 regulation_type=item[0],
                                 regulation_name=item[1],
                                 count=found.count(item)) for item in unique
             ]
         })