Register PhrasesΒΆ
Example
>>> import shutil
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.abbreviations import RegisterPhrases
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Copy the abbreviations file
>>> shutil.copy("examples/fintech/abbreviations.the.txt", "examples/fintech/data/thesaurus/abbreviations.the.txt")
'examples/fintech/data/thesaurus/abbreviations.the.txt'
>>> # Register new thesaurus phrases
>>> RegisterPhrases(root_directory="examples/fintech/", use_colorama=False).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Registering new noun phrases...
Registration process completed successfully