class_docstr: Subclass of TextEncoder which also provides methods to handle CTC blank token.
  
  add_blank and insert_blank can be used to add <blank> special token to the encoder
  state.
  
  >>> from speechbrain.dataio.encoder import CTCTextEncoder
  >>> chars = ["a", "b", "c", "d"]
  >>> encoder = CTCTextEncoder()
  >>> encoder.update_from_iterable(chars)
  >>> encoder.add_blank()
  >>> encoder.expect_len(5)
  >>> encoder.encode_sequence(chars)
  [0, 1, 2, 3]
  >>> encoder.get_blank_index()
  4
  >>> encoder.decode_ndim([0, 1, 2, 3, 4])
  ['a', 'b', 'c', 'd', '<blank>']
  
  collapse_labels and collapse_indices_ndim can be used to apply CTC collapsing
  rules:
  >>> encoder.collapse_labels(["a", "a", "b", "c", "d"])
  ['a', 'b', 'c', 'd']
  >>> encoder.collapse_indices_ndim([4, 4, 0, 1, 2, 3, 4, 4]) # 4 is <blank>
  [0, 1, 2, 3]
class_docstr_tok: ["Subclass","of","TextEncoder","which","also","provides","methods","to","handle","CTC","blank","token",".","add_blank","and","insert_blank","can","be","used","to","add","<","blank",">","special","token","to","the","encoder","state",".",">",">",">","from","speechbrain.dataio.encoder","import","CTCTextEncoder",">",">",">","chars","=","[","``","a","''",",","``","b","''",",","``","c","''",",","``","d","''","]",">",">",">","encoder","=","CTCTextEncoder","(",")",">",">",">","encoder.update_from_iterable","(","chars",")",">",">",">","encoder.add_blank","(",")",">",">",">","encoder.expect_len","(","5",")",">",">",">","encoder.encode_sequence","(","chars",")","[","0",",","1",",","2",",","3","]",">",">",">","encoder.get_blank_index","(",")","4",">",">",">","encoder.decode_ndim","(","[","0",",","1",",","2",",","3",",","4","]",")","[","'","a","'",",","'","b","'",",","'","c","'",",","'d","'",",","'","<","blank",">","'","]","collapse_labels","and","collapse_indices_ndim","can","be","used","to","apply","CTC","collapsing","rules",":",">",">",">","encoder.collapse_labels","(","[","``","a","''",",","``","a","''",",","``","b","''",",","``","c","''",",","``","d","''","]",")","[","'","a","'",",","'","b","'",",","'","c","'",",","'d","'","]",">",">",">","encoder.collapse_indices_ndim","(","[","4",",","4",",","0",",","1",",","2",",","3",",","4",",","4","]",")","#","4","is","<","blank",">","[","0",",","1",",","2",",","3","]"]
docstr: Insert blank symbol at a given labelset.
docstr_tok: ["Insert","blank","symbol","at","a","given","labelset","."]
code: def insert_blank(self, blank_label=DEFAULT_BLANK, index=0):
      """Insert blank symbol at a given labelset."""
      self.insert_label(blank_label, index)
      self.blank_label = blank_label
  
imports: import ast
  import torch
  import collections
  import itertools
  import logging
  import warnings
  import speechbrain
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, register_checkpoint_hooks
label_desc: Use image node_id 3 for calling the CTCTextEncoder obj's underlying member method code with example usage: obj.insert_blank(blank_label, index) without return types