code: def word_at_position(self, position):
          
          if position['line'] >= len(self.lines):
              return ''
  
          line = self.lines[position['line']]
          i = position['character']
          # Split word in two
          start = line[:i]
          end = line[i:]
  
          # Take end of start and start of end to find word
          # These are guaranteed to match, even if they match the empty string
          m_start = RE_START_WORD.findall(start)
          m_end = RE_END_WORD.findall(end)
  
          return m_start[0] + m_end[-1]
docs: Get the word under the cursor returning the start and end positions.