diff --git a/.gitignore b/.gitignore index ad9f019..a3f0aca 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,5 @@ venv.bak/ .noseids .vscode/* *.ipynb -.pypirc \ No newline at end of file +.pypirc +/.vs diff --git a/Phyme/Phyme.py b/Phyme/Phyme.py index a1da4a4..90750f9 100644 --- a/Phyme/Phyme.py +++ b/Phyme/Phyme.py @@ -44,6 +44,14 @@ def sorted_search(self, phones, keyword): sorted_dict = dict() for k, v in results.items(): sorted_dict[k] = list(sort_words(keyword, v)) + + #This removes the input word from the return of rhymes + for syl in sorted_dict: + try: + sorted_dict[syl].remove(keyword) + except: + pass + return sorted_dict def get_perfect_rhymes(self, word, num_syllables=None):