class_docstr: Construct a CPMAnt tokenizer. Based on byte-level Byte-Pair-Encoding.
  
  Args:
      vocab_file (`str`):
          Path to the vocabulary file.
      bod_token (`str`, *optional*, defaults to `"<d>"`):
          The beginning of document token.
      eod_token (`str`, *optional*, defaults to `"</d>"`):
          The end of document token.
      bos_token (`str`, *optional*, defaults to `"<s>"`):
          The beginning of sequence token.
      eos_token (`str`, *optional*, defaults to `"</s>"`):
          The end of sequence token.
      pad_token (`str`, *optional*, defaults to `"<pad>"`):
          The token used for padding.
      unk_token (`str`, *optional*, defaults to `"<unk>"`):
          The unknown token.
      line_token (`str`, *optional*, defaults to `"</n>"`):
          The line token.
      space_token (`str`, *optional*, defaults to `"</_>"`):
          The space token.
class_docstr_tok: ["Construct","a","CPMAnt","tokenizer",".","Based","on","byte-level","Byte-Pair-Encoding",".","Args",":","vocab_file","(","`","str","`",")",":","Path","to","the","vocabulary","file",".","bod_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","d",">","''","`",")",":","The","beginning","of","document","token",".","eod_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/d",">","''","`",")",":","The","end","of","document","token",".","bos_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","s",">","''","`",")",":","The","beginning","of","sequence","token",".","eos_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/s",">","''","`",")",":","The","end","of","sequence","token",".","pad_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","pad",">","''","`",")",":","The","token","used","for","padding",".","unk_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","unk",">","''","`",")",":","The","unknown","token",".","line_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/n",">","''","`",")",":","The","line","token",".","space_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/_",">","''","`",")",":","The","space","token","."]
code: def save_vocabulary(
      self, save_directory: str, filename_prefix: Optional[str] = None
  ) -> Tuple[str]:
      if os.path.isdir(save_directory):
          vocab_file = os.path.join(
              save_directory,
              (filename_prefix + "-" if filename_prefix else "")
              + VOCAB_FILES_NAMES["vocab_file"],
          )
      else:
          vocab_file = (
              filename_prefix + "-" if filename_prefix else ""
          ) + save_directory
      index = 0
      if " " in self.encoder:
          self.encoder["</_>"] = self.encoder[" "]
          del self.encoder[" "]
      if "\n" in self.encoder:
          self.encoder["</n>"] = self.encoder["\n"]
          del self.encoder["\n"]
      self.encoder = collections.OrderedDict(
          sorted(self.encoder.items(), key=lambda x: x[1])
      )
      with open(vocab_file, "w", encoding="utf-8") as writer:
          for token, token_index in self.encoder.items():
              if index != token_index:
                  logger.warning(
                      f"Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive."
                      " Please check that the vocabulary is not corrupted!"
                  )
                  index = token_index
              writer.write(token + "\n")
              index += 1
      return (vocab_file,)
  
imports: import collections
  import os
  from typing import List, Optional, Tuple
  from transformers.utils import is_jieba_available, requires_backends
  from ...tokenization_utils import PreTrainedTokenizer
  from ...utils import logging
label_desc: Use image node_id 13 for calling the CpmAntTokenizer obj's underlying member method code with example usage: obj.save_vocabulary(save_directory, filename_prefix) and returns: vocab_file