Integrity CheckΒΆ
Example
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, IntegrityCheck
>>> # Redirect stderr to capture output
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True, use_colorama=False).run()
>>> # Run the integrity check
>>> checker = (
... IntegrityCheck(use_colorama=False)
... .where_root_directory_is("examples/fintech/")
... )
>>> checker.run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Checking thesaurus integrity...
File : examples/fintech/data/thesaurus/descriptors.the.txt
1791 terms checked
Integrity check completed successfully