From 6dd97838b423a595e3a8a66f26ce85052c11306f Mon Sep 17 00:00:00 2001 From: Luka Date: Mon, 19 Oct 2020 15:40:43 +0200 Subject: [PATCH] Added fix for when two restrictions are satisfied with the same word. --- luscenje_struktur/component.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luscenje_struktur/component.py b/luscenje_struktur/component.py index a0a7668..5a46120 100644 --- a/luscenje_struktur/component.py +++ b/luscenje_struktur/component.py @@ -109,6 +109,8 @@ class Component: for tr in to_ret: # make sure that one word is not used twice in same to_ret new_to_ret.extend([{**dict(tr), **m} for m in cmatch if any([m_v not in dict(tr).values() for m_v in m.values()])]) + if len(new_to_ret) == 0: + return None to_ret = new_to_ret del new_to_ret