def __init__(self, languages, encoder=None, encoder_config=None):
    """Constructs a Translation FeatureConnector.

    Args:
      languages: `list<string>` Full list of languages codes.
      encoder: `tfds.features.text.TextEncoder` or
        list<tfds.features.text.TextEncoder> (optional), an encoder that can
        convert text to integer. One can be shared one per language provided. If
        None, the text will be utf-8 byte-encoded.
      encoder_config: `tfds.features.text.TextEncoderConfig` or
        `list<tfds.features.text.TextEncoderConfig>` (optional), needed
        if restoring from a file with `load_metadata`. One config can be shared
        or one per language can be provided.
    """
    # If encoder and encoder_config aren't lists, use the same values for all
    # languages.
    if not isinstance(encoder, collections_abc.Iterable):
      encoder = [encoder] * len(languages)
    if not isinstance(encoder_config, collections_abc.Iterable):
      encoder_config = [encoder_config] * len(languages)

    super(Translation, self).__init__(
        {lang: text_feature.Text(enc, enc_conf) for lang, enc, enc_conf in zip(
            languages, encoder, encoder_config)})
def __init__ ( self , languages , encoder = None , encoder_config = None ) : if not isinstance ( encoder , collections_abc . Iterable ) : encoder = [ encoder ] * len ( languages ) if not isinstance ( encoder_config , collections_abc . Iterable ) : encoder_config = [ encoder_config ] * len ( languages ) super ( Translation , self ) . __init__ ( { lang : text_feature . Text ( enc , enc_conf ) for lang , enc , enc_conf in zip ( languages , encoder , encoder_config ) } )
Constructs a Translation FeatureConnector.

    Args:
      languages: `list<string>` Full list of languages codes.
      encoder: `tfds.features.text.TextEncoder` or
        list<tfds.features.text.TextEncoder> (optional), an encoder that can
        convert text to integer. One can be shared one per language provided. If
        None, the text will be utf-8 byte-encoded.
      encoder_config: `tfds.features.text.TextEncoderConfig` or
        `list<tfds.features.text.TextEncoderConfig>` (optional), needed
        if restoring from a file with `load_metadata`. One config can be shared
        or one per language can be provided.