Merge KeysΒΆ
Example
>>> import sys
>>> from io import StringIO
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> from techminer2.thesaurus.descriptors import MergeKeys
>>> (
... MergeKeys()
... .with_patterns(["FINTECH", "FINANCIAL_TECHNOLOGIES"])
... .where_root_directory("examples/fintech/")
... .run()
... )
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Merging thesaurus keys...
File : examples/fintech/data/thesaurus/descriptors.the.txt
Keys : FINTECH; FINANCIAL_TECHNOLOGIES
Merging process completed successfully