<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def metaphone(self, words):
 """ Apply the double metaphone algorithm to the given words. Using metaphone allows the search index to tolerate misspellings and small typos. Example:: ('ALRS', 'FLRS') ('P0N', 'PTN') ('P0N', 'PTN') """

        for word in words:
            r = 0
            for w in double_metaphone(word):
                if w:
                    w = w.strip()
                    if w:
                        r += 1
                        yield w
            if not r:
                yield word