Sort by Key LengthΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, SortByKeyLength
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Configure and run the sorter
>>> sorter = (
...     SortByKeyLength(use_colorama=False)
...     .where_root_directory_is("examples/fintech/")
... )
>>> sorter.run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = StringIO()
>>> print(output) 
Sorting thesaurus by key length...
  File : examples/fintech/data/thesaurus/descriptors.the.txt
  Sorting process completed successfully

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

    CONTINUOUS_INTENTION_TO_USE_MOBILE_FINTECH_PAYMENT_SERVICES
      CONTINUOUS_INTENTION_TO_USE_MOBILE_FINTECH_PAYMENT_SERVICES
    UNIFIED_THEORY_OF_ACCEPTANCE_AND_USE_OF_TECHNOLOGY_MODEL
      UNIFIED_THEORY_OF_ACCEPTANCE_AND_USE_OF_TECHNOLOGY_MODEL
    A_NOVEL_HYBRID_MULTIPLE_CRITERIA_DECISION_MAKING_METHOD
      A_NOVEL_HYBRID_MULTIPLE_CRITERIA_DECISION_MAKING_METHOD
    THAT_FUTURE_AND_PRESENT_MOBILE_FINTECH_PAYMENT_SERVICES
      THAT_FUTURE_AND_PRESENT_MOBILE_FINTECH_PAYMENT_SERVICES
    THE_MOST_IMPORTANT_AND_FASTEST_GROWING_FINTECH_SERVICES
      THE_MOST_IMPORTANT_AND_FASTEST_GROWING_FINTECH_SERVICES
    THE_HEFEI_SCIENCE_AND_TECHNOLOGY_RURAL_COMMERCIAL_BANK
      THE_HEFEI_SCIENCE_AND_TECHNOLOGY_RURAL_COMMERCIAL_BANK
    THE_MODIFIED_VISEKRITERIJUMSKO_KOMPROMISNO_RANGIRANJE
      THE_MODIFIED_VISEKRITERIJUMSKO_KOMPROMISNO_RANGIRANJE
    PURCHASE_RELATED_GLOBAL_MOBILE_PAYMENT_MARKET_SIZE
      PURCHASE_RELATED_GLOBAL_MOBILE_PAYMENT_MARKET_SIZE