Sort by Word LengthΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.countries import InitializeThesaurus, SortByWordLength
>>> # Redirect stderr to capture output
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Sort thesaurus by alphabetical order
>>> sorter = (
...     SortByWordLength()
...     .where_root_directory_is("examples/fintech/")
... )
>>> sorter.run()