JaeSwift commited on
Commit
4f51398
·
verified ·
1 Parent(s): 478fdb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -59,8 +59,9 @@ def find_rhymes_for_phrase(phrase):
59
  else:
60
  rhyming_options.append([[f"{word} (No rhymes found)"]])
61
 
 
62
  combined_results = list(itertools.product(*rhyming_options))
63
- unique_results = set(" ".join(combination) for combination in combined_results)
64
 
65
  # Return a list of unique rhyming combinations, each wrapped in a list for DataFrame compatibility
66
  return [[rhyme] for rhyme in unique_results]
 
59
  else:
60
  rhyming_options.append([[f"{word} (No rhymes found)"]])
61
 
62
+ # Flatten each combination into strings
63
  combined_results = list(itertools.product(*rhyming_options))
64
+ unique_results = set(" ".join(item[0] for item in combination) for combination in combined_results)
65
 
66
  # Return a list of unique rhyming combinations, each wrapped in a list for DataFrame compatibility
67
  return [[rhyme] for rhyme in unique_results]