code: def test_compact(self):
      term_doc_mat = get_hamlet_term_doc_matrix()
      new_tdm = AssociationCompactor(max_terms=213).compact(
          term_doc_mat
      )
      self.assertEqual(len(term_doc_mat.get_terms()), 26875)
      self.assertEqual(len(new_tdm.get_terms()), 213)
  
file_path: scattertext/scattertext/test/test_associationCompator.py
imports: from unittest import TestCase
  from scattertext.termcompaction.AssociationCompactor import AssociationCompactor, AssociationCompactorByRank, TermCategoryRanker
  from scattertext.test.test_TermDocMat import get_hamlet_term_doc_matrix
label_desc: Use image node_id 1 for calling the TestAssociationCompactor obj's underlying member method code with example usage: obj.test_compact() without return types