code: def test_build(self):
      text_gen = lorem_ipsum_generator
      build_fn = (
          subword_text_encoder.SubwordTextEncoder.build_from_corpus
      )
      encoder = build_fn(text_gen(), 300)
      # Created some subwords
      self.assertGreater(encoder.vocab_size, text_encoder.NUM_BYTES + 1)
  
      base_encoder = subword_text_encoder.SubwordTextEncoder(
          vocab_list=[]
      )
      for line in text_gen():
          # Invertible
          encoded = encoder.encode(line)
          self.assertEqual(line, encoder.decode(encoded))
          # Shorter than base
          if len(line) > 2:
              self.assertLess(
                  len(encoded), len(base_encoder.encode(line))
              )
  
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 1 for calling the SubwordTextEncoderBuildTest obj's underlying member method code with example usage: obj.test_build() without return types