Sort by Word MatchΒΆ

Example

>>> # TEST PREPARATION
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.organizations import InitializeThesaurus, SortByWordMatch
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Create and run the sorter
>>> sorter = (
...     SortByWordMatch()
...     #
...     # THESAURUS:
...     .having_pattern("Bank")
...     #
...     # DATABASE:
...     .where_root_directory("examples/fintech/")
... )
>>> sorter.run()
>>> from techminer2.thesaurus.organizations import PrintHeader
>>> (
...     PrintHeader()
...     .using_colored_output(False)
...     .where_root_directory("examples/fintech/")
... ).run()