Returns the document partial word under cursor ( From word start to cursor position ).

        :return: Partial word under cursor.
        :rtype: QString

def get_partial_word_under_cursor(self):
        """
        Returns the document partial word under cursor ( From word start to cursor position ).

        :return: Partial word under cursor.
        :rtype: QString
        """

        if not re.match(r"^\w+$", foundations.strings.to_string(self.get_previous_character())):
            return QString()

        cursor = self.textCursor()
        position = cursor.position()
        cursor.movePosition(QTextCursor.PreviousWord, QTextCursor.KeepAnchor)
        return cursor.selectedText()