Apply ThesaurusΒΆ

Example

>>> from techminer2.thesaurus.countries import InitializeThesaurus
>>> (
...     InitializeThesaurus()
...     .where_root_directory("examples/fintech/")
... ).run()
>>> from techminer2.thesaurus.countries import ApplyThesaurus
>>> ApplyThesaurus().where_root_directory("examples/fintech/").run()
>>> from techminer2.io import Query
>>> result = Query(
...     query_expression="SELECT countries FROM database LIMIT 10;",
...     root_directory="examples/fintech/",
...     database="main",
...     record_years_range=(None, None),
...     record_citations_range=(None, None),
... ).run()
>>> print(result)
                   countries
0                South Korea
1                South Korea
2                      China
3                     Latvia
4             United Kingdom
5       United States; China
6                Switzerland
7  Australia; Denmark; China
8                Switzerland
9                    Germany
>>> result = Query(
...     query_expression="SELECT regions FROM database LIMIT 10;",
...     root_directory="examples/fintech/",
...     database="main",
...     record_years_range=(None, None),
...     record_citations_range=(None, None),
... ).run()
>>> print(result)
                 regions
0                   Asia
1                   Asia
2                   Asia
3                 Europe
4                 Europe
5         Americas; Asia
6                 Europe
7  Oceania; Europe; Asia
8                 Europe
9                 Europe
>>> result = Query(
...     query_expression="SELECT subregions FROM database LIMIT 10;",
...     root_directory="examples/fintech/",
...     database="main",
...     record_years_range=(None, None),
...     record_citations_range=(None, None),
... ).run()
>>> print(result)
                                          subregions
0                                       Eastern Asia
1                                       Eastern Asia
2                                       Eastern Asia
3                                    Northern Europe
4                                    Northern Europe
5                     Northern America; Eastern Asia
6                                     Western Europe
7  Australia and New Zealand; Northern Europe; Ea...
8                                     Western Europe
9                                     Western Europe