Skip to content
Snippets Groups Projects
Commit d62da8a9 authored by Paweł Walkowiak's avatar Paweł Walkowiak
Browse files

Fix

parent c96cc8e3
1 merge request!13Fix anonymizer errors
Pipeline #15141 passed with stages
in 1 minute and 33 seconds
...@@ -93,7 +93,8 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary): ...@@ -93,7 +93,8 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
if original_entry_type_name in self._dictionary: if original_entry_type_name in self._dictionary:
entry_type = original_entry_type_name entry_type = original_entry_type_name
if morpho_tag in self._dictionary[entry_type]: if morpho_tag in self._dictionary[entry_type] \
and morpho_tag in self._dictionary[entry_type]:
lemma = random.choice( lemma = random.choice(
list(self._dictionary[entry_type][morpho_tag].keys()) list(self._dictionary[entry_type][morpho_tag].keys())
) )
......
...@@ -61,7 +61,7 @@ class NERReplacer(ReplacerInterface): ...@@ -61,7 +61,7 @@ class NERReplacer(ReplacerInterface):
) )
morpho_detections[key].append(detection) morpho_detections[key].append(detection)
else: else:
key = (text[start:end], detection.TYPE_NAME) key = (text[start:end], detection_entry.TYPE_NAME)
non_morpho_detections[key].append(detection) non_morpho_detections[key].append(detection)
# Replace morphosyntactic detections # Replace morphosyntactic detections
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment