code: def test_build_vocab(self):
      char_field = CharFeatureField(
          pad_token=VocabMeta.PAD_TOKEN,
          unk_token=VocabMeta.UNK_TOKEN,
          batch_first=True,
          min_freq=2,
      )
      utterances = [
          [
              ["A", "l", "l", "l", pad],
              ["u", "r", pad, pad, pad],
              ["b", "@", "$", "3", "s"],
              ["b", "2", pad, pad, pad],
              ["u", "s", pad, pad, pad],
          ],
          [["p", "l", "a", "y", pad], ["m", "u", "s", "i", "c"]],
      ]
      expected_freqs = Counter(
          {
              pad: 11,
              "l": 4,
              "u": 3,
              "s": 3,
              "b": 2,
              "A": 1,
              "r": 1,
              "@": 1,
              "$": 1,
              "3": 1,
              "2": 1,
              "p": 1,
              "a": 1,
              "y": 1,
              "m": 1,
              "i": 1,
              "c": 1,
          }
      )
      expected_itos = [VocabMeta.UNK_TOKEN, pad, "l", "s", "u", "b"]
      preprocessed_data = [char_field.preprocess(x) for x in utterances]
      char_field.build_vocab(preprocessed_data, min_freq=2)
      self.assertEqual(char_field.vocab.freqs, expected_freqs)
      self.assertEqual(char_field.vocab.itos, expected_itos)
  
file_path: pytext/pytext/fields/test/char_field_test.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import unittest
  from collections import Counter
  from pytext.common.constants import VocabMeta
  from pytext.fields.char_field import CharFeatureField
  from pytext.utils import precision
label_desc: Use image node_id 1 for calling the CharFieldTest obj's underlying member method code with example usage: obj.test_build_vocab() without return types