class_docstr: `FeatureConnector` for text, encoding to integers with a `TextEncoder`.
docstr: Call SubwordTextEncoder.build_from_corpus is encoder_cls is such.
  
  If `self.encoder` is `None` and `self._encoder_cls` is of type
  `SubwordTextEncoder`, the method instantiates `self.encoder` as returned
  by `SubwordTextEncoder.build_from_corpus()`.
  
  Args:
    corpus_generator: generator yielding `str`, from which subwords will be
      constructed.
    **kwargs: kwargs forwarded to `SubwordTextEncoder.build_from_corpus()`
docstr_tok: ["Call","SubwordTextEncoder.build_from_corpus","is","encoder_cls","is","such",".","If","`","self.encoder","`","is","`","None","`","and","`","self._encoder_cls","`","is","of","type","`","SubwordTextEncoder","`",",","the","method","instantiates","`","self.encoder","`","as","returned","by","`","SubwordTextEncoder.build_from_corpus","(",")","`",".","Args",":","corpus_generator",":","generator","yielding","`","str","`",",","from","which","subwords","will","be","constructed",".","*","*","kwargs",":","kwargs","forwarded","to","`","SubwordTextEncoder.build_from_corpus","(",")","`"]
code: def maybe_build_from_corpus(self, corpus_generator, **kwargs):
      """Call SubwordTextEncoder.build_from_corpus is encoder_cls is such.
  
      If `self.encoder` is `None` and `self._encoder_cls` is of type
      `SubwordTextEncoder`, the method instantiates `self.encoder` as returned
      by `SubwordTextEncoder.build_from_corpus()`.
  
      Args:
        corpus_generator: generator yielding `str`, from which subwords will be
          constructed.
        **kwargs: kwargs forwarded to `SubwordTextEncoder.build_from_corpus()`
      """
      if self._encoder_cls is not text_lib.SubwordTextEncoder:
          return
      if self.encoder:
          return
  
      vocab_size = self._encoder_config.vocab_size
      self.encoder = text_lib.SubwordTextEncoder.build_from_corpus(
          corpus_generator=corpus_generator,
          target_vocab_size=vocab_size,
          **kwargs,
      )
  
imports: import html
  import os
  import textwrap
  from typing import Union
  from absl import logging
  from etils import epath
  import numpy
  from tensorflow_datasets.core.deprecated import text
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import tensor_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 12 for calling the Text obj's underlying member method code with example usage: obj.maybe_build_from_corpus(corpus_generator) without return types