Sort by Key OrderΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.references import CreateThesaurus, SortByKeyOrder
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> CreateThesaurus(root_directory = "example/", quiet=True, tqdm_disable=True).run()
>>> # Create, configure, and run the sorter
>>> # with_keys_order_by: "alphabetical", "key_length", "word_length"
>>> sorter = (
...     SortByKeyOrder()
...     .having_keys_ordered_by("alphabetical")
...     .where_root_directory_is("example/")
... )
>>> sorter.run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
Sorting thesaurus alphabetically
  File : example/thesaurus/references.the.txt
  Thesaurus sorting completed successfully

Printing thesaurus header
  File : example/thesaurus/references.the.txt

    Alt R., 2018, ELECTRON MARK, V28, P235
      Alt R., Beck R., Smits M.T., Fintech and the Transformation of the Financ...
    Anagnostopoulos I., 2018, J ECON BUS, V100, P7
      Anagnostopoulos, Ioannis, FinTech and RegTech: Impact on regulators and b...
    Arner D.W., 2017, NORTHWEST J INTL LAW BUS, V37, P373
      Arner D.W., Barberis J., Buckley R.P., Fintech, regtech, and the reconcep...
    Buchak G., 2018, J FINANC ECON, V130, P453
      Buchak G., Matvos G., Piskorski T., Seru A., Fintech, regulatory arbitrag...
    Cai C.W., 2018, ACCOUNT FINANC, V58, P965
      Cai C.W., Disruption of financial intermediation by FinTech: A review on ...
    Chen L./1, 2016, CHINA ECON J, V9, P225
      Chen L., From Fintech to Finlife: The case of Fintech development in Chin...
    Dorfleitner G., 2017, FINTECH IN GER, P1
      Dorfleitner G., Hornuf L., Schmitt M., Weber M., FinTech in Germany, (2017)
    Gabor D., 2017, NEW POLIT ECON, V22, P423
      Gabor D., Brooks S., The Digital Revolution in Financial Inclusion: Inter...