class_docstr: Tests text data class.
      
docstr: Tests truncation.
          
docstr_tok: ["Tests","truncation","."]
code: def test_length_truncate(self):
      """Tests truncation."""
      hparams = copy.copy(self._hparams)
      hparams["dataset"].update(
          {"max_seq_length": 4, "length_filter_mode": "truncate"}
      )
      hparams["shuffle"] = False
      hparams["allow_smaller_final_batch"] = False
      self._run_and_test(hparams)
  
imports: import tempfile
  import copy
  import numpy
  import tensorflow
  import texar.tf
label_desc: Use image node_id 11 for calling the MonoTextDataTest obj's underlying member method code with example usage: obj.test_length_truncate() without return types