Explode KeysΒΆ

Example

>>> # TEST PREPARATION
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.user import InitializeThesaurus, ExplodeKeys
>>> # Redirecting stderr to avoid messages during doctests
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Reset the thesaurus to initial state
>>> InitializeThesaurus(thesaurus_file="demo.the.txt", field="raw_descriptors",
...     root_directory="examples/fintech/", quiet=True).run()
>>> # Creates, configures, an run the exploder
>>> (
...     ExplodeKeys(use_colorama=False)
...     .with_thesaurus_file("demo.the.txt")
...     .where_root_directory_is("examples/fintech/")
...     .run()
... )
>>> # Capture and print stderr output to test the code using doctest
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output) 
Reducing thesaurus keys...
  File : examples/fintech/data/thesaurus/demo.the.txt
  Keys reduced from 1572 to 1572
  Reduction process completed successfully

Exploding thesaurus keys...
  File : examples/fintech/data/thesaurus/demo.the.txt
  Keys reduced from 1572 to 1612
  Exploding process completed successfully