class_docstr: Provides common code for text vectorizers (tokenization logic).
class_docstr_tok: ["Provides","common","code","for","text","vectorizers","(","tokenization","logic",")","."]
docstr: Handles ngram generation for characters analyzers.
  
  When analyzer is 'char_wb', we generate ngrams within word boundaries,
  meaning we need to first tokenize and pad each token with a delimiter.
docstr_tok: ["Handles","ngram","generation","for","characters","analyzers",".","When","analyzer","is","'char_wb","'",",","we","generate","ngrams","within","word","boundaries",",","meaning","we","need","to","first","tokenize","and","pad","each","token","with","a","delimiter","."]
code: def get_char_ngrams(self, ngram_size, str_series, doc_id_sr):
      """
      Handles ngram generation for characters analyzers.
  
      When analyzer is 'char_wb', we generate ngrams within word boundaries,
      meaning we need to first tokenize and pad each token with a delimiter.
      """
      if self.analyzer == "char_wb" and ngram_size != 1:
          token_count = str_series.str.token_count(
              delimiter=self.delimiter
          )
          tokens = str_series.str.tokenize(self.delimiter)
          del str_series
  
          padding = Series(self.delimiter).repeat(len(tokens))
          tokens = tokens.str.cat(padding)
          padding = padding.reset_index(drop=True)
          tokens = padding.str.cat(tokens)
          tokens = tokens.reset_index(drop=True)
  
          ngram_sr = tokens.str.character_ngrams(n=ngram_size)
  
          doc_id_df = cudf.DataFrame(
              {
                  "doc_id": doc_id_sr.repeat(token_count).reset_index(
                      drop=True
                  ),
                  # formula to count ngrams given number of letters per token:
                  "ngram_count": tokens.str.len() - (ngram_size - 1),
              }
          )
          del tokens
          ngram_count = doc_id_df.groupby("doc_id", sort=True).sum()[
              "ngram_count"
          ]
          return ngram_sr, ngram_count, token_count
  
      if ngram_size == 1:
          token_count = str_series.str.len()
          ngram_sr = str_series.str.character_tokenize()
          del str_series
      elif self.analyzer == "char":
          token_count = str_series.str.len()
          ngram_sr = str_series.str.character_ngrams(n=ngram_size)
          del str_series
  
      ngram_count = token_count - (ngram_size - 1)
  
      return ngram_sr, ngram_count, token_count
  
imports: from cuml.internals.safe_imports import cpu_only_import
  import cuml.internals.logger
  from cudf.utils.dtypes import min_signed_type
  from cuml.internals.type_utils import CUPY_SPARSE_DTYPES
  import numbers
  from cuml.internals.safe_imports import gpu_only_import
  from functools import partial
  from cuml.common.sparsefuncs import create_csr_matrix_from_count_df
  from cuml.common.sparsefuncs import csr_row_normalize_l1, csr_row_normalize_l2
  from cuml.feature_extraction._stop_words import ENGLISH_STOP_WORDS
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 4 for calling the _VectorizerMixin obj's underlying member method code with example usage: obj.get_char_ngrams(ngram_size, str_series, doc_id_sr) and returns: ngram_sr,  ngram_count,  token_count, ngram_sr,  ngram_count,  token_count