From 2827f3ec2165ab4f3f7316f386b1048cbaff7e05 Mon Sep 17 00:00:00 2001 From: pr1est0r <136439100+pr1est0r@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:52:03 +0200 Subject: [PATCH] Enable comparison of empty strings When trying to compare two empty strings this node errors out because "can't devide by 0". My workaround enables comparison of empty strings, so I can automate using one prompt if another is empty, or the other, if it's not empty. --- WAS_Node_Suite.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WAS_Node_Suite.py b/WAS_Node_Suite.py index 946b889..78531e4 100644 --- a/WAS_Node_Suite.py +++ b/WAS_Node_Suite.py @@ -9350,7 +9350,10 @@ class WAS_Text_Compare: similar_words.add(word1) if word2 not in similar_words: similar_words.add(word2) - similarity_score = 1 - (dp[m][n]/max(m,n)) + if(max(m,n) == 0): + similarity_score = 1 + else: + similarity_score = 1 - (dp[m][n]/max(m,n)) return (similarity_score, list(similar_words))