Merge SynonymousΒΆ

Example

>>> # TEST PREPARATION
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, MergeSynonymous
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Merge synonymous terms
>>> (
...     MergeSynonymous()
...     .with_core_area("FINTECH - FINANCIAL TECHNOLOGIES")
...     .having_n_contexts(10)
...     .having_terms_in_top(40)
...     .having_terms_ordered_by("OCC")
...     .having_term_occurrences_between(None, None)
...     .having_term_citations_between(None, None)
...     .having_terms_in(None)
...     .where_root_directory("examples/fintech/")
... ).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)