Initial WordsΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, RemoveInitialWords
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Remove common initial words
>>> RemoveInitialWords(root_directory="examples/fintech/", tqdm_disable=True, use_colorama=False).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output) 
Removing common initial words from thesaurus keys...
  File : examples/fintech/data/thesaurus/descriptors.the.txt

  208 common initial words removed successfully
  Removal process completed successfully

Printing thesaurus header
  File : examples/fintech/data/thesaurus/descriptors.the.txt

    ACADEMICS
      ACADEMICS; OTHER_ACADEMICS
    ACCESS
      ACCELERATE_ACCESS; ACCESS
    ACHIEVEMENTS
      CONTEMPORARY_ACHIEVEMENTS
    ACTION
      LATE_ACTION
    ACTORS
      ACTORS; HETEROGENEOUS_ACTORS
    ADDITIONAL_COMPONENTS
      FIVE_ADDITIONAL_COMPONENTS
    AFFORDANCES
      AFFORDANCES; THREE_AFFORDANCES
    AGRICULTURE_BUSINESS_PROCESS
      TRANSFORM_AGRICULTURE_BUSINESS_PROCESS