Starting Stopwords RemoverΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import CreateThesaurus, RemoveInitialStopwords
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> CreateThesaurus(root_directory="example/", quiet=True).run()
>>> # Remove initial stopwords
>>> RemoveInitialStopwords(root_directory="example/", tqdm_disable=True).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Removing starting stopwords from thesaurus keys  File : example/thesaurus/descriptors.the.txt
  562 initial stopwords removed successfully
  Starting stopwords removal completed successfully

Printing thesaurus header
  File : example/thesaurus/descriptors.the.txt

    ACADEMIC_FINANCE_COMMUNITY
      THE_ACADEMIC_FINANCE_COMMUNITY
    ACADEMICS
      ACADEMICS; BOTH_ACADEMICS; OTHER_ACADEMICS
    ACCEPTANCE
      ACCEPTANCE; THE_ACCEPTANCE
    ACTION
      OUR_ACTION
    ACTIVE_PARTICIPANT
      AN_ACTIVE_PARTICIPANT
    ACTORS
      ACTORS; ALL_ACTORS
    ADOPTION
      ADOPTION; THE_ADOPTION
    ADVANCEMENT
      THE_ADVANCEMENT