docs: def _reduce_by_ngram(self, data, ngram):
          """Lowers the counts of all n-grams in `data` that are
          substrings of `ngram` by `ngram`\'s count.
  
          Modifies `data` in place.
  
          :param data: row data dictionary for the current text
          :type data: `dict`
          :param ngram: n-gram being reduced
          :type ngram: `str`
  
          """
          # Find all substrings of `ngram` and reduce their count by the
          # count of `ngram`. Substrings may not exist in `data`.
          count = data[ngram]['count']
          for substring in self._generate_substrings(ngram, data[ngram]['size']):
              try:
                  substring_data = data[substring]
              except KeyError:
                  continue
              else:
                  substring_data['count'] -= count