code: def test_max_subword_length(self):
      text_gen = lorem_ipsum_generator
      build_fn = (
          subword_text_encoder.SubwordTextEncoder.build_from_corpus
      )
      encoder = build_fn(text_gen(), 300, max_subword_length=1)
      # Created no subwords because there are no unicode characters in lorem ipsum
      # and single byte subwords are skipped because all bytes are in the vocab by
      # default.
      self.assertEqual(encoder.vocab_size, text_encoder.NUM_BYTES + 1)
      self.assertEqual(len(encoder.subwords), 0)
  
      # Not the case when there are unicode characters
      text_gen = lorem_ipsum_zh_generator
      build_fn = (
          subword_text_encoder.SubwordTextEncoder.build_from_corpus
      )
      encoder = build_fn(text_gen(), 300, max_subword_length=1)
      self.assertGreater(encoder.vocab_size, text_encoder.NUM_BYTES + 1)
      self.assertGreater(len(encoder.subwords), 0)
  
imports: from __future__ import unicode_literals
  import os
  from absl.testing import parameterized
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.deprecated.text import subword_text_encoder
  from tensorflow_datasets.core.deprecated.text import text_encoder
label_desc: Use image node_id 3 for calling the SubwordTextEncoderBuildTest obj's underlying member method code with example usage: obj.test_max_subword_length() without return types