code: def word_tokenize(sentence):
      
      date_pattern = r'\d\d(\d\d)?[\\-]\d\d[\\-]\d\d(\d\d)?'
      number_pattern = r'[\+-]?(\d+\.\d+|\d{1,3},(\d{3},)*\d{3}|\d+)'
      arr_pattern = r'(?: \w\.){2,3}|(?:\A|\s)(?:\w\.){2,3}|[A-Z]\. [a-z]'
      word_pattern = r'[\w]+'
      non_space_pattern = r'[{}]|\w'.format(re.escape('!"#$%&()*,./:;<=>?@[\]^_-`{|}~'))
      space_pattern = r'\s'
      anything_pattern = r'.'
      patterns = [date_pattern, number_pattern, arr_pattern, word_pattern, non_space_pattern, space_pattern, anything_pattern]
      big_pattern = r'|'.join([('(' + pattern + ')') for pattern in patterns])
      for match in re.finditer(big_pattern, sentence):
          yield match.group(0)
docs: A generator which yields tokens based on the given sentence without deleting anything.
  
      >>> context = "I love you. Please don't leave."
      >>> list(word_tokenize(context))
      ['I', ' ', 'love', ' ', 'you', '.', ' ', 'Please', ' ', 'don', "'", 't', ' ', 'leave', '.']