Replace AbbreviationsΒΆ

Example

>>> # Copy the acronyms file
>>> import shutil
>>> shutil.copy("examples/fintech/acronyms.the.txt", "examples/fintech/data/thesaurus/acronyms.the.txt")
'examples/fintech/data/thesaurus/acronyms.the.txt'
>>> # Create thesaurus
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Redirecting stderr to avoid messages
>>> import sys
>>> from io import StringIO
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Configure and run the replacer
>>> from techminer2.thesaurus.descriptors import ReplaceAcronyms
>>> ReplaceAcronyms(
...     root_directory="examples/fintech/",
...     tqdm_disable=True,
...     ,
... ).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)  
Replacing acronyms in keys...
  Thesaurus : ...h/data/thesaurus/descriptors.the.txt
   Acronyms : ...data/thesaurus/acronyms.the.txt
  120 replacements made successfully
  Replacement process completed successfully

Printing thesaurus header
  File : examples/fintech/data/thesaurus/descriptors.the.txt

    A_EUROPEAN_OR_NATIONAL_FINANCIAL_TECHNOLOGY_MARKET
      A_EUROPEAN_OR_NATIONAL_FINTECH_MARKET
    A_FINANCIAL_TECHNOLOGY_COMPANY
      A_FINTECH_COMPANY
    A_FINANCIAL_TECHNOLOGY_ECOSYSTEM
      A_FINTECH_ECOSYSTEM
    A_HYBRID_MULTI_CRITERIA_DECISION_MAKING_METHOD_MODEL
      A_HYBRID_MCDM_MODEL
    A_NEW_FINANCIAL_TECHNOLOGY_INNOVATION_MAPPING_APPROACH
      A_NEW_FINTECH_INNOVATION_MAPPING_APPROACH
    A_THEORETICAL_DATA_DRIVEN_FINANCIAL_TECHNOLOGY_FRAMEWORK
      A_THEORETICAL_DATA_DRIVEN_FINTECH_FRAMEWORK
    ACTIVE_FINANCIAL_TECHNOLOGY_SOLUTIONS
      ACTIVE_FINTECH_SOLUTIONS
    ACTOR_NETWORK_THEORY
      ACTOR_NETWORK_THEORY; ANT