<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_words(self):
 """ Returns the document words. :return: Document words. :rtype: list """


        words = []
        block = self.document().findBlockByLineNumber(0)
        while block.isValid():
            blockWords = foundations.strings.get_words(foundations.strings.to_string(block.text()))
            if blockWords:
                words.extend(blockWords)
            block = block.next()
        return words