Skip to content
Snippets Groups Projects
Commit b5b25989 authored by dcz's avatar dcz
Browse files

Hierarchy constraint check improvement (accetp synsets overlaping).

parent 944658fd
No related branches found
No related tags found
No related merge requests found
...@@ -89,17 +89,18 @@ def check_sysnet_hierarchy_constraints(synset_preference_ids, unified_frame_argu ...@@ -89,17 +89,18 @@ def check_sysnet_hierarchy_constraints(synset_preference_ids, unified_frame_argu
for synset_preference_id in synset_preference_ids: for synset_preference_id in synset_preference_ids:
conflict_hyponym, conflict_hyperonym, conflict_exists = synset_hierarchy_constraint_check(int(synset_preference_id), conflict_hyponym, conflict_hyperonym, conflict_exists = synset_hierarchy_constraint_check(int(synset_preference_id),
set(synset_ids_list)) set(synset_ids_list))
if conflict_hyponym is not None or conflict_hyperonym is not None or conflict_exists is not None: if conflict_hyponym is None and conflict_hyperonym is None and conflict_exists is None:
return {"succ": True}
else:
conflict_exists_lu_str = conflict_lu_to_str(conflict_exists) conflict_exists_lu_str = conflict_lu_to_str(conflict_exists)
conflict_hyponym_lu_str = conflict_lu_to_str(conflict_hyponym) conflict_hyponym_lu_str = conflict_lu_to_str(conflict_hyponym)
conflict_hyperonym_lu_str = conflict_lu_to_str(conflict_hyperonym) conflict_hyperonym_lu_str = conflict_lu_to_str(conflict_hyperonym)
return {"succ": False, "conflict_hyponym": conflict_hyponym_lu_str, ret = {"succ": False, "conflict_hyponym": conflict_hyponym_lu_str,
"conflict_hyperonym": conflict_hyperonym_lu_str, "conflict_hyperonym": conflict_hyperonym_lu_str,
"conflict_exists": "Wybrana preferencja selekcyjna nie mogła zostać zapisana ponieważ widnieje już na liście preferencji selekcyjnych: " + conflict_exists_lu_str if conflict_exists_lu_str is not None else None} "conflict_exists": "Wybrana preferencja selekcyjna nie mogła zostać zapisana ponieważ widnieje już na liście preferencji selekcyjnych: " + conflict_exists_lu_str if conflict_exists_lu_str is not None else None}
return {"succ": True} return ret
def conflict_lu_to_str(conflict_lu): def conflict_lu_to_str(conflict_lu):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment