Reduce KeysΒΆ
Example
>>> # TEST PREPARATION
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, ReduceKeys
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Reduce thesaurus keys
>>> reducer = (
... ReduceKeys(use_colorama=False)
... .where_root_directory_is("examples/fintech/")
... )
>>> reducer.run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Reducing thesaurus keys...
File : examples/fintech/data/thesaurus/descriptors.the.txt
Keys reduced from 1724 to 1724
Reduction process completed successfully