From 107a4a1c58cd91bc7dc9a7a8e7c13c34e19489a4 Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Thu, 22 Jan 2026 12:15:51 -0500 Subject: [PATCH 01/15] Rename thesaurus languages to entries --- .github/ISSUE_TEMPLATE/language_issues.md | 2 +- .github/ISSUE_TEMPLATE/language_request.md | 2 +- .../validate-language-info-files.yml | 4 +- .../commands/generate_missing_templates.py | 6 +- web/management/commands/generate_template.py | 4 +- .../commands/validatelanginfofiles.py | 2 +- .../commands/validatemetainfofile.py | 10 +- web/models.py | 114 +++++----- web/tests/test_models.py | 66 +++--- web/tests/test_views.py | 4 +- web/thesaurus_template_generators.py | 18 +- web/views.py | 200 +++++++++--------- 12 files changed, 216 insertions(+), 216 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/language_issues.md b/.github/ISSUE_TEMPLATE/language_issues.md index 8e3a50d4d..703e35819 100644 --- a/.github/ISSUE_TEMPLATE/language_issues.md +++ b/.github/ISSUE_TEMPLATE/language_issues.md @@ -1,5 +1,5 @@ --- -name: Language Issue +name: ThesaurusEntry Issue about: Use this template to report issues with a language --- diff --git a/.github/ISSUE_TEMPLATE/language_request.md b/.github/ISSUE_TEMPLATE/language_request.md index d60895eb8..4a1782603 100644 --- a/.github/ISSUE_TEMPLATE/language_request.md +++ b/.github/ISSUE_TEMPLATE/language_request.md @@ -1,5 +1,5 @@ --- -name: Language Request +name: ThesaurusEntry Request about: Use this template to request a new language --- diff --git a/.github/workflows/validate-language-info-files.yml b/.github/workflows/validate-language-info-files.yml index ac513a3dc..2ff777a76 100644 --- a/.github/workflows/validate-language-info-files.yml +++ b/.github/workflows/validate-language-info-files.yml @@ -1,4 +1,4 @@ -name: Validate Language Info Files +name: Validate ThesaurusEntry Info Files on: push: @@ -10,7 +10,7 @@ on: jobs: run: - name: Validate Language Info Files + name: Validate ThesaurusEntry Info Files runs-on: ubuntu-latest steps: diff --git a/web/management/commands/generate_missing_templates.py b/web/management/commands/generate_missing_templates.py index 1fc8c0a31..95f93c7c0 100644 --- a/web/management/commands/generate_missing_templates.py +++ b/web/management/commands/generate_missing_templates.py @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand -from web.models import Language, MetaInfo +from web.models import ThesaurusEntry, ThesaurusMetaInfo import os @@ -9,12 +9,12 @@ class Command(BaseCommand): help = 'Generate missing language thesaurus files to be filled out' def handle(self, *args, **options): - meta_info = MetaInfo() + meta_info = ThesaurusMetaInfo() languages = meta_info.languages structures = meta_info.structures for language in languages: - versions = Language(language, languages[language]).versions() + versions = ThesaurusEntry(language, languages[language]).versions() for version in versions: for structure in structures: file_path = os.path.join( diff --git a/web/management/commands/generate_template.py b/web/management/commands/generate_template.py index f60217ef1..23a94d245 100644 --- a/web/management/commands/generate_template.py +++ b/web/management/commands/generate_template.py @@ -1,7 +1,7 @@ from django.core.management.base import BaseCommand from web.thesaurus_template_generators import generate_language_template -from web.models import MetaInfo +from web.models import ThesaurusMetaInfo from packaging.version import parse as parse_version import os @@ -11,7 +11,7 @@ class Command(BaseCommand): help = 'Generate language thesaurus files to be filled out' def add_arguments(self, parser): - structures = list(MetaInfo().structures.keys()) + structures = list(ThesaurusMetaInfo().structures.keys()) parser.add_argument('language', help="Key of the programming language") parser.add_argument( diff --git a/web/management/commands/validatelanginfofiles.py b/web/management/commands/validatelanginfofiles.py index e6c35e38f..fb6cb326a 100644 --- a/web/management/commands/validatelanginfofiles.py +++ b/web/management/commands/validatelanginfofiles.py @@ -80,7 +80,7 @@ def check_meta_section(self, data, relative_path): if not language_name: self.report_error(f"`{relative_path}` has an empty `language_name` attribute and needs to be updated") - elif language_name in ["Human-Friendly Language Name", "Human-Readable Language Name"]: + elif language_name in ["Human-Friendly ThesaurusEntry Name", "Human-Readable ThesaurusEntry Name"]: self.report_error(f"`{relative_path}` has the default `language_name` attribute and needs to be updated") if "categories" in data: diff --git a/web/management/commands/validatemetainfofile.py b/web/management/commands/validatemetainfofile.py index 1fe975b41..71ceebde8 100644 --- a/web/management/commands/validatemetainfofile.py +++ b/web/management/commands/validatemetainfofile.py @@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand, CommandError -from web.models import MetaInfo +from web.models import ThesaurusMetaInfo class Command(BaseCommand): @@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs): self.meta_path = self.thesauruses_path / "_meta" def handle(self, *args, **options): - self.metainfo = MetaInfo() + self.metainfo = ThesaurusMetaInfo() self.check_thesaurus_directories() self.check_meta_info_consistency() @@ -61,10 +61,10 @@ def check_meta_info_consistency(self): self.report_error(f"{lang_name} is listed as a language in `meta_info.json` but the directory `{path}` doesn't exist") def check_meta_files_consistency(self): - """Check structures in _meta match those in MetaInfo""" + """Check structures in _meta match those in ThesaurusMetaInfo""" meta_files = {f.name for f in self.meta_path.iterdir() if f.is_file()} - # Check files in _meta are listed in MetaInfo + # Check files in _meta are listed in ThesaurusMetaInfo for meta_file in meta_files: if not meta_file.endswith(".json"): continue @@ -72,7 +72,7 @@ def check_meta_files_consistency(self): if structure_name not in self.metainfo.structures: self.report_error(f"`{self.meta_path / meta_file}` is not listed as a structure in `meta_info.json`") - # Check structures listed in MetaInfo have corresponding files in _meta + # Check structures listed in ThesaurusMetaInfo have corresponding files in _meta for structure in self.metainfo.structures: path = self.meta_path / f"{structure}.json" if not path.is_file(): diff --git a/web/models.py b/web/models.py index 0236e79ca..06caddc72 100644 --- a/web/models.py +++ b/web/models.py @@ -38,7 +38,7 @@ def __init__(self, key, name): MetaStructure._cached_files[key] = self.categories -class Language: +class ThesaurusEntry: """ Represents a programming language and knows how to fetch concepts for a structure key @@ -46,7 +46,7 @@ class Language: def __init__(self, key, name): """ - Initialize the Language object, which will contain concepts for a given + Initialize the ThesaurusEntry object, which will contain concepts for a given structure :param key: key of the language in the meta_info.json file @@ -63,7 +63,7 @@ def __init__(self, key, name): def versions(self): - """Generate all versions and their paths for the Language""" + """Generate all versions and their paths for the ThesaurusEntry""" versions = dict() try: for entry in os.scandir(self.language_dir): @@ -89,7 +89,7 @@ def __bool__(self): def load_concepts(self, structure_key, version): """ - Loads the structure file into the Language object + Loads the structure file into the ThesaurusEntry object :param structure_key: the key for the structure to load :param version: the version of the language @@ -101,12 +101,12 @@ def load_concepts(self, structure_key, version): self.version = version def load_filled_concepts(self, structure_key, version): - from web.thesaurus_template_generators import generate_language_template + from web.thesaurus_template_generators import generate_entry_template """ - Loads the concepts from the language's structure file + Loads the concepts from the entry's structure file :param structure_key: the ID for the concept to load - :param version: the version of the language + :param version: the version of the entry :return: a dict containing the code and comment, and possibly the 'not-implemented' flag. They are empty code entries if not specified :rtype: object Filled template @@ -114,7 +114,7 @@ def load_filled_concepts(self, structure_key, version): self.load_concepts(structure_key, version) - template = generate_language_template( + template = generate_entry_template( self.key, structure_key, version @@ -128,24 +128,24 @@ def load_filled_concepts(self, structure_key, version): return response - def load_comparison(self, structure_key, lang, version_lang, version_self): - lang = Language(lang, "") + def load_comparison(self, structure_key, entry_key, version_entry, version_self): + entry_obj = ThesaurusEntry(entry_key, "") self_filled_concept = self.load_filled_concepts(structure_key, version_self) - lang_filled_concept = lang.load_filled_concepts(structure_key, version_lang) + entry_filled_concept = entry_obj.load_filled_concepts(structure_key, version_entry) - if self_filled_concept is False or lang_filled_concept is False: + if self_filled_concept is False or entry_filled_concept is False: return False response = json.dumps({ "meta": { - "language_1": self.key, - "language_version_1": version_self, - "language_2": lang.key, - "language_version_2": version_lang, + "entry_1": self.key, + "entry_version_1": version_self, + "entry_2": entry_obj.key, + "entry_version_2": version_entry, "structure": structure_key }, "concepts1": json.loads(self_filled_concept)['concepts'], - "concepts2": json.loads(lang_filled_concept)['concepts'] + "concepts2": json.loads(entry_filled_concept)['concepts'] }, indent=2) return response @@ -154,7 +154,7 @@ def load_comparison(self, structure_key, lang, version_lang, version_self): def concept(self, concept_key): """ Get the concept (including code and comment) from the concept file for - that Language + that ThesaurusEntry :param concept_key: key for the concept to look up :returns: a dict containing the code and comment, and possibly the @@ -248,8 +248,8 @@ def has_any_implemented_in_category(self, category_concepts_keys): return False -class MissingLanguageError(Exception): - """Error for when a requested language is not defined in `meta.json`""" +class MissingEntryError(Exception): + """Error for when a requested entry is not defined in `meta.json`""" def __init__(self, key): super().__init__() self.key = key @@ -257,31 +257,31 @@ def __init__(self, key): class MissingStructureError(Exception): """ - Error that signals that a specific language & version does not have the structure + Error that signals that a specific entry & version does not have the structure defined """ - def __init__(self, structure, language_key, language_name, language_version): + def __init__(self, structure, entry_key, entry_name, entry_version): super().__init__() self.structure = structure - self.language_key = language_key - self.language_name = language_name - self.language_version = language_version + self.entry_key = entry_key + self.entry_name = entry_name + self.entry_version = entry_version -class MetaInfo: +class ThesaurusMetaInfo: """Holds info about structures and languages""" _cached_structures = None _cached_languages = None def __init__(self): """ - Initializes MetaInfo object with meta language information + Initializes ThesaurusMetaInfo object with meta language information :rtype: None """ - if MetaInfo._cached_structures is not None: - self.structures = MetaInfo._cached_structures - self.languages = MetaInfo._cached_languages + if ThesaurusMetaInfo._cached_structures is not None: + self.structures = ThesaurusMetaInfo._cached_structures + self.languages = ThesaurusMetaInfo._cached_languages return meta_info_file_path = os.path.join( @@ -290,54 +290,54 @@ def __init__(self): meta_info_json = json.load(meta_file) self.structures = meta_info_json["structures"] self.languages = meta_info_json["languages"] - MetaInfo._cached_structures = self.structures - MetaInfo._cached_languages = self.languages + ThesaurusMetaInfo._cached_structures = self.structures + ThesaurusMetaInfo._cached_languages = self.languages - def language_name(self, language_key): + def entry_name(self, entry_key): """ - Given a structure key (from meta_info.json), returns the language's human-friendly name + Given a structure key (from meta_info.json), returns the entry's human-friendly name - :param language_key: key of the language located in the meta_info.json file + :param entry_key: key of the entry located in the meta_info.json file :return: string with the human-friendly name """ - return self.languages[language_key] + return self.languages[entry_key] - def language(self, language_key): + def entry(self, entry_key): """ - Given a language key (from meta_info.json), returns the whole - Language for it + Given a entry key (from meta_info.json), returns the whole + ThesaurusEntry for it - :param language_key: key of the language located in the meta_info.json + :param entry_key: key of the entry located in the meta_info.json file - :return: Language for the requested key - :rtype: Language + :return: ThesaurusEntry for the requested key + :rtype: ThesaurusEntry """ - return Language( - language_key, - self.language_name(language_key), + return ThesaurusEntry( + entry_key, + self.entry_name(entry_key), ) - def load_languages(self, language_keys_versions, meta_structure): - """Tries to load all languages from `language_keys` and the requested `structure`""" - languages = [] - for language_key, version in language_keys_versions: + def load_entries(self, entry_keys_versions, meta_structure): + """Tries to load all entries from `entry_keys` and the requested `structure`""" + entries = [] + for entry_key, version in entry_keys_versions: try: - language = self.language(language_key) - version = version or sorted(language.versions())[-1] - language.load_concepts(meta_structure.key, version) - languages.append(language) + entry = self.entry(entry_key) + version = version or sorted(entry.versions())[-1] + entry.load_concepts(meta_structure.key, version) + entries.append(entry) except FileNotFoundError as file_not_found: raise MissingStructureError( meta_structure, - language_key, - self.language_name(language_key), + entry_key, + self.entry_name(entry_key), version, ) from file_not_found except KeyError as key_error: - raise MissingLanguageError(language_key) from key_error - return languages + raise MissingEntryError(entry_key) from key_error + return entries def structure_name(self, structure_key): diff --git a/web/tests/test_models.py b/web/tests/test_models.py index 62d236cb6..cd7acbd86 100644 --- a/web/tests/test_models.py +++ b/web/tests/test_models.py @@ -3,15 +3,15 @@ from django.test import TestCase -from web.models import Language, MetaInfo, MetaStructure +from web.models import ThesaurusEntry, ThesaurusMetaInfo, MetaStructure class TestMetaStructures(TestCase): - """TestCase for Language, MetaInfo and MetaStructure""" + """TestCase for ThesaurusEntry, ThesaurusMetaInfo and MetaStructure""" def setUp(self): """prepare sample data for the tests""" - self.metainfo = MetaInfo() + self.metainfo = ThesaurusMetaInfo() with open("web/thesauruses/meta_info.json", 'r') as meta_file: meta_data = json.load(meta_file) self.structures = meta_data["structures"] @@ -32,18 +32,18 @@ def setUp(self): "concept3": {"not-implemented": "true"}, "concept4": {"code": ["line1", "line2"]} } - language = Language(language_key, language_name) + language = ThesaurusEntry(language_key, language_name) # This is like the manual work of calling language.load_structure() language.concepts = concepts self.dummy_language = language def test_metainfo_structure(self): - """test MetaInfo creation""" + """test ThesaurusMetaInfo creation""" self.assertIsNotNone(self.metainfo) def test_metainfo_structure_name(self): - """test MetaInfo#name""" + """test ThesaurusMetaInfo#name""" test_key = self.metainfo.structure_name( self.sample["structure_key"]) @@ -57,15 +57,15 @@ def test_metastructure_init(self): self.assertIsNotNone(metastructure.categories) def test_language_init(self): - """test Language creation""" - language = Language(self.sample["language_key"], self.sample["language_name"]) + """test ThesaurusEntry creation""" + language = ThesaurusEntry(self.sample["language_key"], self.sample["language_name"]) self.assertIsNotNone(language) self.assertIsNotNone(language.key) self.assertIsNone(language.concepts) def test_language_bad_key_and_lang_exists(self): - """test Language behaviour with bad language key""" + """test ThesaurusEntry behaviour with bad language key""" language = self.dummy_language self.assertEqual(bool(language), False) @@ -78,8 +78,8 @@ def test_language_bad_key_and_lang_exists(self): # if someone can think of a better solution, I'm here for it! # def test_language_has_key_and_lang_exists(self): - # """test Language behaviour with good key and existing structure""" - # language = Language(self.sample["language_key"]) + # """test ThesaurusEntry behaviour with good key and existing structure""" + # language = ThesaurusEntry(self.sample["language_key"]) # # self.assertEqual(language.has_key(), True) # self.assertEqual(language.lang_exists(), True) @@ -88,7 +88,7 @@ def test_language_bad_key_and_lang_exists(self): # self.assertEqual(language.has_key(), True) def test_language_get_concept(self): - """test concept retrieval of a Language""" + """test concept retrieval of a ThesaurusEntry""" language = self.dummy_language # Test unknown concept self.assertEqual(language.concept("12345"), dict({ @@ -118,7 +118,7 @@ def test_language_concept_unknown(self): self.assertEqual(language.concept_unknown("concept4"), False) def test_language_concept_implemented(self): - """test Language#concept_implemented""" + """test ThesaurusEntry#concept_implemented""" language = self.dummy_language # Test unknown concept @@ -132,7 +132,7 @@ def test_language_concept_implemented(self): self.assertEqual(language.concept_implemented("concept4"), True) def test_language_get_concept_code(self): - """test Language#get_concept_code""" + """test ThesaurusEntry#get_concept_code""" language = self.dummy_language # Test unknown concept @@ -145,15 +145,15 @@ def test_language_get_concept_code(self): self.assertEqual(language.concept_code("concept4"), "line1\nline2") def test_language_versions(self): - """test Language#versions""" - language = Language("python", "Python") + """test ThesaurusEntry#versions""" + language = ThesaurusEntry("python", "Python") versions = language.versions() self.assertGreater(len(versions), 0) self.assertIn("3", versions) def test_language_load_filled_concepts(self): - """test Language#load_filled_concepts""" - language = Language("python", "Python") + """test ThesaurusEntry#load_filled_concepts""" + language = ThesaurusEntry("python", "Python") # Python 3 has data_types structure response = language.load_filled_concepts("data_types", "3") response_json = json.loads(response) @@ -164,34 +164,34 @@ def test_language_load_filled_concepts(self): self.assertIn("boolean", response_json["concepts"]) def test_language_load_comparison(self): - """test Language#load_comparison""" - language = Language("python", "Python") + """test ThesaurusEntry#load_comparison""" + language = ThesaurusEntry("python", "Python") response = language.load_comparison("data_types", "javascript", "ECMAScript 2023", "3") response_json = json.loads(response) - self.assertEqual(response_json["meta"]["language_1"], "python") - self.assertEqual(response_json["meta"]["language_2"], "javascript") + self.assertEqual(response_json["meta"]["entry_1"], "python") + self.assertEqual(response_json["meta"]["entry_2"], "javascript") self.assertIn("concepts1", response_json) self.assertIn("concepts2", response_json) - def test_metainfo_language_methods(self): - """test MetaInfo language related methods""" - self.assertEqual(self.metainfo.language_name("python"), "Python") - lang = self.metainfo.language("python") - self.assertIsInstance(lang, Language) + def test_metainfo_entry_methods(self): + """test ThesaurusMetaInfo entry related methods""" + self.assertEqual(self.metainfo.entry_name("python"), "Python") + lang = self.metainfo.entry("python") + self.assertIsInstance(lang, ThesaurusEntry) self.assertEqual(lang.key, "python") - def test_metainfo_load_languages(self): - """test MetaInfo#load_languages""" + def test_metainfo_load_entries(self): + """test ThesaurusMetaInfo#load_entries""" structure = self.metainfo.structure("data_types") - langs = self.metainfo.load_languages([("python", "3"), ("javascript", "ECMAScript 2023")], structure) + langs = self.metainfo.load_entries([("python", "3"), ("javascript", "ECMAScript 2023")], structure) self.assertEqual(len(langs), 2) self.assertEqual(langs[0].key, "python") self.assertEqual(langs[1].key, "javascript") - def test_metainfo_load_languages_missing_structure(self): - """test MetaInfo#load_languages with missing structure""" + def test_metainfo_load_entries_missing_structure(self): + """test ThesaurusMetaInfo#load_entries with missing structure""" from web.models import MissingStructureError structure = self.metainfo.structure("data_types") with self.assertRaises(MissingStructureError): # python 3 definitely has data_types, but let's try something that doesn't exist - self.metainfo.load_languages([("python", "non_existent_version")], structure) + self.metainfo.load_entries([("python", "non_existent_version")], structure) diff --git a/web/tests/test_views.py b/web/tests/test_views.py index 39c810b12..324e2aec8 100644 --- a/web/tests/test_views.py +++ b/web/tests/test_views.py @@ -294,8 +294,8 @@ def test_api_compare_valid(self): self.assertIn('meta', response_data) self.assertIn('concepts1', response_data) self.assertIn('concepts2', response_data) - self.assertEqual(response_data['meta']['language_1'], 'python') - self.assertEqual(response_data['meta']['language_2'], 'javascript') + self.assertEqual(response_data['meta']['entry_1'], 'python') + self.assertEqual(response_data['meta']['entry_2'], 'javascript') def test_concepts_view_valid_params(self): """Test concepts view with valid parameters that should return 200""" diff --git a/web/thesaurus_template_generators.py b/web/thesaurus_template_generators.py index 1b73f12e0..a5faeff3f 100644 --- a/web/thesaurus_template_generators.py +++ b/web/thesaurus_template_generators.py @@ -1,20 +1,20 @@ """Generator functions for thesaurus files""" import json -from web.models import MetaInfo +from web.models import ThesaurusMetaInfo -def generate_language_template(language_key, structure_key, version=None): - """Generate a template for the given language and structure""" - meta_info = MetaInfo() +def generate_entry_template(entry_key, structure_key, version=None): + """Generate a template for the given entry and structure""" + meta_info = ThesaurusMetaInfo() if structure_key not in meta_info.structures: raise ValueError - language_name = meta_info.languages.get( - language_key, - 'Human-Readable Language Name' + entry_name = meta_info.languages.get( + entry_key, + 'Human-Readable Name' ) meta = { - 'language': language_key, - 'language_name': language_name, + 'language': entry_key, + 'language_name': entry_name, 'structure': structure_key, } diff --git a/web/views.py b/web/views.py index 39100fab0..373bafb06 100644 --- a/web/views.py +++ b/web/views.py @@ -22,15 +22,15 @@ from codethesaurus.settings import BASE_DIR from web.models import ( - Language, + ThesaurusEntry, LookupData, - MetaInfo, - MissingLanguageError, + ThesaurusMetaInfo, + MissingEntryError, MissingLookup, MissingStructureError, SiteVisit, ) -from web.thesaurus_template_generators import generate_language_template +from web.thesaurus_template_generators import generate_entry_template def store_url_info(request): @@ -105,40 +105,40 @@ def index(request): if "lang" in request.GET and "concept" in request.GET: return concepts(request) - meta_info = MetaInfo() + meta_info = ThesaurusMetaInfo() - meta_data_langs = dict() + meta_data_entries = dict() for key in meta_info.languages: - lang = meta_info.language(key) - meta_data_langs[key] = [{ - "name": lang.name, + entry = meta_info.entry(key) + meta_data_entries[key] = [{ + "name": entry.name, "version": version, "availStructs": [] - } for version in lang.versions()] + } for version in entry.versions()] - random_langs = random.sample(list(meta_data_langs.values()), k=3) + random_entries = random.sample(list(meta_data_entries.values()), k=3) thesauruses_dir = os.path.join(BASE_DIR, 'web', 'thesauruses') meta_dir = os.path.join(thesauruses_dir, '_meta') meta_concepts = os.listdir(meta_dir) - for lang in os.listdir(thesauruses_dir): - if 'meta' in lang: + for entry_dir in os.listdir(thesauruses_dir): + if 'meta' in entry_dir: continue - for ver in os.listdir(os.path.join(thesauruses_dir, lang)): + for ver in os.listdir(os.path.join(thesauruses_dir, entry_dir)): for concept_json in meta_concepts: concept_name = concept_json.split('.')[0] - if os.path.isdir(os.path.join(thesauruses_dir, lang, ver)): - if concept_json in os.listdir(os.path.join(thesauruses_dir, lang, ver)): - for i in meta_data_langs[lang]: + if os.path.isdir(os.path.join(thesauruses_dir, entry_dir, ver)): + if concept_json in os.listdir(os.path.join(thesauruses_dir, entry_dir, ver)): + for i in meta_data_entries[entry_dir]: if i['version'] == ver: i['availStructs'].append(concept_name) break content = { 'title': 'Welcome', - 'languages': meta_data_langs, + 'languages': meta_data_entries, 'structures': meta_info.structures, - 'randomLanguages': random_langs, + 'randomLanguages': random_entries, 'description': 'Code Thesaurus: A polyglot developer reference tool' } return render(request, 'index.html', content) @@ -154,7 +154,7 @@ def statistics(request): """ store_url_info(request) - meta_info = MetaInfo() + meta_info = ThesaurusMetaInfo() # Most popular languages (considering both language1 and language2) # We need to aggregate counts for each language across both fields. @@ -174,8 +174,8 @@ def statistics(request): popular_languages = [] for lang_key, count in sorted_langs[:10]: try: - name = meta_info.language_name(lang_key) - except (KeyError, MissingLanguageError): + name = meta_info.entry_name(lang_key) + except (KeyError, MissingEntryError): name = lang_key popular_languages.append({'name': name, 'count': count}) @@ -196,12 +196,12 @@ def statistics(request): popular_comparisons = [] for item in comparison_counts: try: - name1 = meta_info.language_name(item['language1']) - except (KeyError, MissingLanguageError): + name1 = meta_info.entry_name(item['language1']) + except (KeyError, MissingEntryError): name1 = item['language1'] try: - name2 = meta_info.language_name(item['language2']) - except (KeyError, MissingLanguageError): + name2 = meta_info.entry_name(item['language2']) + except (KeyError, MissingEntryError): name2 = item['language2'] popular_comparisons.append({'lang1': name1, 'lang2': name2, 'count': item['count']}) @@ -229,8 +229,8 @@ def statistics(request): popular_concept_langs = [] for (lang_key, struct_key), count in sorted_concept_langs[:10]: try: - lang_name = meta_info.language_name(lang_key) - except (KeyError, MissingLanguageError): + lang_name = meta_info.entry_name(lang_key) + except (KeyError, MissingEntryError): lang_name = lang_key try: struct_name = meta_info.structure_name(struct_key) @@ -248,12 +248,12 @@ def statistics(request): recent_lookups = [] for item in recent_lookups_query: try: - name1 = meta_info.language_name(item.language1) - except (KeyError, MissingLanguageError): + name1 = meta_info.entry_name(item.language1) + except (KeyError, MissingEntryError): name1 = item.language1 try: - name2 = meta_info.language_name(item.language2) if item.language2 else None - except (KeyError, MissingLanguageError): + name2 = meta_info.entry_name(item.language2) if item.language2 else None + except (KeyError, MissingEntryError): name2 = item.language2 try: @@ -276,17 +276,17 @@ def statistics(request): for item in missing_items_counts: label = item['item_value'] if item['item_type'] == 'language': - label = f"Language: {item['item_value']}" + label = f"ThesaurusEntry: {item['item_value']}" elif item['item_type'] == 'structure': try: - lang_name = meta_info.language_name(item['language_context']) - except (KeyError, MissingLanguageError): + lang_name = meta_info.entry_name(item['language_context']) + except (KeyError, MissingEntryError): lang_name = item['language_context'] label = f"Structure: {item['item_value']} (for {lang_name})" elif item['item_type'] == 'concept': try: - lang_name = meta_info.language_name(item['language_context']) - except (KeyError, MissingLanguageError): + lang_name = meta_info.entry_name(item['language_context']) + except (KeyError, MissingEntryError): lang_name = item['language_context'] label = f"Concept: {item['item_value']} (missing in {lang_name})" @@ -348,7 +348,7 @@ def concepts(request): if errors: return render_errors(request, errors) - meta_info = MetaInfo() + meta_info = ThesaurusMetaInfo() try: meta_structure = meta_info.structure(structure_key) except KeyError: @@ -356,7 +356,7 @@ def concepts(request): Double-check your URL and try again."]) try: - languages = meta_info.load_languages(language_strings, meta_structure) + entries = meta_info.load_entries(language_strings, meta_structure) except MissingStructureError as missing_structure: store_missing_info( visit, @@ -373,16 +373,16 @@ def concepts(request): "lang": missing_structure.language_key, "lang_name": missing_structure.language_name, "version": missing_structure.language_version, - "template": generate_language_template( + "template": generate_entry_template( missing_structure.language_key, missing_structure.structure.key, missing_structure.language_version ) } )) - except MissingLanguageError as missing_language: - store_missing_info(visit, 'language', missing_language.key) - errors.append(f"The language \"{missing_language.key}\" isn't valid. \ + except MissingEntryError as missing_entry: + store_missing_info(visit, 'language', missing_entry.key) + errors.append(f"The entry \"{missing_entry.key}\" isn't valid. \ Double-check your URL and try again.") if errors: @@ -391,19 +391,19 @@ def concepts(request): store_lookup_info( request, visit, - languages[0].key, - languages[0].version, - languages[1].key if len(languages) > 1 else "", - languages[1].version if len(languages) > 1 else "", + entries[0].key, + entries[0].version, + entries[1].key if len(entries) > 1 else "", + entries[1].version if len(entries) > 1 else "", meta_structure.key ) - lexers = [get_highlighter(lang.key) for lang in languages] + lexers = [get_highlighter(entry.key) for entry in entries] all_categories = [] for (category_key, category) in meta_structure.categories.items(): concept_keys = list(category.keys()) - concepts_list = [concepts_data(key, name, languages, lexers, visit) for (key, name) in category.items()] + concepts_list = [concepts_data(key, name, entries, lexers, visit) for (key, name) in category.items()] category_entry = { "key": category_key, @@ -411,35 +411,35 @@ def concepts(request): "is_incomplete": [] } - for lang in languages: + for entry in entries: is_incomplete = False # If nothing in this category is implemented for this language - if not lang.has_any_implemented_in_category(concept_keys): + if not entry.has_any_implemented_in_category(concept_keys): is_incomplete = True # OR if at least one concept is missing code/comment - elif lang.is_category_incomplete(concept_keys): + elif entry.is_category_incomplete(concept_keys): is_incomplete = True category_entry["is_incomplete"].append(is_incomplete) all_categories.append(category_entry) - for i, lang in enumerate(languages): - lang._is_incomplete = any(cat["is_incomplete"][i] for cat in all_categories) + for i, entry in enumerate(entries): + entry._is_incomplete = any(cat["is_incomplete"][i] for cat in all_categories) - return render_concepts(request, languages, meta_structure, all_categories) + return render_concepts(request, entries, meta_structure, all_categories) @require_http_methods(['GET']) -def render_concepts(request, languages, structure, all_categories): - """Renders the `structure` page for all `languages`""" +def render_concepts(request, entries, structure, all_categories): + """Renders the `structure` page for all `entries`""" - language_name_versions = [f"{l.name} ({l.version})" for l in languages] - if len(languages) == 1: - title = f"Reference for {language_name_versions[0]}" + entry_name_versions = [f"{l.name} ({l.version})" for l in entries] + if len(entries) == 1: + title = f"Reference for {entry_name_versions[0]}" else: - title = f"Comparing {', '.join(language_name_versions[:-1])}\ - and {language_name_versions[-1]}" + title = f"Comparing {', '.join(entry_name_versions[:-1])}\ + and {entry_name_versions[-1]}" response = { @@ -448,12 +448,12 @@ def render_concepts(request, languages, structure, all_categories): "concept_name": structure.name, "languages": [ { - "key": language.key, - "version": language.version, - "name": language.name, - "is_incomplete": language._is_incomplete, + "key": entry.key, + "version": entry.version, + "name": entry.name, + "is_incomplete": entry._is_incomplete, } - for language in languages + for entry in entries ], "categories": all_categories, "description": f"Code Thesaurus: {title}" @@ -524,75 +524,75 @@ def error_handler_500_server_error(request): return HttpResponseServerError(response) #get lexer -def get_highlighter(language): +def get_highlighter(entry_key): SIMILAR_LEXERS = settings.SIMILAR_LEXERS try: - lexer = get_lexer_by_name(language, startinline=True) + lexer = get_lexer_by_name(entry_key, startinline=True) except ClassNotFound: - lexer = get_lexer_by_name(SIMILAR_LEXERS.get(language, "text"), startinline=True) + lexer = get_lexer_by_name(SIMILAR_LEXERS.get(entry_key, "text"), startinline=True) return lexer # Helper functions -def format_code_for_display(concept_key, lang, lexer=None): +def format_code_for_display(concept_key, entry, lexer=None): """ Returns the formatted HTML formatted syntax-highlighted text for a concept key (from a meta - language file) and a language + thesaurus file) and an entry :param concept_key: name of the key to format - :param lang: language to format it (in meta language/syntax highlighter format) + :param entry: entry to format it (in meta entry/syntax highlighter format) :param lexer: optional pre-fetched lexer :return: string with code with applied HTML formatting """ - if lang.concept_unknown(concept_key) or lang.concept_code(concept_key) is None: + if entry.concept_unknown(concept_key) or entry.concept_code(concept_key) is None: return "Unknown" - if lang.concept_implemented(concept_key): + if entry.concept_implemented(concept_key): if lexer is None: - lexer = get_highlighter(lang.key) + lexer = get_highlighter(entry.key) return highlight( - lang.concept_code(concept_key), + entry.concept_code(concept_key), lexer, HtmlFormatter() ) return None -def format_comment_for_display(concept_key, lang): +def format_comment_for_display(concept_key, entry): """ - Returns the formatted HTML formatted comment text for a concept key (from a meta language - file) and a language + Returns the formatted HTML formatted comment text for a concept key (from a meta thesaurus + file) and an entry - :param concept_key: the concept key located in the meta language JSON file - :param lang: the key of the language to fetch concept key from + :param concept_key: the concept key located in the meta thesaurus JSON file + :param entry: the entry to fetch concept key from :return: formatted HTML for the comment """ - if not lang.concept_implemented(concept_key) and lang.concept_comment(concept_key) == "": - return "Not Implemented In This Language" - return lang.concept_comment(concept_key) + if not entry.concept_implemented(concept_key) and entry.concept_comment(concept_key) == "": + return "Not Implemented" + return entry.concept_comment(concept_key) -def concepts_data(key, name, languages, lexers=None, visit=None): +def concepts_data(key, name, entries, lexers=None, visit=None): """ - Generates the comparision object of a single concept + Generates the comparison object of a single concept :param key: key of the concept :param name: name of the concept - :param languages: list of languages to compare / get a reference for - :param lexers: optional list of pre-fetched lexers corresponding to languages + :param entries: list of entries to compare / get a reference for + :param lexers: optional list of pre-fetched lexers corresponding to entries :param visit: optional SiteVisit for logging missing items - :return: string with code with applied HTML formatting + :return: dict with code and comment for each entry """ data = [] - for i, lang in enumerate(languages): + for i, entry in enumerate(entries): lexer = lexers[i] if lexers else None # Log if concept is not implemented - if visit and not lang.concept_implemented(key): - store_missing_info(visit, 'concept', key, lang.key) + if visit and not entry.concept_implemented(key): + store_missing_info(visit, 'concept', key, entry.key) data.append({ - "code": format_code_for_display(key, lang, lexer), - "comment": format_comment_for_display(key, lang) + "code": format_code_for_display(key, entry, lexer), + "comment": format_comment_for_display(key, entry) }) return { @@ -653,14 +653,14 @@ def api_reference(request, structure_key, lang, version): """ visit = store_url_info(request) - lang_obj = Language(lang, "") + entry_obj = ThesaurusEntry(lang, "") try: - response = lang_obj.load_filled_concepts(structure_key, version) + response = entry_obj.load_filled_concepts(structure_key, version) except Exception as e: # Determine if it's a language or structure issue - # If Language(lang, "") failed to find versions, it might be a language issue - if not lang_obj.versions(): + # If ThesaurusEntry(lang, "") failed to find versions, it might be a language issue + if not entry_obj.versions(): store_missing_info(visit, 'language', lang) else: store_missing_info(visit, 'structure', structure_key, lang) @@ -697,7 +697,7 @@ def api_compare(request, structure_key, lang1, version1, lang2, version2): visit = store_url_info(request) try: - response = Language(lang1, "").load_comparison(structure_key, lang2, version2, version1) + response = ThesaurusEntry(lang1, "").load_comparison(structure_key, lang2, version2, version1) except Exception: # Simple logging for now store_missing_info(visit, 'structure', structure_key, f"{lang1}/{lang2}") From 393f014cb63de99e2fd11cbd2c5bc2f895c225fd Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Thu, 22 Jan 2026 12:35:58 -0500 Subject: [PATCH 02/15] (wip) Move language files to a langs/ directory --- .../{ => langs}/ada/2012/classes.json | 0 .../ada/2012/control_structures.json | 0 .../{ => langs}/ada/2012/data_types.json | 0 .../{ => langs}/ada/2012/functions.json | 0 .../{ => langs}/ada/2012/lists.json | 0 .../{ => langs}/ada/2012/operators.json | 0 .../{ => langs}/bash/3/classes.json | 0 .../bash/3/control_structures.json | 0 .../{ => langs}/bash/3/data_types.json | 0 .../{ => langs}/bash/3/functions.json | 0 .../{ => langs}/bash/3/operators.json | 0 .../{ => langs}/bash/5/classes.json | 0 .../bash/5/control_structures.json | 0 .../{ => langs}/bash/5/data_types.json | 0 .../{ => langs}/bash/5/functions.json | 0 .../{ => langs}/bash/5/operators.json | 0 web/thesauruses/{ => langs}/c/17/classes.json | 0 .../{ => langs}/c/17/control_structures.json | 0 .../{ => langs}/c/17/data_types.json | 0 .../{ => langs}/c/17/functions.json | 0 web/thesauruses/{ => langs}/c/17/io.json | 0 .../{ => langs}/c/17/operators.json | 0 web/thesauruses/{ => langs}/c/17/strings.json | 0 .../{ => langs}/clips/641/rules_facts.json | 0 .../{ => langs}/clojure/1/data_types.json | 0 .../{ => langs}/clojure/1/functions.json | 0 .../{ => langs}/clojure/1/operators.json | 0 .../{ => langs}/cpp/C++17/classes.json | 0 .../cpp/C++17/control_structures.json | 0 .../{ => langs}/cpp/C++17/data_types.json | 0 .../{ => langs}/cpp/C++17/functions.json | 0 .../{ => langs}/cpp/C++17/operators.json | 0 .../{ => langs}/cpp/C++17/strings.json | 0 .../{ => langs}/cpp/C++20/classes.json | 0 .../cpp/C++20/control_structures.json | 0 .../{ => langs}/cpp/C++20/data_types.json | 0 .../{ => langs}/cpp/C++20/functions.json | 0 web/thesauruses/{ => langs}/cpp/C++20/io.json | 0 .../{ => langs}/cpp/C++20/operators.json | 0 .../{ => langs}/csharp/9/classes.json | 0 .../csharp/9/control_structures.json | 0 .../{ => langs}/csharp/9/data_types.json | 0 .../csharp/9/exception_handling.json | 0 .../{ => langs}/csharp/9/functions.json | 0 .../{ => langs}/csharp/9/lists.json | 0 .../{ => langs}/csharp/9/operators.json | 0 .../{ => langs}/csharp/9/queues_stacks.json | 0 .../{ => langs}/csharp/9/strings.json | 0 .../{ => langs}/go/1/control_structures.json | 0 .../{ => langs}/go/1/data_types.json | 0 .../{ => langs}/go/1/functions.json | 0 web/thesauruses/{ => langs}/go/1/lists.json | 0 .../{ => langs}/go/1/operators.json | 0 web/thesauruses/{ => langs}/go/1/strings.json | 0 .../{ => langs}/haskell/2010/classes.json | 0 .../haskell/2010/control_structures.json | 0 .../{ => langs}/haskell/2010/data_types.json | 0 .../{ => langs}/haskell/2010/functions.json | 0 .../{ => langs}/haskell/2010/lists.json | 0 .../{ => langs}/haskell/2010/operators.json | 0 .../{ => langs}/haskell/2010/strings.json | 0 .../{ => langs}/java/11/classes.json | 0 .../java/11/control_structures.json | 0 .../{ => langs}/java/11/data_types.json | 0 .../java/11/exception_handling.json | 0 .../{ => langs}/java/11/functions.json | 0 .../{ => langs}/java/11/lists.json | 0 .../{ => langs}/java/11/operators.json | 0 .../{ => langs}/java/11/strings.json | 0 .../{ => langs}/java/15/classes.json | 0 .../java/15/control_structures.json | 0 .../{ => langs}/java/15/data_types.json | 0 .../java/15/exception_handling.json | 0 .../{ => langs}/java/15/functions.json | 0 .../{ => langs}/java/15/lists.json | 0 .../{ => langs}/java/15/operators.json | 0 .../{ => langs}/java/15/strings.json | 0 .../{ => langs}/java/17/classes.json | 0 .../java/17/control_structures.json | 0 .../{ => langs}/java/17/data_types.json | 0 .../java/17/exception_handling.json | 0 .../{ => langs}/java/17/functions.json | 0 .../{ => langs}/java/17/lists.json | 0 .../{ => langs}/java/17/operators.json | 0 .../{ => langs}/java/17/strings.json | 0 .../javascript/ECMAScript 2009/classes.json | 0 .../ECMAScript 2009/control_structures.json | 0 .../ECMAScript 2009/data_types.json | 0 .../ECMAScript 2009/exception_handling.json | 0 .../javascript/ECMAScript 2009/functions.json | 0 .../javascript/ECMAScript 2009/io.json | 0 .../javascript/ECMAScript 2009/lists.json | 0 .../javascript/ECMAScript 2009/operators.json | 0 .../ECMAScript 2009/queues_stacks.json | 0 .../javascript/ECMAScript 2009/strings.json | 0 .../javascript/ECMAScript 2020/classes.json | 0 .../ECMAScript 2020/control_structures.json | 0 .../ECMAScript 2020/data_types.json | 0 .../ECMAScript 2020/exception_handling.json | 0 .../javascript/ECMAScript 2020/functions.json | 0 .../javascript/ECMAScript 2020/io.json | 0 .../javascript/ECMAScript 2020/lists.json | 0 .../javascript/ECMAScript 2020/operators.json | 0 .../ECMAScript 2020/queues_stacks.json | 0 .../javascript/ECMAScript 2020/strings.json | 0 .../javascript/ECMAScript 2021/classes.json | 0 .../ECMAScript 2021/control_structures.json | 0 .../ECMAScript 2021/data_types.json | 0 .../ECMAScript 2021/exception_handling.json | 0 .../javascript/ECMAScript 2021/functions.json | 0 .../javascript/ECMAScript 2021/io.json | 0 .../javascript/ECMAScript 2021/lists.json | 0 .../javascript/ECMAScript 2021/operators.json | 0 .../ECMAScript 2021/queues_stacks.json | 0 .../javascript/ECMAScript 2021/strings.json | 0 .../javascript/ECMAScript 2023/classes.json | 0 .../ECMAScript 2023/control_structures.json | 0 .../ECMAScript 2023/data_types.json | 0 .../ECMAScript 2023/exception_handling.json | 0 .../javascript/ECMAScript 2023/functions.json | 0 .../javascript/ECMAScript 2023/io.json | 0 .../javascript/ECMAScript 2023/lists.json | 0 .../javascript/ECMAScript 2023/operators.json | 0 .../ECMAScript 2023/queues_stacks.json | 0 .../javascript/ECMAScript 2023/strings.json | 0 .../{ => langs}/kotlin/1.5/classes.json | 0 .../kotlin/1.5/control_structures.json | 0 .../{ => langs}/kotlin/1.5/data_types.json | 0 .../{ => langs}/kotlin/1.5/functions.json | 0 .../{ => langs}/kotlin/1.5/io.json | 0 .../{ => langs}/kotlin/1.5/lists.json | 0 .../{ => langs}/kotlin/1.5/operators.json | 0 .../{ => langs}/kotlin/1.5/queues_stacks.json | 0 .../{ => langs}/kotlin/1.5/strings.json | 0 .../{ => langs}/lua/5/control_structures.json | 0 .../{ => langs}/lua/5/data_types.json | 240 +++---- .../{ => langs}/lua/5/functions.json | 212 +++--- .../{ => langs}/lua/5/operators.json | 486 +++++++------- .../{ => langs}/lua/5/queues_stacks.json | 622 +++++++++--------- .../{ => langs}/lua/5/strings.json | 572 ++++++++-------- .../{ => langs}/nim/1/classes.json | 0 .../{ => langs}/nim/1/control_structures.json | 0 .../{ => langs}/nim/1/data_types.json | 0 .../{ => langs}/nim/1/exception_handling.json | 0 .../{ => langs}/nim/1/functions.json | 0 web/thesauruses/{ => langs}/nim/1/lists.json | 0 .../{ => langs}/nim/1/operators.json | 0 .../objectivec/2/control_structures.json | 0 .../{ => langs}/objectivec/2/data_types.json | 0 .../{ => langs}/objectivec/2/functions.json | 0 .../{ => langs}/objectivec/2/lists.json | 0 .../{ => langs}/objectivec/2/operators.json | 0 .../objectivec/2/queues_stacks.json | 0 .../perl/5/control_structures.json | 0 .../{ => langs}/perl/5/data_types.json | 0 .../{ => langs}/perl/5/operators.json | 0 .../{ => langs}/php/7/classes.json | 0 .../{ => langs}/php/7/control_structures.json | 0 .../{ => langs}/php/7/data_types.json | 0 .../{ => langs}/php/7/exception_handling.json | 0 .../{ => langs}/php/7/functions.json | 0 web/thesauruses/{ => langs}/php/7/lists.json | 0 .../{ => langs}/php/7/operators.json | 0 .../{ => langs}/php/8/classes.json | 0 .../{ => langs}/php/8/control_structures.json | 0 .../{ => langs}/php/8/data_types.json | 0 .../{ => langs}/php/8/exception_handling.json | 0 .../{ => langs}/php/8/functions.json | 0 web/thesauruses/{ => langs}/php/8/lists.json | 0 .../{ => langs}/php/8/operators.json | 0 .../{ => langs}/php/8/queues_stacks.json | 0 .../{ => langs}/powershell/7/classes.json | 0 .../powershell/7/control_structures.json | 0 .../{ => langs}/powershell/7/data_types.json | 0 .../{ => langs}/python/3/classes.json | 0 .../python/3/control_structures.json | 0 .../{ => langs}/python/3/data_types.json | 0 .../python/3/exception_handling.json | 0 .../{ => langs}/python/3/functions.json | 0 web/thesauruses/{ => langs}/python/3/io.json | 0 .../{ => langs}/python/3/lists.json | 0 .../{ => langs}/python/3/operators.json | 0 .../{ => langs}/python/3/queues_stacks.json | 0 .../{ => langs}/python/3/strings.json | 0 web/thesauruses/{ => langs}/r/4/classes.json | 0 .../{ => langs}/r/4/data_types.json | 0 web/thesauruses/{ => langs}/r/4/io.json | 0 web/thesauruses/{ => langs}/r/4/lists.json | 0 .../{ => langs}/r/4/operators.json | 0 .../{ => langs}/ruby/3/classes.json | 0 .../ruby/3/control_structures.json | 0 .../{ => langs}/ruby/3/data_types.json | 0 .../ruby/3/exception_handling.json | 0 .../{ => langs}/ruby/3/functions.json | 0 web/thesauruses/{ => langs}/ruby/3/lists.json | 0 .../{ => langs}/ruby/3/strings.json | 0 .../rust/1/control_structures.json | 0 .../{ => langs}/rust/1/data_types.json | 0 .../{ => langs}/rust/1/functions.json | 0 .../{ => langs}/rust/1/operators.json | 0 .../{ => langs}/rust/1/queues_stacks.json | 0 .../{ => langs}/rust/1/strings.json | 0 .../scala/2/control_structures.json | 0 .../{ => langs}/scala/2/data_types.json | 0 .../{ => langs}/scala/2/functions.json | 0 .../{ => langs}/scala/2/operators.json | 0 .../{ => langs}/swift/5/classes.json | 0 .../swift/5/control_structures.json | 0 .../{ => langs}/swift/5/data_types.json | 0 .../{ => langs}/swift/5/functions.json | 0 .../{ => langs}/swift/5/lists.json | 0 .../{ => langs}/swift/5/operators.json | 0 .../{ => langs}/swift/5/strings.json | 0 .../{ => langs}/typescript/4/classes.json | 0 .../typescript/4/control_structures.json | 0 .../{ => langs}/typescript/4/data_types.json | 0 .../typescript/4/exception_handling.json | 0 .../{ => langs}/typescript/4/functions.json | 0 .../{ => langs}/typescript/4/lists.json | 0 .../{ => langs}/typescript/4/operators.json | 0 .../typescript/4/queues_stacks.json | 0 .../{ => langs}/typescript/4/strings.json | 0 .../{ => langs}/vbnet/16/classes.json | 0 .../vbnet/16/control_structures.json | 0 .../{ => langs}/vbnet/16/data_types.json | 0 .../{ => langs}/vbnet/16/functions.json | 0 .../{ => langs}/vbnet/16/lists.json | 0 .../{ => langs}/vbnet/16/operators.json | 0 .../{ => langs}/vbnet/16/strings.json | 0 229 files changed, 1066 insertions(+), 1066 deletions(-) rename web/thesauruses/{ => langs}/ada/2012/classes.json (100%) rename web/thesauruses/{ => langs}/ada/2012/control_structures.json (100%) rename web/thesauruses/{ => langs}/ada/2012/data_types.json (100%) rename web/thesauruses/{ => langs}/ada/2012/functions.json (100%) rename web/thesauruses/{ => langs}/ada/2012/lists.json (100%) rename web/thesauruses/{ => langs}/ada/2012/operators.json (100%) rename web/thesauruses/{ => langs}/bash/3/classes.json (100%) rename web/thesauruses/{ => langs}/bash/3/control_structures.json (100%) rename web/thesauruses/{ => langs}/bash/3/data_types.json (100%) rename web/thesauruses/{ => langs}/bash/3/functions.json (100%) rename web/thesauruses/{ => langs}/bash/3/operators.json (100%) rename web/thesauruses/{ => langs}/bash/5/classes.json (100%) rename web/thesauruses/{ => langs}/bash/5/control_structures.json (100%) rename web/thesauruses/{ => langs}/bash/5/data_types.json (100%) rename web/thesauruses/{ => langs}/bash/5/functions.json (100%) rename web/thesauruses/{ => langs}/bash/5/operators.json (100%) rename web/thesauruses/{ => langs}/c/17/classes.json (100%) rename web/thesauruses/{ => langs}/c/17/control_structures.json (100%) rename web/thesauruses/{ => langs}/c/17/data_types.json (100%) rename web/thesauruses/{ => langs}/c/17/functions.json (100%) rename web/thesauruses/{ => langs}/c/17/io.json (100%) rename web/thesauruses/{ => langs}/c/17/operators.json (100%) rename web/thesauruses/{ => langs}/c/17/strings.json (100%) rename web/thesauruses/{ => langs}/clips/641/rules_facts.json (100%) rename web/thesauruses/{ => langs}/clojure/1/data_types.json (100%) rename web/thesauruses/{ => langs}/clojure/1/functions.json (100%) rename web/thesauruses/{ => langs}/clojure/1/operators.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/classes.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/control_structures.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/data_types.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/functions.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/operators.json (100%) rename web/thesauruses/{ => langs}/cpp/C++17/strings.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/classes.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/control_structures.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/data_types.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/functions.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/io.json (100%) rename web/thesauruses/{ => langs}/cpp/C++20/operators.json (100%) rename web/thesauruses/{ => langs}/csharp/9/classes.json (100%) rename web/thesauruses/{ => langs}/csharp/9/control_structures.json (100%) rename web/thesauruses/{ => langs}/csharp/9/data_types.json (100%) rename web/thesauruses/{ => langs}/csharp/9/exception_handling.json (100%) rename web/thesauruses/{ => langs}/csharp/9/functions.json (100%) rename web/thesauruses/{ => langs}/csharp/9/lists.json (100%) rename web/thesauruses/{ => langs}/csharp/9/operators.json (100%) rename web/thesauruses/{ => langs}/csharp/9/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/csharp/9/strings.json (100%) rename web/thesauruses/{ => langs}/go/1/control_structures.json (100%) rename web/thesauruses/{ => langs}/go/1/data_types.json (100%) rename web/thesauruses/{ => langs}/go/1/functions.json (100%) rename web/thesauruses/{ => langs}/go/1/lists.json (100%) rename web/thesauruses/{ => langs}/go/1/operators.json (100%) rename web/thesauruses/{ => langs}/go/1/strings.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/classes.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/control_structures.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/data_types.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/functions.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/lists.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/operators.json (100%) rename web/thesauruses/{ => langs}/haskell/2010/strings.json (100%) rename web/thesauruses/{ => langs}/java/11/classes.json (100%) rename web/thesauruses/{ => langs}/java/11/control_structures.json (100%) rename web/thesauruses/{ => langs}/java/11/data_types.json (100%) rename web/thesauruses/{ => langs}/java/11/exception_handling.json (100%) rename web/thesauruses/{ => langs}/java/11/functions.json (100%) rename web/thesauruses/{ => langs}/java/11/lists.json (100%) rename web/thesauruses/{ => langs}/java/11/operators.json (100%) rename web/thesauruses/{ => langs}/java/11/strings.json (100%) rename web/thesauruses/{ => langs}/java/15/classes.json (100%) rename web/thesauruses/{ => langs}/java/15/control_structures.json (100%) rename web/thesauruses/{ => langs}/java/15/data_types.json (100%) rename web/thesauruses/{ => langs}/java/15/exception_handling.json (100%) rename web/thesauruses/{ => langs}/java/15/functions.json (100%) rename web/thesauruses/{ => langs}/java/15/lists.json (100%) rename web/thesauruses/{ => langs}/java/15/operators.json (100%) rename web/thesauruses/{ => langs}/java/15/strings.json (100%) rename web/thesauruses/{ => langs}/java/17/classes.json (100%) rename web/thesauruses/{ => langs}/java/17/control_structures.json (100%) rename web/thesauruses/{ => langs}/java/17/data_types.json (100%) rename web/thesauruses/{ => langs}/java/17/exception_handling.json (100%) rename web/thesauruses/{ => langs}/java/17/functions.json (100%) rename web/thesauruses/{ => langs}/java/17/lists.json (100%) rename web/thesauruses/{ => langs}/java/17/operators.json (100%) rename web/thesauruses/{ => langs}/java/17/strings.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/classes.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/control_structures.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/data_types.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/exception_handling.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/functions.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/io.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/lists.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/operators.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2009/strings.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/classes.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/control_structures.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/data_types.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/exception_handling.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/functions.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/io.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/lists.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/operators.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2020/strings.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/classes.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/control_structures.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/data_types.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/exception_handling.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/functions.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/io.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/lists.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/operators.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2021/strings.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/classes.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/control_structures.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/data_types.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/exception_handling.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/functions.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/io.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/lists.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/operators.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/javascript/ECMAScript 2023/strings.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/classes.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/control_structures.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/data_types.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/functions.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/io.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/lists.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/operators.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/kotlin/1.5/strings.json (100%) rename web/thesauruses/{ => langs}/lua/5/control_structures.json (100%) rename web/thesauruses/{ => langs}/lua/5/data_types.json (96%) rename web/thesauruses/{ => langs}/lua/5/functions.json (97%) rename web/thesauruses/{ => langs}/lua/5/operators.json (95%) rename web/thesauruses/{ => langs}/lua/5/queues_stacks.json (96%) rename web/thesauruses/{ => langs}/lua/5/strings.json (97%) rename web/thesauruses/{ => langs}/nim/1/classes.json (100%) rename web/thesauruses/{ => langs}/nim/1/control_structures.json (100%) rename web/thesauruses/{ => langs}/nim/1/data_types.json (100%) rename web/thesauruses/{ => langs}/nim/1/exception_handling.json (100%) rename web/thesauruses/{ => langs}/nim/1/functions.json (100%) rename web/thesauruses/{ => langs}/nim/1/lists.json (100%) rename web/thesauruses/{ => langs}/nim/1/operators.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/control_structures.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/data_types.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/functions.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/lists.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/operators.json (100%) rename web/thesauruses/{ => langs}/objectivec/2/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/perl/5/control_structures.json (100%) rename web/thesauruses/{ => langs}/perl/5/data_types.json (100%) rename web/thesauruses/{ => langs}/perl/5/operators.json (100%) rename web/thesauruses/{ => langs}/php/7/classes.json (100%) rename web/thesauruses/{ => langs}/php/7/control_structures.json (100%) rename web/thesauruses/{ => langs}/php/7/data_types.json (100%) rename web/thesauruses/{ => langs}/php/7/exception_handling.json (100%) rename web/thesauruses/{ => langs}/php/7/functions.json (100%) rename web/thesauruses/{ => langs}/php/7/lists.json (100%) rename web/thesauruses/{ => langs}/php/7/operators.json (100%) rename web/thesauruses/{ => langs}/php/8/classes.json (100%) rename web/thesauruses/{ => langs}/php/8/control_structures.json (100%) rename web/thesauruses/{ => langs}/php/8/data_types.json (100%) rename web/thesauruses/{ => langs}/php/8/exception_handling.json (100%) rename web/thesauruses/{ => langs}/php/8/functions.json (100%) rename web/thesauruses/{ => langs}/php/8/lists.json (100%) rename web/thesauruses/{ => langs}/php/8/operators.json (100%) rename web/thesauruses/{ => langs}/php/8/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/powershell/7/classes.json (100%) rename web/thesauruses/{ => langs}/powershell/7/control_structures.json (100%) rename web/thesauruses/{ => langs}/powershell/7/data_types.json (100%) rename web/thesauruses/{ => langs}/python/3/classes.json (100%) rename web/thesauruses/{ => langs}/python/3/control_structures.json (100%) rename web/thesauruses/{ => langs}/python/3/data_types.json (100%) rename web/thesauruses/{ => langs}/python/3/exception_handling.json (100%) rename web/thesauruses/{ => langs}/python/3/functions.json (100%) rename web/thesauruses/{ => langs}/python/3/io.json (100%) rename web/thesauruses/{ => langs}/python/3/lists.json (100%) rename web/thesauruses/{ => langs}/python/3/operators.json (100%) rename web/thesauruses/{ => langs}/python/3/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/python/3/strings.json (100%) rename web/thesauruses/{ => langs}/r/4/classes.json (100%) rename web/thesauruses/{ => langs}/r/4/data_types.json (100%) rename web/thesauruses/{ => langs}/r/4/io.json (100%) rename web/thesauruses/{ => langs}/r/4/lists.json (100%) rename web/thesauruses/{ => langs}/r/4/operators.json (100%) rename web/thesauruses/{ => langs}/ruby/3/classes.json (100%) rename web/thesauruses/{ => langs}/ruby/3/control_structures.json (100%) rename web/thesauruses/{ => langs}/ruby/3/data_types.json (100%) rename web/thesauruses/{ => langs}/ruby/3/exception_handling.json (100%) rename web/thesauruses/{ => langs}/ruby/3/functions.json (100%) rename web/thesauruses/{ => langs}/ruby/3/lists.json (100%) rename web/thesauruses/{ => langs}/ruby/3/strings.json (100%) rename web/thesauruses/{ => langs}/rust/1/control_structures.json (100%) rename web/thesauruses/{ => langs}/rust/1/data_types.json (100%) rename web/thesauruses/{ => langs}/rust/1/functions.json (100%) rename web/thesauruses/{ => langs}/rust/1/operators.json (100%) rename web/thesauruses/{ => langs}/rust/1/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/rust/1/strings.json (100%) rename web/thesauruses/{ => langs}/scala/2/control_structures.json (100%) rename web/thesauruses/{ => langs}/scala/2/data_types.json (100%) rename web/thesauruses/{ => langs}/scala/2/functions.json (100%) rename web/thesauruses/{ => langs}/scala/2/operators.json (100%) rename web/thesauruses/{ => langs}/swift/5/classes.json (100%) rename web/thesauruses/{ => langs}/swift/5/control_structures.json (100%) rename web/thesauruses/{ => langs}/swift/5/data_types.json (100%) rename web/thesauruses/{ => langs}/swift/5/functions.json (100%) rename web/thesauruses/{ => langs}/swift/5/lists.json (100%) rename web/thesauruses/{ => langs}/swift/5/operators.json (100%) rename web/thesauruses/{ => langs}/swift/5/strings.json (100%) rename web/thesauruses/{ => langs}/typescript/4/classes.json (100%) rename web/thesauruses/{ => langs}/typescript/4/control_structures.json (100%) rename web/thesauruses/{ => langs}/typescript/4/data_types.json (100%) rename web/thesauruses/{ => langs}/typescript/4/exception_handling.json (100%) rename web/thesauruses/{ => langs}/typescript/4/functions.json (100%) rename web/thesauruses/{ => langs}/typescript/4/lists.json (100%) rename web/thesauruses/{ => langs}/typescript/4/operators.json (100%) rename web/thesauruses/{ => langs}/typescript/4/queues_stacks.json (100%) rename web/thesauruses/{ => langs}/typescript/4/strings.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/classes.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/control_structures.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/data_types.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/functions.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/lists.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/operators.json (100%) rename web/thesauruses/{ => langs}/vbnet/16/strings.json (100%) diff --git a/web/thesauruses/ada/2012/classes.json b/web/thesauruses/langs/ada/2012/classes.json similarity index 100% rename from web/thesauruses/ada/2012/classes.json rename to web/thesauruses/langs/ada/2012/classes.json diff --git a/web/thesauruses/ada/2012/control_structures.json b/web/thesauruses/langs/ada/2012/control_structures.json similarity index 100% rename from web/thesauruses/ada/2012/control_structures.json rename to web/thesauruses/langs/ada/2012/control_structures.json diff --git a/web/thesauruses/ada/2012/data_types.json b/web/thesauruses/langs/ada/2012/data_types.json similarity index 100% rename from web/thesauruses/ada/2012/data_types.json rename to web/thesauruses/langs/ada/2012/data_types.json diff --git a/web/thesauruses/ada/2012/functions.json b/web/thesauruses/langs/ada/2012/functions.json similarity index 100% rename from web/thesauruses/ada/2012/functions.json rename to web/thesauruses/langs/ada/2012/functions.json diff --git a/web/thesauruses/ada/2012/lists.json b/web/thesauruses/langs/ada/2012/lists.json similarity index 100% rename from web/thesauruses/ada/2012/lists.json rename to web/thesauruses/langs/ada/2012/lists.json diff --git a/web/thesauruses/ada/2012/operators.json b/web/thesauruses/langs/ada/2012/operators.json similarity index 100% rename from web/thesauruses/ada/2012/operators.json rename to web/thesauruses/langs/ada/2012/operators.json diff --git a/web/thesauruses/bash/3/classes.json b/web/thesauruses/langs/bash/3/classes.json similarity index 100% rename from web/thesauruses/bash/3/classes.json rename to web/thesauruses/langs/bash/3/classes.json diff --git a/web/thesauruses/bash/3/control_structures.json b/web/thesauruses/langs/bash/3/control_structures.json similarity index 100% rename from web/thesauruses/bash/3/control_structures.json rename to web/thesauruses/langs/bash/3/control_structures.json diff --git a/web/thesauruses/bash/3/data_types.json b/web/thesauruses/langs/bash/3/data_types.json similarity index 100% rename from web/thesauruses/bash/3/data_types.json rename to web/thesauruses/langs/bash/3/data_types.json diff --git a/web/thesauruses/bash/3/functions.json b/web/thesauruses/langs/bash/3/functions.json similarity index 100% rename from web/thesauruses/bash/3/functions.json rename to web/thesauruses/langs/bash/3/functions.json diff --git a/web/thesauruses/bash/3/operators.json b/web/thesauruses/langs/bash/3/operators.json similarity index 100% rename from web/thesauruses/bash/3/operators.json rename to web/thesauruses/langs/bash/3/operators.json diff --git a/web/thesauruses/bash/5/classes.json b/web/thesauruses/langs/bash/5/classes.json similarity index 100% rename from web/thesauruses/bash/5/classes.json rename to web/thesauruses/langs/bash/5/classes.json diff --git a/web/thesauruses/bash/5/control_structures.json b/web/thesauruses/langs/bash/5/control_structures.json similarity index 100% rename from web/thesauruses/bash/5/control_structures.json rename to web/thesauruses/langs/bash/5/control_structures.json diff --git a/web/thesauruses/bash/5/data_types.json b/web/thesauruses/langs/bash/5/data_types.json similarity index 100% rename from web/thesauruses/bash/5/data_types.json rename to web/thesauruses/langs/bash/5/data_types.json diff --git a/web/thesauruses/bash/5/functions.json b/web/thesauruses/langs/bash/5/functions.json similarity index 100% rename from web/thesauruses/bash/5/functions.json rename to web/thesauruses/langs/bash/5/functions.json diff --git a/web/thesauruses/bash/5/operators.json b/web/thesauruses/langs/bash/5/operators.json similarity index 100% rename from web/thesauruses/bash/5/operators.json rename to web/thesauruses/langs/bash/5/operators.json diff --git a/web/thesauruses/c/17/classes.json b/web/thesauruses/langs/c/17/classes.json similarity index 100% rename from web/thesauruses/c/17/classes.json rename to web/thesauruses/langs/c/17/classes.json diff --git a/web/thesauruses/c/17/control_structures.json b/web/thesauruses/langs/c/17/control_structures.json similarity index 100% rename from web/thesauruses/c/17/control_structures.json rename to web/thesauruses/langs/c/17/control_structures.json diff --git a/web/thesauruses/c/17/data_types.json b/web/thesauruses/langs/c/17/data_types.json similarity index 100% rename from web/thesauruses/c/17/data_types.json rename to web/thesauruses/langs/c/17/data_types.json diff --git a/web/thesauruses/c/17/functions.json b/web/thesauruses/langs/c/17/functions.json similarity index 100% rename from web/thesauruses/c/17/functions.json rename to web/thesauruses/langs/c/17/functions.json diff --git a/web/thesauruses/c/17/io.json b/web/thesauruses/langs/c/17/io.json similarity index 100% rename from web/thesauruses/c/17/io.json rename to web/thesauruses/langs/c/17/io.json diff --git a/web/thesauruses/c/17/operators.json b/web/thesauruses/langs/c/17/operators.json similarity index 100% rename from web/thesauruses/c/17/operators.json rename to web/thesauruses/langs/c/17/operators.json diff --git a/web/thesauruses/c/17/strings.json b/web/thesauruses/langs/c/17/strings.json similarity index 100% rename from web/thesauruses/c/17/strings.json rename to web/thesauruses/langs/c/17/strings.json diff --git a/web/thesauruses/clips/641/rules_facts.json b/web/thesauruses/langs/clips/641/rules_facts.json similarity index 100% rename from web/thesauruses/clips/641/rules_facts.json rename to web/thesauruses/langs/clips/641/rules_facts.json diff --git a/web/thesauruses/clojure/1/data_types.json b/web/thesauruses/langs/clojure/1/data_types.json similarity index 100% rename from web/thesauruses/clojure/1/data_types.json rename to web/thesauruses/langs/clojure/1/data_types.json diff --git a/web/thesauruses/clojure/1/functions.json b/web/thesauruses/langs/clojure/1/functions.json similarity index 100% rename from web/thesauruses/clojure/1/functions.json rename to web/thesauruses/langs/clojure/1/functions.json diff --git a/web/thesauruses/clojure/1/operators.json b/web/thesauruses/langs/clojure/1/operators.json similarity index 100% rename from web/thesauruses/clojure/1/operators.json rename to web/thesauruses/langs/clojure/1/operators.json diff --git a/web/thesauruses/cpp/C++17/classes.json b/web/thesauruses/langs/cpp/C++17/classes.json similarity index 100% rename from web/thesauruses/cpp/C++17/classes.json rename to web/thesauruses/langs/cpp/C++17/classes.json diff --git a/web/thesauruses/cpp/C++17/control_structures.json b/web/thesauruses/langs/cpp/C++17/control_structures.json similarity index 100% rename from web/thesauruses/cpp/C++17/control_structures.json rename to web/thesauruses/langs/cpp/C++17/control_structures.json diff --git a/web/thesauruses/cpp/C++17/data_types.json b/web/thesauruses/langs/cpp/C++17/data_types.json similarity index 100% rename from web/thesauruses/cpp/C++17/data_types.json rename to web/thesauruses/langs/cpp/C++17/data_types.json diff --git a/web/thesauruses/cpp/C++17/functions.json b/web/thesauruses/langs/cpp/C++17/functions.json similarity index 100% rename from web/thesauruses/cpp/C++17/functions.json rename to web/thesauruses/langs/cpp/C++17/functions.json diff --git a/web/thesauruses/cpp/C++17/operators.json b/web/thesauruses/langs/cpp/C++17/operators.json similarity index 100% rename from web/thesauruses/cpp/C++17/operators.json rename to web/thesauruses/langs/cpp/C++17/operators.json diff --git a/web/thesauruses/cpp/C++17/strings.json b/web/thesauruses/langs/cpp/C++17/strings.json similarity index 100% rename from web/thesauruses/cpp/C++17/strings.json rename to web/thesauruses/langs/cpp/C++17/strings.json diff --git a/web/thesauruses/cpp/C++20/classes.json b/web/thesauruses/langs/cpp/C++20/classes.json similarity index 100% rename from web/thesauruses/cpp/C++20/classes.json rename to web/thesauruses/langs/cpp/C++20/classes.json diff --git a/web/thesauruses/cpp/C++20/control_structures.json b/web/thesauruses/langs/cpp/C++20/control_structures.json similarity index 100% rename from web/thesauruses/cpp/C++20/control_structures.json rename to web/thesauruses/langs/cpp/C++20/control_structures.json diff --git a/web/thesauruses/cpp/C++20/data_types.json b/web/thesauruses/langs/cpp/C++20/data_types.json similarity index 100% rename from web/thesauruses/cpp/C++20/data_types.json rename to web/thesauruses/langs/cpp/C++20/data_types.json diff --git a/web/thesauruses/cpp/C++20/functions.json b/web/thesauruses/langs/cpp/C++20/functions.json similarity index 100% rename from web/thesauruses/cpp/C++20/functions.json rename to web/thesauruses/langs/cpp/C++20/functions.json diff --git a/web/thesauruses/cpp/C++20/io.json b/web/thesauruses/langs/cpp/C++20/io.json similarity index 100% rename from web/thesauruses/cpp/C++20/io.json rename to web/thesauruses/langs/cpp/C++20/io.json diff --git a/web/thesauruses/cpp/C++20/operators.json b/web/thesauruses/langs/cpp/C++20/operators.json similarity index 100% rename from web/thesauruses/cpp/C++20/operators.json rename to web/thesauruses/langs/cpp/C++20/operators.json diff --git a/web/thesauruses/csharp/9/classes.json b/web/thesauruses/langs/csharp/9/classes.json similarity index 100% rename from web/thesauruses/csharp/9/classes.json rename to web/thesauruses/langs/csharp/9/classes.json diff --git a/web/thesauruses/csharp/9/control_structures.json b/web/thesauruses/langs/csharp/9/control_structures.json similarity index 100% rename from web/thesauruses/csharp/9/control_structures.json rename to web/thesauruses/langs/csharp/9/control_structures.json diff --git a/web/thesauruses/csharp/9/data_types.json b/web/thesauruses/langs/csharp/9/data_types.json similarity index 100% rename from web/thesauruses/csharp/9/data_types.json rename to web/thesauruses/langs/csharp/9/data_types.json diff --git a/web/thesauruses/csharp/9/exception_handling.json b/web/thesauruses/langs/csharp/9/exception_handling.json similarity index 100% rename from web/thesauruses/csharp/9/exception_handling.json rename to web/thesauruses/langs/csharp/9/exception_handling.json diff --git a/web/thesauruses/csharp/9/functions.json b/web/thesauruses/langs/csharp/9/functions.json similarity index 100% rename from web/thesauruses/csharp/9/functions.json rename to web/thesauruses/langs/csharp/9/functions.json diff --git a/web/thesauruses/csharp/9/lists.json b/web/thesauruses/langs/csharp/9/lists.json similarity index 100% rename from web/thesauruses/csharp/9/lists.json rename to web/thesauruses/langs/csharp/9/lists.json diff --git a/web/thesauruses/csharp/9/operators.json b/web/thesauruses/langs/csharp/9/operators.json similarity index 100% rename from web/thesauruses/csharp/9/operators.json rename to web/thesauruses/langs/csharp/9/operators.json diff --git a/web/thesauruses/csharp/9/queues_stacks.json b/web/thesauruses/langs/csharp/9/queues_stacks.json similarity index 100% rename from web/thesauruses/csharp/9/queues_stacks.json rename to web/thesauruses/langs/csharp/9/queues_stacks.json diff --git a/web/thesauruses/csharp/9/strings.json b/web/thesauruses/langs/csharp/9/strings.json similarity index 100% rename from web/thesauruses/csharp/9/strings.json rename to web/thesauruses/langs/csharp/9/strings.json diff --git a/web/thesauruses/go/1/control_structures.json b/web/thesauruses/langs/go/1/control_structures.json similarity index 100% rename from web/thesauruses/go/1/control_structures.json rename to web/thesauruses/langs/go/1/control_structures.json diff --git a/web/thesauruses/go/1/data_types.json b/web/thesauruses/langs/go/1/data_types.json similarity index 100% rename from web/thesauruses/go/1/data_types.json rename to web/thesauruses/langs/go/1/data_types.json diff --git a/web/thesauruses/go/1/functions.json b/web/thesauruses/langs/go/1/functions.json similarity index 100% rename from web/thesauruses/go/1/functions.json rename to web/thesauruses/langs/go/1/functions.json diff --git a/web/thesauruses/go/1/lists.json b/web/thesauruses/langs/go/1/lists.json similarity index 100% rename from web/thesauruses/go/1/lists.json rename to web/thesauruses/langs/go/1/lists.json diff --git a/web/thesauruses/go/1/operators.json b/web/thesauruses/langs/go/1/operators.json similarity index 100% rename from web/thesauruses/go/1/operators.json rename to web/thesauruses/langs/go/1/operators.json diff --git a/web/thesauruses/go/1/strings.json b/web/thesauruses/langs/go/1/strings.json similarity index 100% rename from web/thesauruses/go/1/strings.json rename to web/thesauruses/langs/go/1/strings.json diff --git a/web/thesauruses/haskell/2010/classes.json b/web/thesauruses/langs/haskell/2010/classes.json similarity index 100% rename from web/thesauruses/haskell/2010/classes.json rename to web/thesauruses/langs/haskell/2010/classes.json diff --git a/web/thesauruses/haskell/2010/control_structures.json b/web/thesauruses/langs/haskell/2010/control_structures.json similarity index 100% rename from web/thesauruses/haskell/2010/control_structures.json rename to web/thesauruses/langs/haskell/2010/control_structures.json diff --git a/web/thesauruses/haskell/2010/data_types.json b/web/thesauruses/langs/haskell/2010/data_types.json similarity index 100% rename from web/thesauruses/haskell/2010/data_types.json rename to web/thesauruses/langs/haskell/2010/data_types.json diff --git a/web/thesauruses/haskell/2010/functions.json b/web/thesauruses/langs/haskell/2010/functions.json similarity index 100% rename from web/thesauruses/haskell/2010/functions.json rename to web/thesauruses/langs/haskell/2010/functions.json diff --git a/web/thesauruses/haskell/2010/lists.json b/web/thesauruses/langs/haskell/2010/lists.json similarity index 100% rename from web/thesauruses/haskell/2010/lists.json rename to web/thesauruses/langs/haskell/2010/lists.json diff --git a/web/thesauruses/haskell/2010/operators.json b/web/thesauruses/langs/haskell/2010/operators.json similarity index 100% rename from web/thesauruses/haskell/2010/operators.json rename to web/thesauruses/langs/haskell/2010/operators.json diff --git a/web/thesauruses/haskell/2010/strings.json b/web/thesauruses/langs/haskell/2010/strings.json similarity index 100% rename from web/thesauruses/haskell/2010/strings.json rename to web/thesauruses/langs/haskell/2010/strings.json diff --git a/web/thesauruses/java/11/classes.json b/web/thesauruses/langs/java/11/classes.json similarity index 100% rename from web/thesauruses/java/11/classes.json rename to web/thesauruses/langs/java/11/classes.json diff --git a/web/thesauruses/java/11/control_structures.json b/web/thesauruses/langs/java/11/control_structures.json similarity index 100% rename from web/thesauruses/java/11/control_structures.json rename to web/thesauruses/langs/java/11/control_structures.json diff --git a/web/thesauruses/java/11/data_types.json b/web/thesauruses/langs/java/11/data_types.json similarity index 100% rename from web/thesauruses/java/11/data_types.json rename to web/thesauruses/langs/java/11/data_types.json diff --git a/web/thesauruses/java/11/exception_handling.json b/web/thesauruses/langs/java/11/exception_handling.json similarity index 100% rename from web/thesauruses/java/11/exception_handling.json rename to web/thesauruses/langs/java/11/exception_handling.json diff --git a/web/thesauruses/java/11/functions.json b/web/thesauruses/langs/java/11/functions.json similarity index 100% rename from web/thesauruses/java/11/functions.json rename to web/thesauruses/langs/java/11/functions.json diff --git a/web/thesauruses/java/11/lists.json b/web/thesauruses/langs/java/11/lists.json similarity index 100% rename from web/thesauruses/java/11/lists.json rename to web/thesauruses/langs/java/11/lists.json diff --git a/web/thesauruses/java/11/operators.json b/web/thesauruses/langs/java/11/operators.json similarity index 100% rename from web/thesauruses/java/11/operators.json rename to web/thesauruses/langs/java/11/operators.json diff --git a/web/thesauruses/java/11/strings.json b/web/thesauruses/langs/java/11/strings.json similarity index 100% rename from web/thesauruses/java/11/strings.json rename to web/thesauruses/langs/java/11/strings.json diff --git a/web/thesauruses/java/15/classes.json b/web/thesauruses/langs/java/15/classes.json similarity index 100% rename from web/thesauruses/java/15/classes.json rename to web/thesauruses/langs/java/15/classes.json diff --git a/web/thesauruses/java/15/control_structures.json b/web/thesauruses/langs/java/15/control_structures.json similarity index 100% rename from web/thesauruses/java/15/control_structures.json rename to web/thesauruses/langs/java/15/control_structures.json diff --git a/web/thesauruses/java/15/data_types.json b/web/thesauruses/langs/java/15/data_types.json similarity index 100% rename from web/thesauruses/java/15/data_types.json rename to web/thesauruses/langs/java/15/data_types.json diff --git a/web/thesauruses/java/15/exception_handling.json b/web/thesauruses/langs/java/15/exception_handling.json similarity index 100% rename from web/thesauruses/java/15/exception_handling.json rename to web/thesauruses/langs/java/15/exception_handling.json diff --git a/web/thesauruses/java/15/functions.json b/web/thesauruses/langs/java/15/functions.json similarity index 100% rename from web/thesauruses/java/15/functions.json rename to web/thesauruses/langs/java/15/functions.json diff --git a/web/thesauruses/java/15/lists.json b/web/thesauruses/langs/java/15/lists.json similarity index 100% rename from web/thesauruses/java/15/lists.json rename to web/thesauruses/langs/java/15/lists.json diff --git a/web/thesauruses/java/15/operators.json b/web/thesauruses/langs/java/15/operators.json similarity index 100% rename from web/thesauruses/java/15/operators.json rename to web/thesauruses/langs/java/15/operators.json diff --git a/web/thesauruses/java/15/strings.json b/web/thesauruses/langs/java/15/strings.json similarity index 100% rename from web/thesauruses/java/15/strings.json rename to web/thesauruses/langs/java/15/strings.json diff --git a/web/thesauruses/java/17/classes.json b/web/thesauruses/langs/java/17/classes.json similarity index 100% rename from web/thesauruses/java/17/classes.json rename to web/thesauruses/langs/java/17/classes.json diff --git a/web/thesauruses/java/17/control_structures.json b/web/thesauruses/langs/java/17/control_structures.json similarity index 100% rename from web/thesauruses/java/17/control_structures.json rename to web/thesauruses/langs/java/17/control_structures.json diff --git a/web/thesauruses/java/17/data_types.json b/web/thesauruses/langs/java/17/data_types.json similarity index 100% rename from web/thesauruses/java/17/data_types.json rename to web/thesauruses/langs/java/17/data_types.json diff --git a/web/thesauruses/java/17/exception_handling.json b/web/thesauruses/langs/java/17/exception_handling.json similarity index 100% rename from web/thesauruses/java/17/exception_handling.json rename to web/thesauruses/langs/java/17/exception_handling.json diff --git a/web/thesauruses/java/17/functions.json b/web/thesauruses/langs/java/17/functions.json similarity index 100% rename from web/thesauruses/java/17/functions.json rename to web/thesauruses/langs/java/17/functions.json diff --git a/web/thesauruses/java/17/lists.json b/web/thesauruses/langs/java/17/lists.json similarity index 100% rename from web/thesauruses/java/17/lists.json rename to web/thesauruses/langs/java/17/lists.json diff --git a/web/thesauruses/java/17/operators.json b/web/thesauruses/langs/java/17/operators.json similarity index 100% rename from web/thesauruses/java/17/operators.json rename to web/thesauruses/langs/java/17/operators.json diff --git a/web/thesauruses/java/17/strings.json b/web/thesauruses/langs/java/17/strings.json similarity index 100% rename from web/thesauruses/java/17/strings.json rename to web/thesauruses/langs/java/17/strings.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/classes.json b/web/thesauruses/langs/javascript/ECMAScript 2009/classes.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/classes.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/classes.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/control_structures.json b/web/thesauruses/langs/javascript/ECMAScript 2009/control_structures.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/control_structures.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/control_structures.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/data_types.json b/web/thesauruses/langs/javascript/ECMAScript 2009/data_types.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/data_types.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/data_types.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/exception_handling.json b/web/thesauruses/langs/javascript/ECMAScript 2009/exception_handling.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/exception_handling.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/exception_handling.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/functions.json b/web/thesauruses/langs/javascript/ECMAScript 2009/functions.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/functions.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/functions.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/io.json b/web/thesauruses/langs/javascript/ECMAScript 2009/io.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/io.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/io.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/lists.json b/web/thesauruses/langs/javascript/ECMAScript 2009/lists.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/lists.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/lists.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/operators.json b/web/thesauruses/langs/javascript/ECMAScript 2009/operators.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/operators.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/operators.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/queues_stacks.json b/web/thesauruses/langs/javascript/ECMAScript 2009/queues_stacks.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/queues_stacks.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/queues_stacks.json diff --git a/web/thesauruses/javascript/ECMAScript 2009/strings.json b/web/thesauruses/langs/javascript/ECMAScript 2009/strings.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2009/strings.json rename to web/thesauruses/langs/javascript/ECMAScript 2009/strings.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/classes.json b/web/thesauruses/langs/javascript/ECMAScript 2020/classes.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/classes.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/classes.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/control_structures.json b/web/thesauruses/langs/javascript/ECMAScript 2020/control_structures.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/control_structures.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/control_structures.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/data_types.json b/web/thesauruses/langs/javascript/ECMAScript 2020/data_types.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/data_types.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/data_types.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/exception_handling.json b/web/thesauruses/langs/javascript/ECMAScript 2020/exception_handling.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/exception_handling.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/exception_handling.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/functions.json b/web/thesauruses/langs/javascript/ECMAScript 2020/functions.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/functions.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/functions.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/io.json b/web/thesauruses/langs/javascript/ECMAScript 2020/io.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/io.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/io.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/lists.json b/web/thesauruses/langs/javascript/ECMAScript 2020/lists.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/lists.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/lists.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/operators.json b/web/thesauruses/langs/javascript/ECMAScript 2020/operators.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/operators.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/operators.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/queues_stacks.json b/web/thesauruses/langs/javascript/ECMAScript 2020/queues_stacks.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/queues_stacks.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/queues_stacks.json diff --git a/web/thesauruses/javascript/ECMAScript 2020/strings.json b/web/thesauruses/langs/javascript/ECMAScript 2020/strings.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2020/strings.json rename to web/thesauruses/langs/javascript/ECMAScript 2020/strings.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/classes.json b/web/thesauruses/langs/javascript/ECMAScript 2021/classes.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/classes.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/classes.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/control_structures.json b/web/thesauruses/langs/javascript/ECMAScript 2021/control_structures.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/control_structures.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/control_structures.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/data_types.json b/web/thesauruses/langs/javascript/ECMAScript 2021/data_types.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/data_types.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/data_types.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/exception_handling.json b/web/thesauruses/langs/javascript/ECMAScript 2021/exception_handling.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/exception_handling.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/exception_handling.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/functions.json b/web/thesauruses/langs/javascript/ECMAScript 2021/functions.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/functions.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/functions.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/io.json b/web/thesauruses/langs/javascript/ECMAScript 2021/io.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/io.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/io.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/lists.json b/web/thesauruses/langs/javascript/ECMAScript 2021/lists.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/lists.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/lists.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/operators.json b/web/thesauruses/langs/javascript/ECMAScript 2021/operators.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/operators.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/operators.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/queues_stacks.json b/web/thesauruses/langs/javascript/ECMAScript 2021/queues_stacks.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/queues_stacks.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/queues_stacks.json diff --git a/web/thesauruses/javascript/ECMAScript 2021/strings.json b/web/thesauruses/langs/javascript/ECMAScript 2021/strings.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2021/strings.json rename to web/thesauruses/langs/javascript/ECMAScript 2021/strings.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/classes.json b/web/thesauruses/langs/javascript/ECMAScript 2023/classes.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/classes.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/classes.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/control_structures.json b/web/thesauruses/langs/javascript/ECMAScript 2023/control_structures.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/control_structures.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/control_structures.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/data_types.json b/web/thesauruses/langs/javascript/ECMAScript 2023/data_types.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/data_types.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/data_types.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/exception_handling.json b/web/thesauruses/langs/javascript/ECMAScript 2023/exception_handling.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/exception_handling.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/exception_handling.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/functions.json b/web/thesauruses/langs/javascript/ECMAScript 2023/functions.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/functions.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/functions.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/io.json b/web/thesauruses/langs/javascript/ECMAScript 2023/io.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/io.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/io.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/lists.json b/web/thesauruses/langs/javascript/ECMAScript 2023/lists.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/lists.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/lists.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/operators.json b/web/thesauruses/langs/javascript/ECMAScript 2023/operators.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/operators.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/operators.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/queues_stacks.json b/web/thesauruses/langs/javascript/ECMAScript 2023/queues_stacks.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/queues_stacks.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/queues_stacks.json diff --git a/web/thesauruses/javascript/ECMAScript 2023/strings.json b/web/thesauruses/langs/javascript/ECMAScript 2023/strings.json similarity index 100% rename from web/thesauruses/javascript/ECMAScript 2023/strings.json rename to web/thesauruses/langs/javascript/ECMAScript 2023/strings.json diff --git a/web/thesauruses/kotlin/1.5/classes.json b/web/thesauruses/langs/kotlin/1.5/classes.json similarity index 100% rename from web/thesauruses/kotlin/1.5/classes.json rename to web/thesauruses/langs/kotlin/1.5/classes.json diff --git a/web/thesauruses/kotlin/1.5/control_structures.json b/web/thesauruses/langs/kotlin/1.5/control_structures.json similarity index 100% rename from web/thesauruses/kotlin/1.5/control_structures.json rename to web/thesauruses/langs/kotlin/1.5/control_structures.json diff --git a/web/thesauruses/kotlin/1.5/data_types.json b/web/thesauruses/langs/kotlin/1.5/data_types.json similarity index 100% rename from web/thesauruses/kotlin/1.5/data_types.json rename to web/thesauruses/langs/kotlin/1.5/data_types.json diff --git a/web/thesauruses/kotlin/1.5/functions.json b/web/thesauruses/langs/kotlin/1.5/functions.json similarity index 100% rename from web/thesauruses/kotlin/1.5/functions.json rename to web/thesauruses/langs/kotlin/1.5/functions.json diff --git a/web/thesauruses/kotlin/1.5/io.json b/web/thesauruses/langs/kotlin/1.5/io.json similarity index 100% rename from web/thesauruses/kotlin/1.5/io.json rename to web/thesauruses/langs/kotlin/1.5/io.json diff --git a/web/thesauruses/kotlin/1.5/lists.json b/web/thesauruses/langs/kotlin/1.5/lists.json similarity index 100% rename from web/thesauruses/kotlin/1.5/lists.json rename to web/thesauruses/langs/kotlin/1.5/lists.json diff --git a/web/thesauruses/kotlin/1.5/operators.json b/web/thesauruses/langs/kotlin/1.5/operators.json similarity index 100% rename from web/thesauruses/kotlin/1.5/operators.json rename to web/thesauruses/langs/kotlin/1.5/operators.json diff --git a/web/thesauruses/kotlin/1.5/queues_stacks.json b/web/thesauruses/langs/kotlin/1.5/queues_stacks.json similarity index 100% rename from web/thesauruses/kotlin/1.5/queues_stacks.json rename to web/thesauruses/langs/kotlin/1.5/queues_stacks.json diff --git a/web/thesauruses/kotlin/1.5/strings.json b/web/thesauruses/langs/kotlin/1.5/strings.json similarity index 100% rename from web/thesauruses/kotlin/1.5/strings.json rename to web/thesauruses/langs/kotlin/1.5/strings.json diff --git a/web/thesauruses/lua/5/control_structures.json b/web/thesauruses/langs/lua/5/control_structures.json similarity index 100% rename from web/thesauruses/lua/5/control_structures.json rename to web/thesauruses/langs/lua/5/control_structures.json diff --git a/web/thesauruses/lua/5/data_types.json b/web/thesauruses/langs/lua/5/data_types.json similarity index 96% rename from web/thesauruses/lua/5/data_types.json rename to web/thesauruses/langs/lua/5/data_types.json index 6dc5a20be..547cd9ceb 100644 --- a/web/thesauruses/lua/5/data_types.json +++ b/web/thesauruses/langs/lua/5/data_types.json @@ -1,120 +1,120 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "data_types", - "language_version": "5.1" - }, - "concepts": { - "boolean": { - "name": "Boolean", - "not-implemented": true, - "comment": "The type boolean has two values, false and true and both nil and false make a condition false." - }, - "signed_integer_8_bit": { - "name": "Signed 8-bit integer", - "not-implemented": true - }, - "unsigned_integer_8_bit": { - "name": "Unsigned 8-bit integer", - "not-implemented": true - }, - "signed_integer_16_bit": { - "name": "Signed 16-bit integer", - "not-implemented": true - }, - "unsigned_integer_16_bit": { - "name": "Unsigned 16-bit integer", - "not-implemented": true - }, - "signed_integer_32_bit": { - "name": "Signed 32-bit integer", - "not-implemented": true - }, - "unsigned_integer_32_bit": { - "name": "Unsigned 32-bit integer", - "not-implemented": true - }, - "signed_integer_64_bit": { - "name": "Signed 64-bit integer", - "not-implemented": true - }, - "unsigned_integer_64_bit": { - "name": "Unsigned 64-bit integer", - "not-implemented": true - }, - "signed_integer_as_object": { - "name": "Signed object-based Integer", - "not-implemented": true, - "comment":"Lua does not have a built-in concept of distinct signed, object-based integers with the full range of operations and methods that you might find in languages like C++ or Java." - }, - "unsigned_integer_as_object": { - "name": "Unsigned object-based Integer", - "not-implemented": true - }, - "signed_float_16_bit": { - "name": "Signed 16-bit floating point", - "not-implemented": true - }, - "unsigned_float_16_bit": { - "name": "Unsigned 16-bit floating point", - "not-implemented": true - }, - "signed_float_32_bit": { - "name": "Signed 32-bit floating point", - "not-implemented": true - }, - "unsigned_float_32_bit": { - "name": "Unsigned 32-bit floating point", - "not-implemented": true - }, - "signed_float_64_bit": { - "name": "Signed 64-bit floating point", - "not-implemented": true - }, - "unsigned_float_64_bit": { - "name": "Unsigned 64-bit floating point", - "not-implemented": true - }, - "signed_float_as_object": { - "name": "Signed object-based floating point", - "not-implemented": true, - "comment":"Same as integer applies here too." - }, - "unsigned_float_as_object": { - "name": "Unsigned object-based floating point", - "not-implemented": true - }, - "character": { - "name": "Character", - "not-implemented": true - }, - "string_as_object": { - "name": "String as an object", - "not-implemented": true, - "comment":"In Lua, strings are not treated as objects in the same way that some other programming languages, like Python or JavaScript" - }, - "string_as_array": { - "name": "String as an array of characters", - "code": - [ - "local myString = 'Hello, World!'\nlocal firstChar = myString:sub(1, 1) -- Access the first character\nlocal fifthChar = myString:sub(5, 5) -- Access the fifth character\nprint(firstChar) -- Output: 'H'\nprint(fifthChar) -- Output: 'o'" - ], - "comment":"In Lua, strings are treated as arrays of characters." - }, - "complex_as_object": { - "name": "Complex Number as an object", - "not-implemented": true, - "comment":"Lua does not have built-in support for complex numbers as a distinct data type like some other languages, such as Python." - - }, - "real_number_part": { - "name": "Complex number real part", - "not-implemented": true - }, - "imaginary_number_part": { - "name": "Complex number imaginary part", - "not-implemented": true - } - } -} +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "data_types", + "language_version": "5.1" + }, + "concepts": { + "boolean": { + "name": "Boolean", + "not-implemented": true, + "comment": "The type boolean has two values, false and true and both nil and false make a condition false." + }, + "signed_integer_8_bit": { + "name": "Signed 8-bit integer", + "not-implemented": true + }, + "unsigned_integer_8_bit": { + "name": "Unsigned 8-bit integer", + "not-implemented": true + }, + "signed_integer_16_bit": { + "name": "Signed 16-bit integer", + "not-implemented": true + }, + "unsigned_integer_16_bit": { + "name": "Unsigned 16-bit integer", + "not-implemented": true + }, + "signed_integer_32_bit": { + "name": "Signed 32-bit integer", + "not-implemented": true + }, + "unsigned_integer_32_bit": { + "name": "Unsigned 32-bit integer", + "not-implemented": true + }, + "signed_integer_64_bit": { + "name": "Signed 64-bit integer", + "not-implemented": true + }, + "unsigned_integer_64_bit": { + "name": "Unsigned 64-bit integer", + "not-implemented": true + }, + "signed_integer_as_object": { + "name": "Signed object-based Integer", + "not-implemented": true, + "comment":"Lua does not have a built-in concept of distinct signed, object-based integers with the full range of operations and methods that you might find in languages like C++ or Java." + }, + "unsigned_integer_as_object": { + "name": "Unsigned object-based Integer", + "not-implemented": true + }, + "signed_float_16_bit": { + "name": "Signed 16-bit floating point", + "not-implemented": true + }, + "unsigned_float_16_bit": { + "name": "Unsigned 16-bit floating point", + "not-implemented": true + }, + "signed_float_32_bit": { + "name": "Signed 32-bit floating point", + "not-implemented": true + }, + "unsigned_float_32_bit": { + "name": "Unsigned 32-bit floating point", + "not-implemented": true + }, + "signed_float_64_bit": { + "name": "Signed 64-bit floating point", + "not-implemented": true + }, + "unsigned_float_64_bit": { + "name": "Unsigned 64-bit floating point", + "not-implemented": true + }, + "signed_float_as_object": { + "name": "Signed object-based floating point", + "not-implemented": true, + "comment":"Same as integer applies here too." + }, + "unsigned_float_as_object": { + "name": "Unsigned object-based floating point", + "not-implemented": true + }, + "character": { + "name": "Character", + "not-implemented": true + }, + "string_as_object": { + "name": "String as an object", + "not-implemented": true, + "comment":"In Lua, strings are not treated as objects in the same way that some other programming languages, like Python or JavaScript" + }, + "string_as_array": { + "name": "String as an array of characters", + "code": + [ + "local myString = 'Hello, World!'\nlocal firstChar = myString:sub(1, 1) -- Access the first character\nlocal fifthChar = myString:sub(5, 5) -- Access the fifth character\nprint(firstChar) -- Output: 'H'\nprint(fifthChar) -- Output: 'o'" + ], + "comment":"In Lua, strings are treated as arrays of characters." + }, + "complex_as_object": { + "name": "Complex Number as an object", + "not-implemented": true, + "comment":"Lua does not have built-in support for complex numbers as a distinct data type like some other languages, such as Python." + + }, + "real_number_part": { + "name": "Complex number real part", + "not-implemented": true + }, + "imaginary_number_part": { + "name": "Complex number imaginary part", + "not-implemented": true + } + } +} diff --git a/web/thesauruses/lua/5/functions.json b/web/thesauruses/langs/lua/5/functions.json similarity index 97% rename from web/thesauruses/lua/5/functions.json rename to web/thesauruses/langs/lua/5/functions.json index 7bbabf3c5..8d6d63f3f 100644 --- a/web/thesauruses/lua/5/functions.json +++ b/web/thesauruses/langs/lua/5/functions.json @@ -1,106 +1,106 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "functions", - "language_version": "5.1" - }, - "concepts": { - "void_function_no_parameters": { - "name": "Function that does not return a value and takes no parameters", - "code": [ - "function greet()\nend" - ] - }, - "void_function_with_parameters": { - "name": "Function that does not return a value and that takes 1 or more defined parameters", - "code": [ - "function addNumbers(a, b)\nend" - ] - }, - "void_function_with_keyword_parameters": { - "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", - "not-implemented": "true" - }, - "void_function_variable_parameters": { - "name": "Function that does not return a value and function that takes an unknown number of parameters", - "code": [ - "function myFunction(...)\nend" - ] - }, - "return_value_function_no_parameters": { - "name": "Function that returns a value and takes no parameters", - "code": [ - "function generateRandomNumber()\nreturn true\nend" - ] - }, - "return_value_function_with_parameters": { - "name": "Function that returns a value and takes 1 or more defined parameters", - "code": [ - "function addNumbers(a, b)\nreturn a,b\nend" - ] - }, - "return_value_function_with_keyword_parameters": { - "name": "Function that returns a value and takes 0 or more defined keyword parameters", - "not-implemented": "true" - }, - "return_value_function_variable_parameters": { - "name": "Function that returns a value and takes an unknown number of parameters", - "code": [ - "function sum(...)\nreturn...\nend" - ] - }, - "anonymous_function_no_parameters": { - "name": "Anonymous function that takes no parameters", - "code": [ - "local myFunction = function()\nend" - ] - }, - "anonymous_function_with_parameters": { - "name": "Anonymous function that takes 1 or more defined parameters", - "code": [ - "local add = function(a, b)\nend" - ] - }, - "anonymous_function_with_keyword_parameters": { - "name": "Anonymous function that takes 0 or more defined keyword parameters", - "not-implemented": "true" - }, - "anonymous_function_variable_parameters": { - "name": "Anonymous function that takes an unknown number of parameters", - "code": [ - "local add = function(...)\nend" - ] - }, - "anonymous_function_no_parameters_with_return": { - "name": "Anonymous function that takes no parameters and returns a value", - "code": [ - "local myFunction = function()\nreturn true\nend" - ] - }, - "anonymous_function_with_parameters_with_return": { - "name": "Anonymous function that takes 1 or more defined parameters and returns a value", - "code": [ - "local add = function(a, b)\nreturn a,b\nend" - ] - }, - "anonymous_function_with_keyword_parameters_with_return": { - "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", - "not-implemented": "true" - }, - "anonymous_function_variable_parameters_with_return": { - "name": "Anonymous function that takes an unknown number of parameters and returns a value", - "code": [ - "local myFunction = function(...)\nreturn...\nend" - ] - }, - "call_subroutine": { - "name": "Call subroutine", - "not-implemented": "true" - }, - "return_from_subroutine": { - "name": "Return from subroutine", - "not-implemented": "true" - } - } -} +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "functions", + "language_version": "5.1" + }, + "concepts": { + "void_function_no_parameters": { + "name": "Function that does not return a value and takes no parameters", + "code": [ + "function greet()\nend" + ] + }, + "void_function_with_parameters": { + "name": "Function that does not return a value and that takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\nend" + ] + }, + "void_function_with_keyword_parameters": { + "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", + "not-implemented": "true" + }, + "void_function_variable_parameters": { + "name": "Function that does not return a value and function that takes an unknown number of parameters", + "code": [ + "function myFunction(...)\nend" + ] + }, + "return_value_function_no_parameters": { + "name": "Function that returns a value and takes no parameters", + "code": [ + "function generateRandomNumber()\nreturn true\nend" + ] + }, + "return_value_function_with_parameters": { + "name": "Function that returns a value and takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\nreturn a,b\nend" + ] + }, + "return_value_function_with_keyword_parameters": { + "name": "Function that returns a value and takes 0 or more defined keyword parameters", + "not-implemented": "true" + }, + "return_value_function_variable_parameters": { + "name": "Function that returns a value and takes an unknown number of parameters", + "code": [ + "function sum(...)\nreturn...\nend" + ] + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": [ + "local myFunction = function()\nend" + ] + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": [ + "local add = function(a, b)\nend" + ] + }, + "anonymous_function_with_keyword_parameters": { + "name": "Anonymous function that takes 0 or more defined keyword parameters", + "not-implemented": "true" + }, + "anonymous_function_variable_parameters": { + "name": "Anonymous function that takes an unknown number of parameters", + "code": [ + "local add = function(...)\nend" + ] + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": [ + "local myFunction = function()\nreturn true\nend" + ] + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": [ + "local add = function(a, b)\nreturn a,b\nend" + ] + }, + "anonymous_function_with_keyword_parameters_with_return": { + "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", + "not-implemented": "true" + }, + "anonymous_function_variable_parameters_with_return": { + "name": "Anonymous function that takes an unknown number of parameters and returns a value", + "code": [ + "local myFunction = function(...)\nreturn...\nend" + ] + }, + "call_subroutine": { + "name": "Call subroutine", + "not-implemented": "true" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "not-implemented": "true" + } + } +} diff --git a/web/thesauruses/lua/5/operators.json b/web/thesauruses/langs/lua/5/operators.json similarity index 95% rename from web/thesauruses/lua/5/operators.json rename to web/thesauruses/langs/lua/5/operators.json index eff61799e..c0347f3cd 100644 --- a/web/thesauruses/lua/5/operators.json +++ b/web/thesauruses/langs/lua/5/operators.json @@ -1,244 +1,244 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "operators", - "language_version": "5.1" - }, - "concepts": { - "addition": { - "name": "Addition operator", - "code": [ - "a + b" - ] - }, - "addition_assignment": { - "name": "Addition and assignment operator", - "not-implemented": true - }, - "subtraction": { - "name": "Subtraction operator", - "code": [ - "a - b" - ] - }, - "subtraction_assignment": { - "name": "Subtraction and assignment operator", - "not-implemented": true - }, - "multiplication": { - "name": "Multiplication operator", - "code": [ - "a * b" - ] - }, - "multiplication_assignment": { - "name": "Multiplication and assignment operator", - "not-implemented": true - }, - "division": { - "name": "Division operator", - "code": [ - "a / b" - ] - }, - "division_assignment": { - "name": "Division and assignment operator", - "not-implemented": true - }, - "integer_division": { - "name": "Integer division operator", - "not-implemented": true - }, - "integer_division_assignment": { - "name": "Integer division and assignment operator", - "not-implemented": true - }, - "modulus": { - "name": "Modulus (remainder) operator", - "code": [ - "a % b" - ] - }, - "modulus_assignment": { - "name": "Modulus and assignment operator", - "not-implemented": true - }, - "unary_plus": { - "name": "Unary plus operator", - "not-implemented": true - }, - "unary_minus": { - "name": "Unary minus operator", - "not-implemented": true - }, - "increment": { - "name": "Increment (add 1) operator", - "not-implemented": true - }, - "decrement": { - "name": "Decrement (subtract 1) operator", - "not-implemented": true - }, - "exponential": { - "name": "Exponential operator", - "code": [ - "a ^ b" - ] - }, - "factorial": { - "name": "Factorial operator", - "not-implemented": true - }, - "absolute_value": { - "name": "Absolute value operator", - "code": [ - "math.abs(a)" - ] - }, - "percentage": { - "name": "Percentage operator", - "not-implemented": true - }, - "equal_to": { - "name": "Equality operator", - "code": [ - "a == b" - ] - }, - "not_equal_to": { - "name": "Not equal to operator", - "code": [ - "a ~= b" - ] - }, - "less_than": { - "name": "Less than operator", - "code": [ - "a < b" - ] - }, - "less_than_or_equal_to": { - "name": "Less than or equal to operator", - "code": [ - "a <= b" - ] - }, - "greater_than": { - "name": "Greater than operator", - "code": [ - "a > b" - ] - }, - "greater_than_or_equal_to": { - "name": "Greater than or equal to operator", - "code": [ - "a >= b" - ] - }, - "null_coalescing": { - "name": "Null coalescing operator", - "not-implemented": true - }, - "is": { - "name": "Is operator", - "not-implemented": true - }, - "is_not": { - "name": "Is not operator", - "not-implemented": true - }, - "logical_and": { - "name": "Logical AND operator", - "code": [ - "a and b" - ] - }, - "logical_or": { - "name": "Logical OR operator", - "code": [ - "a or b" - ] - }, - "logical_not": { - "name": "Logical NOT operator", - "code": [ - "not [condition]" - ] - }, - "bitwise_and": { - "name": "Bitwise AND operator", - "code": [ - "a & b" - ] - }, - "bitwise_and_assignment": { - "name": "Bitwise AND and assignment operator", - "not-implemented": true - }, - "bitwise_or": { - "name": "Bitwise OR operator", - "code": [ - "a | b" - ] - }, - "bitwise_or_assignment": { - "name": "Bitwise OR and assignment operator", - "not-implemented": true - }, - "bitwise_not": { - "name": "Bitwise NOT operator", - "code": [ - "~a" - ] - }, - "not_assignment": { - "name": "Bitwise NOT and assignment operator", - "not-implemented": true - }, - "bitwise_xor": { - "name": "Bitwise XOR operator", - "not-implemented": true - }, - "bitwise_xor_assignment": { - "name": "Bitwise XOR and assignment operator", - "not-implemented": true - }, - "bitwise_xnor": { - "name": "Bitwise XNOR operator", - "not-implemented": true - }, - "bitwise_xnor_assignment": { - "name": "Bitwise XNOR and assignment operator", - "not-implemented": true - }, - "left_shift": { - "name": "Left shift bitwise operator", - "code": [ - "a << b" - ] - }, - "left_shift_assignment": { - "name": "Left shift assignment operator", - "not-implemented": true - }, - "right_shift": { - "name": "Right shift bitwise operator", - "code": [ - "a >> b" - ] - }, - "right_shift_assignment": { - "name": "Right shift assignment operator", - "not-implemented": true - }, - "ternary": { - "name": "Ternary operator", - "not-implemented": true - }, - "null_forgiving": { - "name": "Null forgiving operator", - "not-implemented": true - } - } +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "operators", + "language_version": "5.1" + }, + "concepts": { + "addition": { + "name": "Addition operator", + "code": [ + "a + b" + ] + }, + "addition_assignment": { + "name": "Addition and assignment operator", + "not-implemented": true + }, + "subtraction": { + "name": "Subtraction operator", + "code": [ + "a - b" + ] + }, + "subtraction_assignment": { + "name": "Subtraction and assignment operator", + "not-implemented": true + }, + "multiplication": { + "name": "Multiplication operator", + "code": [ + "a * b" + ] + }, + "multiplication_assignment": { + "name": "Multiplication and assignment operator", + "not-implemented": true + }, + "division": { + "name": "Division operator", + "code": [ + "a / b" + ] + }, + "division_assignment": { + "name": "Division and assignment operator", + "not-implemented": true + }, + "integer_division": { + "name": "Integer division operator", + "not-implemented": true + }, + "integer_division_assignment": { + "name": "Integer division and assignment operator", + "not-implemented": true + }, + "modulus": { + "name": "Modulus (remainder) operator", + "code": [ + "a % b" + ] + }, + "modulus_assignment": { + "name": "Modulus and assignment operator", + "not-implemented": true + }, + "unary_plus": { + "name": "Unary plus operator", + "not-implemented": true + }, + "unary_minus": { + "name": "Unary minus operator", + "not-implemented": true + }, + "increment": { + "name": "Increment (add 1) operator", + "not-implemented": true + }, + "decrement": { + "name": "Decrement (subtract 1) operator", + "not-implemented": true + }, + "exponential": { + "name": "Exponential operator", + "code": [ + "a ^ b" + ] + }, + "factorial": { + "name": "Factorial operator", + "not-implemented": true + }, + "absolute_value": { + "name": "Absolute value operator", + "code": [ + "math.abs(a)" + ] + }, + "percentage": { + "name": "Percentage operator", + "not-implemented": true + }, + "equal_to": { + "name": "Equality operator", + "code": [ + "a == b" + ] + }, + "not_equal_to": { + "name": "Not equal to operator", + "code": [ + "a ~= b" + ] + }, + "less_than": { + "name": "Less than operator", + "code": [ + "a < b" + ] + }, + "less_than_or_equal_to": { + "name": "Less than or equal to operator", + "code": [ + "a <= b" + ] + }, + "greater_than": { + "name": "Greater than operator", + "code": [ + "a > b" + ] + }, + "greater_than_or_equal_to": { + "name": "Greater than or equal to operator", + "code": [ + "a >= b" + ] + }, + "null_coalescing": { + "name": "Null coalescing operator", + "not-implemented": true + }, + "is": { + "name": "Is operator", + "not-implemented": true + }, + "is_not": { + "name": "Is not operator", + "not-implemented": true + }, + "logical_and": { + "name": "Logical AND operator", + "code": [ + "a and b" + ] + }, + "logical_or": { + "name": "Logical OR operator", + "code": [ + "a or b" + ] + }, + "logical_not": { + "name": "Logical NOT operator", + "code": [ + "not [condition]" + ] + }, + "bitwise_and": { + "name": "Bitwise AND operator", + "code": [ + "a & b" + ] + }, + "bitwise_and_assignment": { + "name": "Bitwise AND and assignment operator", + "not-implemented": true + }, + "bitwise_or": { + "name": "Bitwise OR operator", + "code": [ + "a | b" + ] + }, + "bitwise_or_assignment": { + "name": "Bitwise OR and assignment operator", + "not-implemented": true + }, + "bitwise_not": { + "name": "Bitwise NOT operator", + "code": [ + "~a" + ] + }, + "not_assignment": { + "name": "Bitwise NOT and assignment operator", + "not-implemented": true + }, + "bitwise_xor": { + "name": "Bitwise XOR operator", + "not-implemented": true + }, + "bitwise_xor_assignment": { + "name": "Bitwise XOR and assignment operator", + "not-implemented": true + }, + "bitwise_xnor": { + "name": "Bitwise XNOR operator", + "not-implemented": true + }, + "bitwise_xnor_assignment": { + "name": "Bitwise XNOR and assignment operator", + "not-implemented": true + }, + "left_shift": { + "name": "Left shift bitwise operator", + "code": [ + "a << b" + ] + }, + "left_shift_assignment": { + "name": "Left shift assignment operator", + "not-implemented": true + }, + "right_shift": { + "name": "Right shift bitwise operator", + "code": [ + "a >> b" + ] + }, + "right_shift_assignment": { + "name": "Right shift assignment operator", + "not-implemented": true + }, + "ternary": { + "name": "Ternary operator", + "not-implemented": true + }, + "null_forgiving": { + "name": "Null forgiving operator", + "not-implemented": true + } + } } \ No newline at end of file diff --git a/web/thesauruses/lua/5/queues_stacks.json b/web/thesauruses/langs/lua/5/queues_stacks.json similarity index 96% rename from web/thesauruses/lua/5/queues_stacks.json rename to web/thesauruses/langs/lua/5/queues_stacks.json index 81676de46..3d2167bd6 100644 --- a/web/thesauruses/lua/5/queues_stacks.json +++ b/web/thesauruses/langs/lua/5/queues_stacks.json @@ -1,311 +1,311 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "queues_stacks", - "language_version": "5.1" - }, - "concepts": { - "simple_queue_import_statement": { - "name": "Import statement to add simple queue", - "not-implemented": "true" - }, - "simple_queue_data_type": { - "name": "Queue data type name", - "not-implemented": "true", - "comment":"Table can be used to implement a queue. " - }, - "simple_queue_create_statement": { - "name": "Create a queue", - "code": [ - "local queue = {}" - ] - }, - "simple_queue_create_copy_statement": { - "name": "Create a queue from existing queue", - "not-implemented": "true" - }, - "simple_queue_create_copy_from_list_statement": { - "name": "Create a queue from a list of items", - "not-implemented": "true" - }, - "simple_queue_destroy_statement": { - "name": "Destroy/delete a queue", - "code": [ - "queue = nil" - ] - }, - "simple_queue_data_structure": { - "name": "Data structure that backs the simple queue", - "not-implemented": "true" - }, - "circular_queue_import_statement": { - "name": "Import statement to add circular queue", - "not-implemented": "true" - }, - "circular_queue_data_type": { - "name": "Queue data type name", - "not-implemented": "true" - }, - "circular_queue_create_statement": { - "name": "Create a queue", - "not-implemented": "true" - }, - "circular_queue_create_copy_statement": { - "name": "Create a queue from existing queue", - "not-implemented": "true" - }, - "circular_queue_create_copy_from_list_statement": { - "name": "Create a queue from a list of items", - "not-implemented": "true" - }, - "circular_queue_destroy_statement": { - "name": "Destroy/delete a queue", - "not-implemented": "true" - }, - "circular_queue_data_structure": { - "name": "Data structure that backs the simple queue", - "not-implemented": "true" - }, - "priority_queue_import_statement": { - "name": "Import statement to add priority queue", - "not-implemented": "true" - }, - "priority_queue_data_type": { - "name": "Queue data type name", - "not-implemented": "true" - }, - "priority_queue_create_statement": { - "name": "Create a queue", - "not-implemented": "true" - }, - "priority_queue_create_copy_statement": { - "name": "Create a queue from existing queue", - "not-implemented": "true" - }, - "priority_queue_create_copy_from_list_statement": { - "name": "Create a queue from a list of items", - "not-implemented": "true" - }, - "priority_queue_destroy_statement": { - "name": "Destroy/delete a queue", - "not-implemented": "true" - }, - "priority_queue_data_structure": { - "name": "Data structure that backs the simple queue", - "not-implemented": "true" - }, - "double_ended_queue_import_statement": { - "name": "Import statement to add double-ended queue", - "not-implemented": "true" - }, - "double_ended_queue_data_type": { - "name": "Queue data type name", - "not-implemented": "true" - }, - "double_ended_queue_create_statement": { - "name": "Create a queue", - "not-implemented": "true" - }, - "double_ended_queue_create_copy_statement": { - "name": "Create a queue from existing queue", - "not-implemented": "true" - }, - "double_ended_queue_create_copy_from_list_statement": { - "name": "Create a queue from a list", - "not-implemented": "true" - }, - "double_ended_queue_destroy_statement": { - "name": "Destroy/delete a queue", - "not-implemented": "true" - }, - "double_ended_queue_data_structure": { - "name": "Data structure that backs the simple queue", - "not-implemented": "true" - }, - "stack_import_statement": { - "name": "Import statement to add stacks", - "not-implemented": "true" - }, - "stack_data_type": { - "name": "Stack data type name", - "not-implemented": "true", - "comment":"Table can be used to implement a stack." - }, - "stack_create_statement": { - "name": "Create a stack", - "code": [ - "local stack = {}" - ] - }, - "stack_create_copy_statement": { - "name": "Create a stack from existing stack", - "not-implemented": "true" - }, - "stack_create_copy_from_list_statement": { - "name": "Create a stack from a list", - "not-implemented": "true" - }, - "stack_destroy_statement": { - "name": "Destroy/delete a stack", - "code": [ - "stack = nil" - ] - }, - "stack_data_structure": { - "name": "Data structure that backs the simple queue", - "not-implemented": "true" - }, - "queue_enqueue_an_item": { - "name": "Enqueue an item (add to end)", - "code": [ - "table.insert(queue,item_to_add)" - ] - }, - "queue_enqueue_priority_item": { - "name": "Enqueue a high priority item (add to end of priority queue)", - "not-implemented": "true" - }, - "queue_enqueue_from_list": { - "name": "Enqueue items from a list into queue (add list to end)", - "not-implemented": "true" - }, - "queue_enqueue_priority_from_list": { - "name": "Enqueue priority items from a list (add list to end of priority queue)", - "not-implemented": "true" - }, - "queue_dequeue_return_an_item": { - "name": "Dequeue an item (remove from front, return item)", - "code": [ - "table.remove(queue,item_to_remove)" - ] - }, - "queue_dequeue_delete_an_item": { - "name": "Dequeue an item (remove from front, don't return)", - "not-implemented": "true" - }, - "queue_peek_at_next_item": { - "name": "Look/peek at next available element (from front)", - "code": [ - "queue[1]" - ], - "comment":" Lua uses 1-based indexing, which is different from some other programming languages like C, C++, and Java" - }, - "queue_peek_at_last_item": { - "name": "Look/peek at last element (from back)", - "code": [ - "queue[#queue]" - ] - }, - "queue_duplicate_next_item": { - "name": "Duplicate next item", - "not-implemented": "true" - }, - "queue_swap_two_items": { - "name": "Swap two items", - "not-implemented": "true" - }, - "queue_get_size": { - "name": "Get size (number of items) in the queue", - "code": [ - "#queue" - ] - }, - "queue_get_capacity": { - "name": "Check capacity of queue", - "code": [ - "#queue" - ] - }, - "queue_export_to_list": { - "name": "Export a list of all queue items", - "not-implemented": "true" - }, - "queue_clear_all": { - "name": "Clear out all queue items", - "code": [ - "queue = nil" - ] - }, - "stack_push_item": { - "name": "Push an item (add to top)", - "code": [ - "table.insert(stack,item_to_add)" - ] - }, - "stack_pop_return_item": { - "name": "Pop an item (remove from top, return item)", - "code": [ - "table.remove(stack,item_to_remove)" - ] - }, - "stack_pop_delete_item": { - "name": "Pop an item (remove from top, don't return)", - "not-implemented": "true" - }, - "stack_peek_at_next_item": { - "name": "Look/peek at next element (from top)", - "not-implemented": "true" - }, - "stack_peek_at_last_item": { - "name": "Look/peek at last element (from bottom)", - "code": [ - "stack[#stack]" - ] - }, - "stack_duplicate_next_item": { - "name": "Duplicate top item", - "not-implemented": "true" - }, - "stack_swap_two_items": { - "name": "Swap two items", - "not-implemented": "true" - }, - "stack_get_size": { - "name": "Get size (number of items) on the stack", - "code": [ - "#stack" - ] - }, - "stack_get_capacity": { - "name": "Check capacity of stack", - "code": [ - "#stack" - ] - }, - "stack_export_to_list": { - "name": "Export a list of all stack items", - "not-implemented": "true" - }, - "stack_clear_all": { - "name": "Clear all stack items", - "code": [ - "stack = nil" - ] - }, - "iterate_pointer_data_type": { - "name": "Data type of a iterator pointer", - "not-implemented": "true" - }, - "iterate_create_pointer": { - "name": "Create iterator", - "not-implemented": "true" - }, - "iterate_move_to_next_item": { - "name": "Move pointer to next item", - "not-implemented": "true" - }, - "iterate_move_to_previous_item": { - "name": "Move pointer to previous item", - "not-implemented": "true" - }, - "iterate_move_to_beginning": { - "name": "Move pointer to beginning of queue/stack", - "not-implemented": "true" - }, - "iterate_move_to_end": { - "name": "Move pointer to end of queue/stack", - "not-implemented": "true" - } - } -} +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "queues_stacks", + "language_version": "5.1" + }, + "concepts": { + "simple_queue_import_statement": { + "name": "Import statement to add simple queue", + "not-implemented": "true" + }, + "simple_queue_data_type": { + "name": "Queue data type name", + "not-implemented": "true", + "comment":"Table can be used to implement a queue. " + }, + "simple_queue_create_statement": { + "name": "Create a queue", + "code": [ + "local queue = {}" + ] + }, + "simple_queue_create_copy_statement": { + "name": "Create a queue from existing queue", + "not-implemented": "true" + }, + "simple_queue_create_copy_from_list_statement": { + "name": "Create a queue from a list of items", + "not-implemented": "true" + }, + "simple_queue_destroy_statement": { + "name": "Destroy/delete a queue", + "code": [ + "queue = nil" + ] + }, + "simple_queue_data_structure": { + "name": "Data structure that backs the simple queue", + "not-implemented": "true" + }, + "circular_queue_import_statement": { + "name": "Import statement to add circular queue", + "not-implemented": "true" + }, + "circular_queue_data_type": { + "name": "Queue data type name", + "not-implemented": "true" + }, + "circular_queue_create_statement": { + "name": "Create a queue", + "not-implemented": "true" + }, + "circular_queue_create_copy_statement": { + "name": "Create a queue from existing queue", + "not-implemented": "true" + }, + "circular_queue_create_copy_from_list_statement": { + "name": "Create a queue from a list of items", + "not-implemented": "true" + }, + "circular_queue_destroy_statement": { + "name": "Destroy/delete a queue", + "not-implemented": "true" + }, + "circular_queue_data_structure": { + "name": "Data structure that backs the simple queue", + "not-implemented": "true" + }, + "priority_queue_import_statement": { + "name": "Import statement to add priority queue", + "not-implemented": "true" + }, + "priority_queue_data_type": { + "name": "Queue data type name", + "not-implemented": "true" + }, + "priority_queue_create_statement": { + "name": "Create a queue", + "not-implemented": "true" + }, + "priority_queue_create_copy_statement": { + "name": "Create a queue from existing queue", + "not-implemented": "true" + }, + "priority_queue_create_copy_from_list_statement": { + "name": "Create a queue from a list of items", + "not-implemented": "true" + }, + "priority_queue_destroy_statement": { + "name": "Destroy/delete a queue", + "not-implemented": "true" + }, + "priority_queue_data_structure": { + "name": "Data structure that backs the simple queue", + "not-implemented": "true" + }, + "double_ended_queue_import_statement": { + "name": "Import statement to add double-ended queue", + "not-implemented": "true" + }, + "double_ended_queue_data_type": { + "name": "Queue data type name", + "not-implemented": "true" + }, + "double_ended_queue_create_statement": { + "name": "Create a queue", + "not-implemented": "true" + }, + "double_ended_queue_create_copy_statement": { + "name": "Create a queue from existing queue", + "not-implemented": "true" + }, + "double_ended_queue_create_copy_from_list_statement": { + "name": "Create a queue from a list", + "not-implemented": "true" + }, + "double_ended_queue_destroy_statement": { + "name": "Destroy/delete a queue", + "not-implemented": "true" + }, + "double_ended_queue_data_structure": { + "name": "Data structure that backs the simple queue", + "not-implemented": "true" + }, + "stack_import_statement": { + "name": "Import statement to add stacks", + "not-implemented": "true" + }, + "stack_data_type": { + "name": "Stack data type name", + "not-implemented": "true", + "comment":"Table can be used to implement a stack." + }, + "stack_create_statement": { + "name": "Create a stack", + "code": [ + "local stack = {}" + ] + }, + "stack_create_copy_statement": { + "name": "Create a stack from existing stack", + "not-implemented": "true" + }, + "stack_create_copy_from_list_statement": { + "name": "Create a stack from a list", + "not-implemented": "true" + }, + "stack_destroy_statement": { + "name": "Destroy/delete a stack", + "code": [ + "stack = nil" + ] + }, + "stack_data_structure": { + "name": "Data structure that backs the simple queue", + "not-implemented": "true" + }, + "queue_enqueue_an_item": { + "name": "Enqueue an item (add to end)", + "code": [ + "table.insert(queue,item_to_add)" + ] + }, + "queue_enqueue_priority_item": { + "name": "Enqueue a high priority item (add to end of priority queue)", + "not-implemented": "true" + }, + "queue_enqueue_from_list": { + "name": "Enqueue items from a list into queue (add list to end)", + "not-implemented": "true" + }, + "queue_enqueue_priority_from_list": { + "name": "Enqueue priority items from a list (add list to end of priority queue)", + "not-implemented": "true" + }, + "queue_dequeue_return_an_item": { + "name": "Dequeue an item (remove from front, return item)", + "code": [ + "table.remove(queue,item_to_remove)" + ] + }, + "queue_dequeue_delete_an_item": { + "name": "Dequeue an item (remove from front, don't return)", + "not-implemented": "true" + }, + "queue_peek_at_next_item": { + "name": "Look/peek at next available element (from front)", + "code": [ + "queue[1]" + ], + "comment":" Lua uses 1-based indexing, which is different from some other programming languages like C, C++, and Java" + }, + "queue_peek_at_last_item": { + "name": "Look/peek at last element (from back)", + "code": [ + "queue[#queue]" + ] + }, + "queue_duplicate_next_item": { + "name": "Duplicate next item", + "not-implemented": "true" + }, + "queue_swap_two_items": { + "name": "Swap two items", + "not-implemented": "true" + }, + "queue_get_size": { + "name": "Get size (number of items) in the queue", + "code": [ + "#queue" + ] + }, + "queue_get_capacity": { + "name": "Check capacity of queue", + "code": [ + "#queue" + ] + }, + "queue_export_to_list": { + "name": "Export a list of all queue items", + "not-implemented": "true" + }, + "queue_clear_all": { + "name": "Clear out all queue items", + "code": [ + "queue = nil" + ] + }, + "stack_push_item": { + "name": "Push an item (add to top)", + "code": [ + "table.insert(stack,item_to_add)" + ] + }, + "stack_pop_return_item": { + "name": "Pop an item (remove from top, return item)", + "code": [ + "table.remove(stack,item_to_remove)" + ] + }, + "stack_pop_delete_item": { + "name": "Pop an item (remove from top, don't return)", + "not-implemented": "true" + }, + "stack_peek_at_next_item": { + "name": "Look/peek at next element (from top)", + "not-implemented": "true" + }, + "stack_peek_at_last_item": { + "name": "Look/peek at last element (from bottom)", + "code": [ + "stack[#stack]" + ] + }, + "stack_duplicate_next_item": { + "name": "Duplicate top item", + "not-implemented": "true" + }, + "stack_swap_two_items": { + "name": "Swap two items", + "not-implemented": "true" + }, + "stack_get_size": { + "name": "Get size (number of items) on the stack", + "code": [ + "#stack" + ] + }, + "stack_get_capacity": { + "name": "Check capacity of stack", + "code": [ + "#stack" + ] + }, + "stack_export_to_list": { + "name": "Export a list of all stack items", + "not-implemented": "true" + }, + "stack_clear_all": { + "name": "Clear all stack items", + "code": [ + "stack = nil" + ] + }, + "iterate_pointer_data_type": { + "name": "Data type of a iterator pointer", + "not-implemented": "true" + }, + "iterate_create_pointer": { + "name": "Create iterator", + "not-implemented": "true" + }, + "iterate_move_to_next_item": { + "name": "Move pointer to next item", + "not-implemented": "true" + }, + "iterate_move_to_previous_item": { + "name": "Move pointer to previous item", + "not-implemented": "true" + }, + "iterate_move_to_beginning": { + "name": "Move pointer to beginning of queue/stack", + "not-implemented": "true" + }, + "iterate_move_to_end": { + "name": "Move pointer to end of queue/stack", + "not-implemented": "true" + } + } +} diff --git a/web/thesauruses/lua/5/strings.json b/web/thesauruses/langs/lua/5/strings.json similarity index 97% rename from web/thesauruses/lua/5/strings.json rename to web/thesauruses/langs/lua/5/strings.json index dff07d1e1..aa04e8191 100644 --- a/web/thesauruses/lua/5/strings.json +++ b/web/thesauruses/langs/lua/5/strings.json @@ -1,286 +1,286 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "strings", - "language_version": "5.3.6" - }, - "concepts": { - "is_primitive_or_not": { - "name": "Is this a built-in type in this language?", - "code": "Yes" - }, - "import": { - "name": "Import the string class", - "not-implemented": true, - "comment": "Does not require to import as it is in builtins" - }, - "default_string_byte_encoding": { - "name": "Default byte encoding (ex: ASCII UTF-8, UTF-16, etc.)", - "not-implemented": true - }, - "create_new_string": { - "name": "Create new string", - "code": "str1 = 'New string Example1' \nstr2 = \"New string Example2\"" - }, - - "create_multiline_string": { - "name": "Create new multi-line string", - "code": "[['Multiline string']]" - }, - "assign_new_string": { - "name": "Assign string from another string", - "code": "a = 'a'\nb = a" - }, - "destroy_string": { - "name": "Destroy string", - "not-implemented": "true" - }, - "length_of_string": { - "name": "Length of string", - "code": [ - "str = 'codethesaur.us'", - "str:len()", - "string.len(str)" - ] - - }, - "max_length_of_string": { - "name": "Maximum length of string", - "not-implemented": true - }, - "clear_string": { - "name": "Clear/empty string", - "code": "a = 'a'\na=''" - }, - "is_empty": { - "name": "Is string empty?", - "code": [ - "str = ''", - "if (str == nil or str == '') then", - " print('str is empty')", - "end" - ] - }, - - "concatenate_two_strings": { - "name": "Concatenate/join two strings", - "code":"str1 = 'Hello'\nstr2 = ' World'\nprint(str1..str2)" - }, - "concatenate_many_strings": { - "name": "Concatenate/join many strings", - "code": [ - "str = 'Hello'\nvar2 = ' World '\nvar3 = str..var2\nprint(str..var2..var3)", - "\ntab = {'codethesaur.us',' is',' great',' learning tool!'}\nprint(table.concat(tab))" - ], - "comment":"We can concat many number of string using '..' oprator" - }, - "is_all_alphabetical": { - "name": "Is string all alphabetical characters?", - "not-implemented": "true" - }, - "is_all_numerical": { - "name": "Is string all numerical characters?", - "not-implemented": "true" - }, - "is_all_alphanumeric": { - "name": "Is string all alphanumeric characters?", - "not-implemented": "true" - }, - "is_decimal": { - "name": "Is string a decimal number?", - "not-implemented": "true" - }, - "is_all_whitespaces": { - "name": "Is string all whitespace characters?", - "not-implemented": "true" - }, - "is_all_uppercase": { - "name": "Is string all uppercase characters?", - "not-implemented": "true" - }, - "is_all_lowercase": { - "name": "Is string all lowercase characters?", - "not-implemented": "true" - }, - "is_in_titlecase": { - "name": "Is string formatted in title case?", - "not-implemented": "true" - }, - "does_substring_exist": { - "name": "Does a substring exist in a string?", - "code":"str = 'Hello'\ni,i2 = string.find(str,'lo')\nprint(i,i2)", - "comment":"first variable stores index+1 of first string character and second variable stores index of last character If sub-string or occurrence is not found then it returns 'nill'" - }, - "find_start_index_of_substring": { - "name": "Find index of where a substring starts", - "code": "str = 'Hello'\nstart,_ = string.find(str,'lo')\nprint(start)", - "comment":"If we do not need of index of end character of sub-string then we can use '_'(underscore) instead assigning to a variable" - }, - "find_start_index_of_additional_substring": { - "name": "Find index of an additional substring (or starting at another index)", - "code": "str = 'Hello Hello'\ni = string.find(str,'ello')\ni2 = string.find(str,'ello',i+1)\nprint(i,i2)" - }, - "find_start_index_of_substring_from_end": { - "name": "Find substring index starting at end", - "not-implemented": true - }, - "count_occurrences_of_substring": { - "name": "Find number of occurences of a substring", - "not-implemented": true - }, - "get_leftmost_characters": { - "name": "Get a specified number of characters from the left", - "code": "str = 'Hello'\nlen = string.len(str)\ni = string.sub(str,len,len)\nprint(i)" - }, - "get_rightmost_characters": { - "name": "Get a specified number of characters from the right", - "code": "str = 'Hello'\ni = string.sub(str,1,1)\nprint(i)" - }, - "get_substring_from_start_and_end_index": { - "name": "Return a substring from a string based on starting and ending indices", - "not-implemented": true - }, - "get_substring_from_start_index_and_length": { - "name": "Return a substring from a string based on starting index and size of substring", - "code": "str = 'Hello'\nlen = string.len(str)\ni = string.sub(str,1,len)\nprint(i)" - }, - "convert_to_uppercase": { - "name": "Convert string to all uppercase", - "code": "str = 'Hello'\nVAR = string.upper(str)\nprint(str)", - "comment":"'string.upper' function does not convert to uppercase in original string rather than it return a new uppercased string which we have to store in variable" - }, - "convert_to_lowercase": { - "name": "Convert string to all lowercase", - "code": "str = 'Hello'\nVAR = string.lower(str)\nprint(str)", - "comment":"'string.lower' function does not convert to lowercase in original string rather than it return a new lowercased string which we have to store in variable" - }, - "convert_to_title_case": { - "name": "Convert string to title case", - "not-implemented": true - }, - "capitalize_string": { - "name": "Capitalize first letter of a string", - "not-implemented": true - }, - "remove_whitespace": { - "name": "Remove all whitespaces from string", - "not-implemented": true - }, - "replace_substring": { - "name": "Replace a substring with another string", - "code": "str = 'Welcome to lua'\nvar = string.gsub(str,'lua','codethesaurus')\nprint(str)" - }, - "replace_all_substring": { - "name": "Replace all substring matches with another string", - "code": "str = 'Welcome to lua,lua is great.'\nvar = string.gsub(str,'lua','codethesaurus')\nprint(str)" - }, - "split_at_index": { - "name": "Split string into a list of strings at a given index", - "not-implemented": true - }, - "split_at_newlines": { - "name": "Split string into a list of strings at every new line character", - "not-implemented": true - }, - "split_at_substring": { - "name": "Split string by locating all substrings", - "not-implemented": true - }, - "merge_lists_into_string": { - "name": "Merge a list of strings into one string", - "code": "list = {'codethesaur ','is ','great learning ','tool'}\nstr = table.concat(list)\nprint(str)" - }, - "encode_html_entities": { - "name": "Encode HTML entities in a string (ex: \u2122 to ™)", - "not-implemented": true - }, - "decode_html_entities": { - "name": "Decode HTML entitles into characters", - "not-implemented": true - }, - "encode_url_percent": { - "name": "Encode URL percent encoding into string (ex: ' ' to %20)", - "not-implemented": true - }, - "decode_url_percent": { - "name": "Decode URL percent encoding", - "not-implemented": true - }, - "encode_to_base64": { - "name": "Encode string into Base64 format", - "not-implemented": true - }, - "decode_from_base64": { - "name": "Decode string from Base64 format", - "not-implemented": true - }, - "format_string_function": { - "name": "Function to format a string", - "code": "tool = 'codethesaurus'\nformated = string.format('The great learning tool %s',tool)\nprint(formated)" - }, - "parameter_format_in_order": { - "name": "Parameter used in format function if they're used in order", - "code": "string.format(formatstring, ...)" - }, - "parameter_format_numerical": { - "name": "Parameter used in format function if they're numerically numbered", - "not-implemented": true - }, - "parameter_format_by_name": { - "name": "Paramater used in format function if they're named variables", - "not-implemented": true - }, - "format_as_integer": { - "name": "Format parameter as an integer", - "code": "int = 12\nprint(string.format('This is integer: %d',int))", - "comment":"If we take value of variable as string(EX: int = '12') instead integer/number, It will work too!" - }, - "format_as_decimal": { - "name": "Format parameter as a decimal number", - "not-implemented": true - }, - "format_as_fixed_decimal": { - "name": "Format parameter as a fixed-point decimal number", - "code": "num = 12.53232\nprint(string.format('%0.2f',num))", - "comment":"Output: 12.53\n%0.[N]f [where N is how many decimal you want after (.)point]" - }, - "format_as_currency": { - "name": "Format parameter as a currency number", - "not-implemented": true - }, - "format_as_percentage": { - "name": "Format parameter as a percentage number", - "not-implemented": true - }, - "format_number_with_separators": { - "name": "Format number with thousand separators", - "not-implemented": true - }, - "format_number_with_positive_negative_sign": { - "name": "Format number with positive/negative signs", - "code": "num = 12\nprint(string.format('%+d',num))" - }, - "format_number_in_scientific_notation_little_e": { - "name": "Format number with scientific notation with 'e'", - "code": "num = 12645893253232\nprint(string.format('%e',num))" - }, - "format_number_in_scientific_notation_big_e": { - "name": "Format number with scientific notation with 'E'", - "code": "num = 12645893253232\nprint(string.format('%E',num))" - }, - "format_number_in_binary": { - "name": "Format number into binary", - "not-implemented": true - }, - "format_number_in_octal": { - "name": "Format number into octal", - "code": "num = 8\nprint(string.format('%o',num))" - }, - "format_number_in_hexadecimal": { - "name": "Format number into hexadecimal", - "code": "num = 10\nprint(string.format('%x',num))", - "comment":"%x for lowercase letters.\n%X upper letters." - } - } - } +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "strings", + "language_version": "5.3.6" + }, + "concepts": { + "is_primitive_or_not": { + "name": "Is this a built-in type in this language?", + "code": "Yes" + }, + "import": { + "name": "Import the string class", + "not-implemented": true, + "comment": "Does not require to import as it is in builtins" + }, + "default_string_byte_encoding": { + "name": "Default byte encoding (ex: ASCII UTF-8, UTF-16, etc.)", + "not-implemented": true + }, + "create_new_string": { + "name": "Create new string", + "code": "str1 = 'New string Example1' \nstr2 = \"New string Example2\"" + }, + + "create_multiline_string": { + "name": "Create new multi-line string", + "code": "[['Multiline string']]" + }, + "assign_new_string": { + "name": "Assign string from another string", + "code": "a = 'a'\nb = a" + }, + "destroy_string": { + "name": "Destroy string", + "not-implemented": "true" + }, + "length_of_string": { + "name": "Length of string", + "code": [ + "str = 'codethesaur.us'", + "str:len()", + "string.len(str)" + ] + + }, + "max_length_of_string": { + "name": "Maximum length of string", + "not-implemented": true + }, + "clear_string": { + "name": "Clear/empty string", + "code": "a = 'a'\na=''" + }, + "is_empty": { + "name": "Is string empty?", + "code": [ + "str = ''", + "if (str == nil or str == '') then", + " print('str is empty')", + "end" + ] + }, + + "concatenate_two_strings": { + "name": "Concatenate/join two strings", + "code":"str1 = 'Hello'\nstr2 = ' World'\nprint(str1..str2)" + }, + "concatenate_many_strings": { + "name": "Concatenate/join many strings", + "code": [ + "str = 'Hello'\nvar2 = ' World '\nvar3 = str..var2\nprint(str..var2..var3)", + "\ntab = {'codethesaur.us',' is',' great',' learning tool!'}\nprint(table.concat(tab))" + ], + "comment":"We can concat many number of string using '..' oprator" + }, + "is_all_alphabetical": { + "name": "Is string all alphabetical characters?", + "not-implemented": "true" + }, + "is_all_numerical": { + "name": "Is string all numerical characters?", + "not-implemented": "true" + }, + "is_all_alphanumeric": { + "name": "Is string all alphanumeric characters?", + "not-implemented": "true" + }, + "is_decimal": { + "name": "Is string a decimal number?", + "not-implemented": "true" + }, + "is_all_whitespaces": { + "name": "Is string all whitespace characters?", + "not-implemented": "true" + }, + "is_all_uppercase": { + "name": "Is string all uppercase characters?", + "not-implemented": "true" + }, + "is_all_lowercase": { + "name": "Is string all lowercase characters?", + "not-implemented": "true" + }, + "is_in_titlecase": { + "name": "Is string formatted in title case?", + "not-implemented": "true" + }, + "does_substring_exist": { + "name": "Does a substring exist in a string?", + "code":"str = 'Hello'\ni,i2 = string.find(str,'lo')\nprint(i,i2)", + "comment":"first variable stores index+1 of first string character and second variable stores index of last character If sub-string or occurrence is not found then it returns 'nill'" + }, + "find_start_index_of_substring": { + "name": "Find index of where a substring starts", + "code": "str = 'Hello'\nstart,_ = string.find(str,'lo')\nprint(start)", + "comment":"If we do not need of index of end character of sub-string then we can use '_'(underscore) instead assigning to a variable" + }, + "find_start_index_of_additional_substring": { + "name": "Find index of an additional substring (or starting at another index)", + "code": "str = 'Hello Hello'\ni = string.find(str,'ello')\ni2 = string.find(str,'ello',i+1)\nprint(i,i2)" + }, + "find_start_index_of_substring_from_end": { + "name": "Find substring index starting at end", + "not-implemented": true + }, + "count_occurrences_of_substring": { + "name": "Find number of occurences of a substring", + "not-implemented": true + }, + "get_leftmost_characters": { + "name": "Get a specified number of characters from the left", + "code": "str = 'Hello'\nlen = string.len(str)\ni = string.sub(str,len,len)\nprint(i)" + }, + "get_rightmost_characters": { + "name": "Get a specified number of characters from the right", + "code": "str = 'Hello'\ni = string.sub(str,1,1)\nprint(i)" + }, + "get_substring_from_start_and_end_index": { + "name": "Return a substring from a string based on starting and ending indices", + "not-implemented": true + }, + "get_substring_from_start_index_and_length": { + "name": "Return a substring from a string based on starting index and size of substring", + "code": "str = 'Hello'\nlen = string.len(str)\ni = string.sub(str,1,len)\nprint(i)" + }, + "convert_to_uppercase": { + "name": "Convert string to all uppercase", + "code": "str = 'Hello'\nVAR = string.upper(str)\nprint(str)", + "comment":"'string.upper' function does not convert to uppercase in original string rather than it return a new uppercased string which we have to store in variable" + }, + "convert_to_lowercase": { + "name": "Convert string to all lowercase", + "code": "str = 'Hello'\nVAR = string.lower(str)\nprint(str)", + "comment":"'string.lower' function does not convert to lowercase in original string rather than it return a new lowercased string which we have to store in variable" + }, + "convert_to_title_case": { + "name": "Convert string to title case", + "not-implemented": true + }, + "capitalize_string": { + "name": "Capitalize first letter of a string", + "not-implemented": true + }, + "remove_whitespace": { + "name": "Remove all whitespaces from string", + "not-implemented": true + }, + "replace_substring": { + "name": "Replace a substring with another string", + "code": "str = 'Welcome to lua'\nvar = string.gsub(str,'lua','codethesaurus')\nprint(str)" + }, + "replace_all_substring": { + "name": "Replace all substring matches with another string", + "code": "str = 'Welcome to lua,lua is great.'\nvar = string.gsub(str,'lua','codethesaurus')\nprint(str)" + }, + "split_at_index": { + "name": "Split string into a list of strings at a given index", + "not-implemented": true + }, + "split_at_newlines": { + "name": "Split string into a list of strings at every new line character", + "not-implemented": true + }, + "split_at_substring": { + "name": "Split string by locating all substrings", + "not-implemented": true + }, + "merge_lists_into_string": { + "name": "Merge a list of strings into one string", + "code": "list = {'codethesaur ','is ','great learning ','tool'}\nstr = table.concat(list)\nprint(str)" + }, + "encode_html_entities": { + "name": "Encode HTML entities in a string (ex: \u2122 to ™)", + "not-implemented": true + }, + "decode_html_entities": { + "name": "Decode HTML entitles into characters", + "not-implemented": true + }, + "encode_url_percent": { + "name": "Encode URL percent encoding into string (ex: ' ' to %20)", + "not-implemented": true + }, + "decode_url_percent": { + "name": "Decode URL percent encoding", + "not-implemented": true + }, + "encode_to_base64": { + "name": "Encode string into Base64 format", + "not-implemented": true + }, + "decode_from_base64": { + "name": "Decode string from Base64 format", + "not-implemented": true + }, + "format_string_function": { + "name": "Function to format a string", + "code": "tool = 'codethesaurus'\nformated = string.format('The great learning tool %s',tool)\nprint(formated)" + }, + "parameter_format_in_order": { + "name": "Parameter used in format function if they're used in order", + "code": "string.format(formatstring, ...)" + }, + "parameter_format_numerical": { + "name": "Parameter used in format function if they're numerically numbered", + "not-implemented": true + }, + "parameter_format_by_name": { + "name": "Paramater used in format function if they're named variables", + "not-implemented": true + }, + "format_as_integer": { + "name": "Format parameter as an integer", + "code": "int = 12\nprint(string.format('This is integer: %d',int))", + "comment":"If we take value of variable as string(EX: int = '12') instead integer/number, It will work too!" + }, + "format_as_decimal": { + "name": "Format parameter as a decimal number", + "not-implemented": true + }, + "format_as_fixed_decimal": { + "name": "Format parameter as a fixed-point decimal number", + "code": "num = 12.53232\nprint(string.format('%0.2f',num))", + "comment":"Output: 12.53\n%0.[N]f [where N is how many decimal you want after (.)point]" + }, + "format_as_currency": { + "name": "Format parameter as a currency number", + "not-implemented": true + }, + "format_as_percentage": { + "name": "Format parameter as a percentage number", + "not-implemented": true + }, + "format_number_with_separators": { + "name": "Format number with thousand separators", + "not-implemented": true + }, + "format_number_with_positive_negative_sign": { + "name": "Format number with positive/negative signs", + "code": "num = 12\nprint(string.format('%+d',num))" + }, + "format_number_in_scientific_notation_little_e": { + "name": "Format number with scientific notation with 'e'", + "code": "num = 12645893253232\nprint(string.format('%e',num))" + }, + "format_number_in_scientific_notation_big_e": { + "name": "Format number with scientific notation with 'E'", + "code": "num = 12645893253232\nprint(string.format('%E',num))" + }, + "format_number_in_binary": { + "name": "Format number into binary", + "not-implemented": true + }, + "format_number_in_octal": { + "name": "Format number into octal", + "code": "num = 8\nprint(string.format('%o',num))" + }, + "format_number_in_hexadecimal": { + "name": "Format number into hexadecimal", + "code": "num = 10\nprint(string.format('%x',num))", + "comment":"%x for lowercase letters.\n%X upper letters." + } + } + } diff --git a/web/thesauruses/nim/1/classes.json b/web/thesauruses/langs/nim/1/classes.json similarity index 100% rename from web/thesauruses/nim/1/classes.json rename to web/thesauruses/langs/nim/1/classes.json diff --git a/web/thesauruses/nim/1/control_structures.json b/web/thesauruses/langs/nim/1/control_structures.json similarity index 100% rename from web/thesauruses/nim/1/control_structures.json rename to web/thesauruses/langs/nim/1/control_structures.json diff --git a/web/thesauruses/nim/1/data_types.json b/web/thesauruses/langs/nim/1/data_types.json similarity index 100% rename from web/thesauruses/nim/1/data_types.json rename to web/thesauruses/langs/nim/1/data_types.json diff --git a/web/thesauruses/nim/1/exception_handling.json b/web/thesauruses/langs/nim/1/exception_handling.json similarity index 100% rename from web/thesauruses/nim/1/exception_handling.json rename to web/thesauruses/langs/nim/1/exception_handling.json diff --git a/web/thesauruses/nim/1/functions.json b/web/thesauruses/langs/nim/1/functions.json similarity index 100% rename from web/thesauruses/nim/1/functions.json rename to web/thesauruses/langs/nim/1/functions.json diff --git a/web/thesauruses/nim/1/lists.json b/web/thesauruses/langs/nim/1/lists.json similarity index 100% rename from web/thesauruses/nim/1/lists.json rename to web/thesauruses/langs/nim/1/lists.json diff --git a/web/thesauruses/nim/1/operators.json b/web/thesauruses/langs/nim/1/operators.json similarity index 100% rename from web/thesauruses/nim/1/operators.json rename to web/thesauruses/langs/nim/1/operators.json diff --git a/web/thesauruses/objectivec/2/control_structures.json b/web/thesauruses/langs/objectivec/2/control_structures.json similarity index 100% rename from web/thesauruses/objectivec/2/control_structures.json rename to web/thesauruses/langs/objectivec/2/control_structures.json diff --git a/web/thesauruses/objectivec/2/data_types.json b/web/thesauruses/langs/objectivec/2/data_types.json similarity index 100% rename from web/thesauruses/objectivec/2/data_types.json rename to web/thesauruses/langs/objectivec/2/data_types.json diff --git a/web/thesauruses/objectivec/2/functions.json b/web/thesauruses/langs/objectivec/2/functions.json similarity index 100% rename from web/thesauruses/objectivec/2/functions.json rename to web/thesauruses/langs/objectivec/2/functions.json diff --git a/web/thesauruses/objectivec/2/lists.json b/web/thesauruses/langs/objectivec/2/lists.json similarity index 100% rename from web/thesauruses/objectivec/2/lists.json rename to web/thesauruses/langs/objectivec/2/lists.json diff --git a/web/thesauruses/objectivec/2/operators.json b/web/thesauruses/langs/objectivec/2/operators.json similarity index 100% rename from web/thesauruses/objectivec/2/operators.json rename to web/thesauruses/langs/objectivec/2/operators.json diff --git a/web/thesauruses/objectivec/2/queues_stacks.json b/web/thesauruses/langs/objectivec/2/queues_stacks.json similarity index 100% rename from web/thesauruses/objectivec/2/queues_stacks.json rename to web/thesauruses/langs/objectivec/2/queues_stacks.json diff --git a/web/thesauruses/perl/5/control_structures.json b/web/thesauruses/langs/perl/5/control_structures.json similarity index 100% rename from web/thesauruses/perl/5/control_structures.json rename to web/thesauruses/langs/perl/5/control_structures.json diff --git a/web/thesauruses/perl/5/data_types.json b/web/thesauruses/langs/perl/5/data_types.json similarity index 100% rename from web/thesauruses/perl/5/data_types.json rename to web/thesauruses/langs/perl/5/data_types.json diff --git a/web/thesauruses/perl/5/operators.json b/web/thesauruses/langs/perl/5/operators.json similarity index 100% rename from web/thesauruses/perl/5/operators.json rename to web/thesauruses/langs/perl/5/operators.json diff --git a/web/thesauruses/php/7/classes.json b/web/thesauruses/langs/php/7/classes.json similarity index 100% rename from web/thesauruses/php/7/classes.json rename to web/thesauruses/langs/php/7/classes.json diff --git a/web/thesauruses/php/7/control_structures.json b/web/thesauruses/langs/php/7/control_structures.json similarity index 100% rename from web/thesauruses/php/7/control_structures.json rename to web/thesauruses/langs/php/7/control_structures.json diff --git a/web/thesauruses/php/7/data_types.json b/web/thesauruses/langs/php/7/data_types.json similarity index 100% rename from web/thesauruses/php/7/data_types.json rename to web/thesauruses/langs/php/7/data_types.json diff --git a/web/thesauruses/php/7/exception_handling.json b/web/thesauruses/langs/php/7/exception_handling.json similarity index 100% rename from web/thesauruses/php/7/exception_handling.json rename to web/thesauruses/langs/php/7/exception_handling.json diff --git a/web/thesauruses/php/7/functions.json b/web/thesauruses/langs/php/7/functions.json similarity index 100% rename from web/thesauruses/php/7/functions.json rename to web/thesauruses/langs/php/7/functions.json diff --git a/web/thesauruses/php/7/lists.json b/web/thesauruses/langs/php/7/lists.json similarity index 100% rename from web/thesauruses/php/7/lists.json rename to web/thesauruses/langs/php/7/lists.json diff --git a/web/thesauruses/php/7/operators.json b/web/thesauruses/langs/php/7/operators.json similarity index 100% rename from web/thesauruses/php/7/operators.json rename to web/thesauruses/langs/php/7/operators.json diff --git a/web/thesauruses/php/8/classes.json b/web/thesauruses/langs/php/8/classes.json similarity index 100% rename from web/thesauruses/php/8/classes.json rename to web/thesauruses/langs/php/8/classes.json diff --git a/web/thesauruses/php/8/control_structures.json b/web/thesauruses/langs/php/8/control_structures.json similarity index 100% rename from web/thesauruses/php/8/control_structures.json rename to web/thesauruses/langs/php/8/control_structures.json diff --git a/web/thesauruses/php/8/data_types.json b/web/thesauruses/langs/php/8/data_types.json similarity index 100% rename from web/thesauruses/php/8/data_types.json rename to web/thesauruses/langs/php/8/data_types.json diff --git a/web/thesauruses/php/8/exception_handling.json b/web/thesauruses/langs/php/8/exception_handling.json similarity index 100% rename from web/thesauruses/php/8/exception_handling.json rename to web/thesauruses/langs/php/8/exception_handling.json diff --git a/web/thesauruses/php/8/functions.json b/web/thesauruses/langs/php/8/functions.json similarity index 100% rename from web/thesauruses/php/8/functions.json rename to web/thesauruses/langs/php/8/functions.json diff --git a/web/thesauruses/php/8/lists.json b/web/thesauruses/langs/php/8/lists.json similarity index 100% rename from web/thesauruses/php/8/lists.json rename to web/thesauruses/langs/php/8/lists.json diff --git a/web/thesauruses/php/8/operators.json b/web/thesauruses/langs/php/8/operators.json similarity index 100% rename from web/thesauruses/php/8/operators.json rename to web/thesauruses/langs/php/8/operators.json diff --git a/web/thesauruses/php/8/queues_stacks.json b/web/thesauruses/langs/php/8/queues_stacks.json similarity index 100% rename from web/thesauruses/php/8/queues_stacks.json rename to web/thesauruses/langs/php/8/queues_stacks.json diff --git a/web/thesauruses/powershell/7/classes.json b/web/thesauruses/langs/powershell/7/classes.json similarity index 100% rename from web/thesauruses/powershell/7/classes.json rename to web/thesauruses/langs/powershell/7/classes.json diff --git a/web/thesauruses/powershell/7/control_structures.json b/web/thesauruses/langs/powershell/7/control_structures.json similarity index 100% rename from web/thesauruses/powershell/7/control_structures.json rename to web/thesauruses/langs/powershell/7/control_structures.json diff --git a/web/thesauruses/powershell/7/data_types.json b/web/thesauruses/langs/powershell/7/data_types.json similarity index 100% rename from web/thesauruses/powershell/7/data_types.json rename to web/thesauruses/langs/powershell/7/data_types.json diff --git a/web/thesauruses/python/3/classes.json b/web/thesauruses/langs/python/3/classes.json similarity index 100% rename from web/thesauruses/python/3/classes.json rename to web/thesauruses/langs/python/3/classes.json diff --git a/web/thesauruses/python/3/control_structures.json b/web/thesauruses/langs/python/3/control_structures.json similarity index 100% rename from web/thesauruses/python/3/control_structures.json rename to web/thesauruses/langs/python/3/control_structures.json diff --git a/web/thesauruses/python/3/data_types.json b/web/thesauruses/langs/python/3/data_types.json similarity index 100% rename from web/thesauruses/python/3/data_types.json rename to web/thesauruses/langs/python/3/data_types.json diff --git a/web/thesauruses/python/3/exception_handling.json b/web/thesauruses/langs/python/3/exception_handling.json similarity index 100% rename from web/thesauruses/python/3/exception_handling.json rename to web/thesauruses/langs/python/3/exception_handling.json diff --git a/web/thesauruses/python/3/functions.json b/web/thesauruses/langs/python/3/functions.json similarity index 100% rename from web/thesauruses/python/3/functions.json rename to web/thesauruses/langs/python/3/functions.json diff --git a/web/thesauruses/python/3/io.json b/web/thesauruses/langs/python/3/io.json similarity index 100% rename from web/thesauruses/python/3/io.json rename to web/thesauruses/langs/python/3/io.json diff --git a/web/thesauruses/python/3/lists.json b/web/thesauruses/langs/python/3/lists.json similarity index 100% rename from web/thesauruses/python/3/lists.json rename to web/thesauruses/langs/python/3/lists.json diff --git a/web/thesauruses/python/3/operators.json b/web/thesauruses/langs/python/3/operators.json similarity index 100% rename from web/thesauruses/python/3/operators.json rename to web/thesauruses/langs/python/3/operators.json diff --git a/web/thesauruses/python/3/queues_stacks.json b/web/thesauruses/langs/python/3/queues_stacks.json similarity index 100% rename from web/thesauruses/python/3/queues_stacks.json rename to web/thesauruses/langs/python/3/queues_stacks.json diff --git a/web/thesauruses/python/3/strings.json b/web/thesauruses/langs/python/3/strings.json similarity index 100% rename from web/thesauruses/python/3/strings.json rename to web/thesauruses/langs/python/3/strings.json diff --git a/web/thesauruses/r/4/classes.json b/web/thesauruses/langs/r/4/classes.json similarity index 100% rename from web/thesauruses/r/4/classes.json rename to web/thesauruses/langs/r/4/classes.json diff --git a/web/thesauruses/r/4/data_types.json b/web/thesauruses/langs/r/4/data_types.json similarity index 100% rename from web/thesauruses/r/4/data_types.json rename to web/thesauruses/langs/r/4/data_types.json diff --git a/web/thesauruses/r/4/io.json b/web/thesauruses/langs/r/4/io.json similarity index 100% rename from web/thesauruses/r/4/io.json rename to web/thesauruses/langs/r/4/io.json diff --git a/web/thesauruses/r/4/lists.json b/web/thesauruses/langs/r/4/lists.json similarity index 100% rename from web/thesauruses/r/4/lists.json rename to web/thesauruses/langs/r/4/lists.json diff --git a/web/thesauruses/r/4/operators.json b/web/thesauruses/langs/r/4/operators.json similarity index 100% rename from web/thesauruses/r/4/operators.json rename to web/thesauruses/langs/r/4/operators.json diff --git a/web/thesauruses/ruby/3/classes.json b/web/thesauruses/langs/ruby/3/classes.json similarity index 100% rename from web/thesauruses/ruby/3/classes.json rename to web/thesauruses/langs/ruby/3/classes.json diff --git a/web/thesauruses/ruby/3/control_structures.json b/web/thesauruses/langs/ruby/3/control_structures.json similarity index 100% rename from web/thesauruses/ruby/3/control_structures.json rename to web/thesauruses/langs/ruby/3/control_structures.json diff --git a/web/thesauruses/ruby/3/data_types.json b/web/thesauruses/langs/ruby/3/data_types.json similarity index 100% rename from web/thesauruses/ruby/3/data_types.json rename to web/thesauruses/langs/ruby/3/data_types.json diff --git a/web/thesauruses/ruby/3/exception_handling.json b/web/thesauruses/langs/ruby/3/exception_handling.json similarity index 100% rename from web/thesauruses/ruby/3/exception_handling.json rename to web/thesauruses/langs/ruby/3/exception_handling.json diff --git a/web/thesauruses/ruby/3/functions.json b/web/thesauruses/langs/ruby/3/functions.json similarity index 100% rename from web/thesauruses/ruby/3/functions.json rename to web/thesauruses/langs/ruby/3/functions.json diff --git a/web/thesauruses/ruby/3/lists.json b/web/thesauruses/langs/ruby/3/lists.json similarity index 100% rename from web/thesauruses/ruby/3/lists.json rename to web/thesauruses/langs/ruby/3/lists.json diff --git a/web/thesauruses/ruby/3/strings.json b/web/thesauruses/langs/ruby/3/strings.json similarity index 100% rename from web/thesauruses/ruby/3/strings.json rename to web/thesauruses/langs/ruby/3/strings.json diff --git a/web/thesauruses/rust/1/control_structures.json b/web/thesauruses/langs/rust/1/control_structures.json similarity index 100% rename from web/thesauruses/rust/1/control_structures.json rename to web/thesauruses/langs/rust/1/control_structures.json diff --git a/web/thesauruses/rust/1/data_types.json b/web/thesauruses/langs/rust/1/data_types.json similarity index 100% rename from web/thesauruses/rust/1/data_types.json rename to web/thesauruses/langs/rust/1/data_types.json diff --git a/web/thesauruses/rust/1/functions.json b/web/thesauruses/langs/rust/1/functions.json similarity index 100% rename from web/thesauruses/rust/1/functions.json rename to web/thesauruses/langs/rust/1/functions.json diff --git a/web/thesauruses/rust/1/operators.json b/web/thesauruses/langs/rust/1/operators.json similarity index 100% rename from web/thesauruses/rust/1/operators.json rename to web/thesauruses/langs/rust/1/operators.json diff --git a/web/thesauruses/rust/1/queues_stacks.json b/web/thesauruses/langs/rust/1/queues_stacks.json similarity index 100% rename from web/thesauruses/rust/1/queues_stacks.json rename to web/thesauruses/langs/rust/1/queues_stacks.json diff --git a/web/thesauruses/rust/1/strings.json b/web/thesauruses/langs/rust/1/strings.json similarity index 100% rename from web/thesauruses/rust/1/strings.json rename to web/thesauruses/langs/rust/1/strings.json diff --git a/web/thesauruses/scala/2/control_structures.json b/web/thesauruses/langs/scala/2/control_structures.json similarity index 100% rename from web/thesauruses/scala/2/control_structures.json rename to web/thesauruses/langs/scala/2/control_structures.json diff --git a/web/thesauruses/scala/2/data_types.json b/web/thesauruses/langs/scala/2/data_types.json similarity index 100% rename from web/thesauruses/scala/2/data_types.json rename to web/thesauruses/langs/scala/2/data_types.json diff --git a/web/thesauruses/scala/2/functions.json b/web/thesauruses/langs/scala/2/functions.json similarity index 100% rename from web/thesauruses/scala/2/functions.json rename to web/thesauruses/langs/scala/2/functions.json diff --git a/web/thesauruses/scala/2/operators.json b/web/thesauruses/langs/scala/2/operators.json similarity index 100% rename from web/thesauruses/scala/2/operators.json rename to web/thesauruses/langs/scala/2/operators.json diff --git a/web/thesauruses/swift/5/classes.json b/web/thesauruses/langs/swift/5/classes.json similarity index 100% rename from web/thesauruses/swift/5/classes.json rename to web/thesauruses/langs/swift/5/classes.json diff --git a/web/thesauruses/swift/5/control_structures.json b/web/thesauruses/langs/swift/5/control_structures.json similarity index 100% rename from web/thesauruses/swift/5/control_structures.json rename to web/thesauruses/langs/swift/5/control_structures.json diff --git a/web/thesauruses/swift/5/data_types.json b/web/thesauruses/langs/swift/5/data_types.json similarity index 100% rename from web/thesauruses/swift/5/data_types.json rename to web/thesauruses/langs/swift/5/data_types.json diff --git a/web/thesauruses/swift/5/functions.json b/web/thesauruses/langs/swift/5/functions.json similarity index 100% rename from web/thesauruses/swift/5/functions.json rename to web/thesauruses/langs/swift/5/functions.json diff --git a/web/thesauruses/swift/5/lists.json b/web/thesauruses/langs/swift/5/lists.json similarity index 100% rename from web/thesauruses/swift/5/lists.json rename to web/thesauruses/langs/swift/5/lists.json diff --git a/web/thesauruses/swift/5/operators.json b/web/thesauruses/langs/swift/5/operators.json similarity index 100% rename from web/thesauruses/swift/5/operators.json rename to web/thesauruses/langs/swift/5/operators.json diff --git a/web/thesauruses/swift/5/strings.json b/web/thesauruses/langs/swift/5/strings.json similarity index 100% rename from web/thesauruses/swift/5/strings.json rename to web/thesauruses/langs/swift/5/strings.json diff --git a/web/thesauruses/typescript/4/classes.json b/web/thesauruses/langs/typescript/4/classes.json similarity index 100% rename from web/thesauruses/typescript/4/classes.json rename to web/thesauruses/langs/typescript/4/classes.json diff --git a/web/thesauruses/typescript/4/control_structures.json b/web/thesauruses/langs/typescript/4/control_structures.json similarity index 100% rename from web/thesauruses/typescript/4/control_structures.json rename to web/thesauruses/langs/typescript/4/control_structures.json diff --git a/web/thesauruses/typescript/4/data_types.json b/web/thesauruses/langs/typescript/4/data_types.json similarity index 100% rename from web/thesauruses/typescript/4/data_types.json rename to web/thesauruses/langs/typescript/4/data_types.json diff --git a/web/thesauruses/typescript/4/exception_handling.json b/web/thesauruses/langs/typescript/4/exception_handling.json similarity index 100% rename from web/thesauruses/typescript/4/exception_handling.json rename to web/thesauruses/langs/typescript/4/exception_handling.json diff --git a/web/thesauruses/typescript/4/functions.json b/web/thesauruses/langs/typescript/4/functions.json similarity index 100% rename from web/thesauruses/typescript/4/functions.json rename to web/thesauruses/langs/typescript/4/functions.json diff --git a/web/thesauruses/typescript/4/lists.json b/web/thesauruses/langs/typescript/4/lists.json similarity index 100% rename from web/thesauruses/typescript/4/lists.json rename to web/thesauruses/langs/typescript/4/lists.json diff --git a/web/thesauruses/typescript/4/operators.json b/web/thesauruses/langs/typescript/4/operators.json similarity index 100% rename from web/thesauruses/typescript/4/operators.json rename to web/thesauruses/langs/typescript/4/operators.json diff --git a/web/thesauruses/typescript/4/queues_stacks.json b/web/thesauruses/langs/typescript/4/queues_stacks.json similarity index 100% rename from web/thesauruses/typescript/4/queues_stacks.json rename to web/thesauruses/langs/typescript/4/queues_stacks.json diff --git a/web/thesauruses/typescript/4/strings.json b/web/thesauruses/langs/typescript/4/strings.json similarity index 100% rename from web/thesauruses/typescript/4/strings.json rename to web/thesauruses/langs/typescript/4/strings.json diff --git a/web/thesauruses/vbnet/16/classes.json b/web/thesauruses/langs/vbnet/16/classes.json similarity index 100% rename from web/thesauruses/vbnet/16/classes.json rename to web/thesauruses/langs/vbnet/16/classes.json diff --git a/web/thesauruses/vbnet/16/control_structures.json b/web/thesauruses/langs/vbnet/16/control_structures.json similarity index 100% rename from web/thesauruses/vbnet/16/control_structures.json rename to web/thesauruses/langs/vbnet/16/control_structures.json diff --git a/web/thesauruses/vbnet/16/data_types.json b/web/thesauruses/langs/vbnet/16/data_types.json similarity index 100% rename from web/thesauruses/vbnet/16/data_types.json rename to web/thesauruses/langs/vbnet/16/data_types.json diff --git a/web/thesauruses/vbnet/16/functions.json b/web/thesauruses/langs/vbnet/16/functions.json similarity index 100% rename from web/thesauruses/vbnet/16/functions.json rename to web/thesauruses/langs/vbnet/16/functions.json diff --git a/web/thesauruses/vbnet/16/lists.json b/web/thesauruses/langs/vbnet/16/lists.json similarity index 100% rename from web/thesauruses/vbnet/16/lists.json rename to web/thesauruses/langs/vbnet/16/lists.json diff --git a/web/thesauruses/vbnet/16/operators.json b/web/thesauruses/langs/vbnet/16/operators.json similarity index 100% rename from web/thesauruses/vbnet/16/operators.json rename to web/thesauruses/langs/vbnet/16/operators.json diff --git a/web/thesauruses/vbnet/16/strings.json b/web/thesauruses/langs/vbnet/16/strings.json similarity index 100% rename from web/thesauruses/vbnet/16/strings.json rename to web/thesauruses/langs/vbnet/16/strings.json From a9b8bc962244e17a5b8bb57e25d35b5310493a6b Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:14:56 -0500 Subject: [PATCH 03/15] Add initial alterations to make a SQL/NoSQL section happen, some sample entries too --- .../commands/validatelanginfofiles.py | 39 +++- .../commands/validatemetainfofile.py | 57 ++++-- ..._rename_language_to_entry_in_lookupdata.py | 23 +++ web/models.py | 33 +++- web/static/js/checkAvailableStructs.js | 86 +++++---- web/templates/error_missing_structure.html | 4 +- web/templates/index.html | 49 ++--- web/tests/test_categories.py | 122 ++++++++++++ web/tests/test_db_models.py | 8 +- web/tests/test_models.py | 14 +- web/tests/test_views.py | 59 +++--- web/thesauruses/_meta/deletions.json | 12 ++ web/thesauruses/_meta/filtering.json | 12 ++ web/thesauruses/_meta/inserts.json | 12 ++ web/thesauruses/_meta/queries.json | 12 ++ .../databases/mongodb/6/queries.json | 16 ++ .../databases/mysql/8/queries.json | 16 ++ .../databases/postgresql/15/queries.json | 16 ++ web/thesauruses/meta_info.json | 42 +++-- web/views.py | 174 +++++++++++------- 20 files changed, 598 insertions(+), 208 deletions(-) create mode 100644 web/migrations/0005_rename_language_to_entry_in_lookupdata.py create mode 100644 web/tests/test_categories.py create mode 100644 web/thesauruses/_meta/deletions.json create mode 100644 web/thesauruses/_meta/filtering.json create mode 100644 web/thesauruses/_meta/inserts.json create mode 100644 web/thesauruses/_meta/queries.json create mode 100644 web/thesauruses/databases/mongodb/6/queries.json create mode 100644 web/thesauruses/databases/mysql/8/queries.json create mode 100644 web/thesauruses/databases/postgresql/15/queries.json diff --git a/web/management/commands/validatelanginfofiles.py b/web/management/commands/validatelanginfofiles.py index fb6cb326a..b3083da99 100644 --- a/web/management/commands/validatelanginfofiles.py +++ b/web/management/commands/validatelanginfofiles.py @@ -3,6 +3,8 @@ from django.core.management.base import BaseCommand, CommandError +from web.models import ThesaurusMetaInfo + class Command(BaseCommand): help = "Reads all language JSON files to ensure they're constructed correctly" @@ -12,18 +14,24 @@ def __init__(self, *args, **kwargs): self.error_count = 0 self.warning_count = 0 self.thesauruses_path = Path("web/thesauruses") + self.metainfo = None def handle(self, *args, **options): - for lang_dir in self.thesauruses_path.iterdir(): - if not lang_dir.is_dir() or lang_dir.name == "_meta": + self.metainfo = ThesaurusMetaInfo() + for category_dir in self.thesauruses_path.iterdir(): + if not category_dir.is_dir() or category_dir.name == "_meta": continue - - for version_dir in lang_dir.iterdir(): - if not version_dir.is_dir(): + + for lang_dir in category_dir.iterdir(): + if not lang_dir.is_dir(): continue - for structure_file in version_dir.glob("*.json"): - self.validate_language_file(structure_file) + for version_dir in lang_dir.iterdir(): + if not version_dir.is_dir(): + continue + + for structure_file in version_dir.glob("*.json"): + self.validate_language_file(structure_file) if self.warning_count > 0: self.stdout.write(self.style.WARNING(f"{self.warning_count} warnings found.")) @@ -55,12 +63,13 @@ def validate_language_file(self, file_path): self.check_meta_section(data, relative_path) self.check_concepts(data, relative_path) + self.check_category_structure_consistency(data, relative_path) def check_meta_section(self, data, relative_path): meta = data.get("meta", {}) - # relative_path is something like "python/3/data_types.json" - # parts[0] is the language directory name - lang_dir = relative_path.parts[0] + # relative_path is something like "langs/python/3/data_types.json" + # parts[1] is the language directory name + lang_dir = relative_path.parts[1] language = meta.get("language") language_version = meta.get("language_version") @@ -130,3 +139,13 @@ def check_concepts(self, data, relative_path): for key in item_data: if key not in allowed_keys: self.report_warning(f"`{relative_path}`, ID: `{concept_id}` has a line `{key}` that's unknown") + + def check_category_structure_consistency(self, data, relative_path): + """Check if the structure is allowed for the category it is in""" + # relative_path is like "langs/python/3/data_types.json" + category = relative_path.parts[0] + structure_name = relative_path.name.split('.')[0] + + category_structures = self.metainfo.category_structures.get(category, {}) + if structure_name not in category_structures: + self.report_error(f"`{relative_path}` is in category `{category}`, but `{structure_name}` is not a valid structure for this category in `meta_info.json`") diff --git a/web/management/commands/validatemetainfofile.py b/web/management/commands/validatemetainfofile.py index 71ceebde8..9a9b81fb8 100644 --- a/web/management/commands/validatemetainfofile.py +++ b/web/management/commands/validatemetainfofile.py @@ -18,6 +18,7 @@ def __init__(self, *args, **kwargs): def handle(self, *args, **options): self.metainfo = ThesaurusMetaInfo() + self.check_category_directories() self.check_thesaurus_directories() self.check_meta_info_consistency() self.check_meta_files_consistency() @@ -31,34 +32,60 @@ def report_error(self, message): self.stderr.write(self.style.ERROR(f"[Error] {message}")) self.error_count += 1 + def check_category_directories(self): + """Check all categories in meta_info.json have corresponding directories and vice versa""" + # Check if all directories in web/thesauruses are accounted for + for category_dir in self.thesauruses_path.iterdir(): + if not category_dir.is_dir() or category_dir.name == "_meta": + continue + if category_dir.name not in self.metainfo.categories: + self.report_error(f"Directory `{category_dir}` exists but `{category_dir.name}` is not listed as a category in `meta_info.json`") + + # Check if all categories in meta_info.json have directories + for category_key in self.metainfo.categories: + path = self.thesauruses_path / category_key + if not path.is_dir(): + self.report_error(f"Category `{category_key}` is listed in `meta_info.json` but directory `{path}` was not found") + def check_thesaurus_directories(self): """Look through thesaurus directories, see if any files don't match""" meta_files = {f.name for f in self.meta_path.iterdir() if f.is_file()} - for lang_dir in self.thesauruses_path.iterdir(): - if not lang_dir.is_dir() or lang_dir.name == "_meta": + for category_dir in self.thesauruses_path.iterdir(): + if not category_dir.is_dir() or category_dir.name == "_meta": continue - lang = lang_dir.name - if lang not in self.metainfo.languages: - self.report_error(f"`{lang_dir}` exists but {lang} is not listed as a language in `meta_info.json`") - - for version_dir in lang_dir.iterdir(): - if version_dir.is_file(): - self.report_error(f"`{version_dir}` is a file but a directory for a version was expected") + for lang_dir in category_dir.iterdir(): + if not lang_dir.is_dir(): continue - for structure_file in version_dir.iterdir(): - if structure_file.name not in meta_files: - self.report_error(f"`{structure_file}` is not a valid concept filename") + lang = lang_dir.name + if lang not in self.metainfo.languages: + self.report_error(f"`{lang_dir}` exists but {lang} is not listed as a language in `meta_info.json`") + + for version_dir in lang_dir.iterdir(): + if version_dir.is_file(): + self.report_error(f"`{version_dir}` is a file but a directory for a version was expected") + continue + + for structure_file in version_dir.iterdir(): + if structure_file.name not in meta_files: + self.report_error(f"`{structure_file}` is not a valid concept filename") def check_meta_info_consistency(self): """Check all language directories exist for languages listed in meta_info.json""" for meta_lang in self.metainfo.languages: - path = self.thesauruses_path / meta_lang - if not path.is_dir(): + found = False + for category_dir in self.thesauruses_path.iterdir(): + if not category_dir.is_dir() or category_dir.name == "_meta": + continue + path = category_dir / meta_lang + if path.is_dir(): + found = True + break + if not found: lang_name = self.metainfo.languages[meta_lang] - self.report_error(f"{lang_name} is listed as a language in `meta_info.json` but the directory `{path}` doesn't exist") + self.report_error(f"{lang_name} is listed as a language in `meta_info.json` but no directory for it was found in any category") def check_meta_files_consistency(self): """Check structures in _meta match those in ThesaurusMetaInfo""" diff --git a/web/migrations/0005_rename_language_to_entry_in_lookupdata.py b/web/migrations/0005_rename_language_to_entry_in_lookupdata.py new file mode 100644 index 000000000..767c8e279 --- /dev/null +++ b/web/migrations/0005_rename_language_to_entry_in_lookupdata.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.27 on 2026-01-22 19:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0004_missinglookup'), + ] + + operations = [ + migrations.RenameField( + model_name='lookupdata', + old_name='language1', + new_name='entry1', + ), + migrations.RenameField( + model_name='lookupdata', + old_name='language2', + new_name='entry2', + ), + ] diff --git a/web/models.py b/web/models.py index 06caddc72..d7bdd36b6 100644 --- a/web/models.py +++ b/web/models.py @@ -58,7 +58,19 @@ def __init__(self, key, name): self.name = name self.concepts = None self.version = None - self.language_dir = os.path.join("web", "thesauruses", self.key) + self.language_dir = None + for category in os.listdir(os.path.join("web", "thesauruses")): + if category == "_meta" or not os.path.isdir(os.path.join("web", "thesauruses", category)): + continue + potential_dir = os.path.join("web", "thesauruses", category, self.key) + if os.path.exists(potential_dir): + self.language_dir = potential_dir + break + + if self.language_dir is None: + # Fallback for when it doesn't exist yet (e.g. during template generation) + # Defaulting to 'langs' if not found, but this might need refinement + self.language_dir = os.path.join("web", "thesauruses", "langs", self.key) self.version = None @@ -282,16 +294,29 @@ def __init__(self): if ThesaurusMetaInfo._cached_structures is not None: self.structures = ThesaurusMetaInfo._cached_structures self.languages = ThesaurusMetaInfo._cached_languages + self.categories = getattr(ThesaurusMetaInfo, "_cached_categories", {}) + self.category_structures = getattr(ThesaurusMetaInfo, "_cached_category_structures", {}) return meta_info_file_path = os.path.join( "web", "thesauruses", "meta_info.json") with open(meta_info_file_path, 'r', encoding='UTF-8') as meta_file: meta_info_json = json.load(meta_file) - self.structures = meta_info_json["structures"] + + self.categories = meta_info_json.get("categories", {}) self.languages = meta_info_json["languages"] + + # Flatten structures for backward compatibility where needed, + # but keep track of category-specific ones + self.category_structures = meta_info_json["structures"] + self.structures = {} + for cat_structs in self.category_structures.values(): + self.structures.update(cat_structs) + ThesaurusMetaInfo._cached_structures = self.structures ThesaurusMetaInfo._cached_languages = self.languages + ThesaurusMetaInfo._cached_categories = self.categories + ThesaurusMetaInfo._cached_category_structures = self.category_structures def entry_name(self, entry_key): @@ -378,9 +403,9 @@ class SiteVisit(models.Model): class LookupData(models.Model): id = models.BigAutoField(primary_key=True) date_time = models.DateTimeField(auto_now_add=True) - language1 = models.CharField(max_length=50) + entry1 = models.CharField(max_length=50) version1 = models.CharField(max_length=20, default='') - language2 = models.CharField(max_length=50) + entry2 = models.CharField(max_length=50) version2 = models.CharField(max_length=20, default='') structure = models.CharField(max_length=50) site_visit = models.ForeignKey(SiteVisit, on_delete=models.CASCADE) diff --git a/web/static/js/checkAvailableStructs.js b/web/static/js/checkAvailableStructs.js index dda475ecb..c3d579db8 100644 --- a/web/static/js/checkAvailableStructs.js +++ b/web/static/js/checkAvailableStructs.js @@ -1,17 +1,28 @@ function main() { - const refConc = document.getElementById('reference-concept'); - const refLang = document.getElementById('lang'); - const compConc = document.getElementById('concept'); - const compLang1 = document.getElementById('lang1'); - const compLang2 = document.getElementById('lang2'); - - // need to make sure the initial concept and language/version - // combinations are ones that are available - setCombination(refConc, refLang); - setCombination(compConc, compLang1, compLang2); + const refConcs = document.querySelectorAll('.reference-concept-select'); + const compConcs = document.querySelectorAll('.concept-select'); - refConc.addEventListener('change', () => setCombination(refConc, refLang)); - compConc.addEventListener('change', () => setCombination(compConc, compLang1, compLang2)); + refConcs.forEach(refConc => { + const category = refConc.dataset.category; + const refEntry = document.getElementById(`entry-${category}`); + if (refEntry) { + setCombination(refConc, refEntry); + refConc.addEventListener('change', () => setCombination(refConc, refEntry)); + refEntry.addEventListener('change', () => setCombination(refConc, refEntry)); + } + }); + + compConcs.forEach(compConc => { + const category = compConc.dataset.category; + const compEntry1 = document.getElementById(`entry1-${category}`); + const compEntry2 = document.getElementById(`entry2-${category}`); + if (compEntry1 && compEntry2) { + setCombination(compConc, compEntry1, compEntry2); + compConc.addEventListener('change', () => setCombination(compConc, compEntry1, compEntry2)); + compEntry1.addEventListener('change', () => setCombination(compConc, compEntry1, compEntry2)); + compEntry2.addEventListener('change', () => setCombination(compConc, compEntry1, compEntry2)); + } + }); } function getSelectText(selectElem) { @@ -22,42 +33,41 @@ function getSelectValue(selectElem) { return selectElem.options[selectElem.selectedIndex].value; } -function setCombination(conc, lang1, lang2=null) { - const lang1Options = lang1.querySelectorAll('option'); - const lang1ClassList = Array.from(lang1.querySelector(`option[value='${getSelectValue(lang1)}']`).classList); - let lang1IsSet = lang1ClassList.includes(getSelectValue(conc)); +function setCombination(conc, entry1, entry2=null) { + const concValue = getSelectValue(conc); + const entry1Options = entry1.querySelectorAll('option'); + const entry1SelectedOption = entry1.querySelector(`option[value='${getSelectValue(entry1).replace(/'/g, "\\'")}']`); + const entry1ClassList = entry1SelectedOption ? Array.from(entry1SelectedOption.classList) : []; + let entry1IsSet = entry1ClassList.includes(concValue); - for (let i of lang1Options) { + for (let i of entry1Options) { const classList = Array.from(i.classList); - if (classList.includes(getSelectValue(conc))) { - if (i.disabled) { - i.disabled = false; + if (classList.includes(concValue)) { + i.disabled = false; + if (!entry1IsSet) { + entry1.value = i.value; + entry1IsSet = true; } - if (!lang1IsSet) { - lang1.value = i.value; - lang1IsSet = true; - } - } else if (!i.disabled) { + } else { i.disabled = true; } } - if (lang2 !== null) { - const lang2Options = lang2.querySelectorAll('option'); - const lang2ClassList = Array.from(lang2.querySelector(`option[value='${getSelectValue(lang2)}']`).classList) - let lang2IsSet = lang2ClassList.includes(getSelectValue(conc)); + if (entry2 !== null) { + const entry2Options = entry2.querySelectorAll('option'); + const entry2SelectedOption = entry2.querySelector(`option[value='${getSelectValue(entry2).replace(/'/g, "\\'")}']`); + const entry2ClassList = entry2SelectedOption ? Array.from(entry2SelectedOption.classList) : []; + let entry2IsSet = entry2ClassList.includes(concValue); - for (let i of lang2Options) { + for (let i of entry2Options) { const classList = Array.from(i.classList); - if (classList.includes(getSelectValue(conc))) { - if (i.disabled) { - i.disabled = false; - } - if (!lang2IsSet && i.value !== getSelectValue(lang1)) { - lang2.value = i.value; - lang2IsSet = true; + if (classList.includes(concValue)) { + i.disabled = false; + if (!entry2IsSet && i.value !== getSelectValue(entry1)) { + entry2.value = i.value; + entry2IsSet = true; } - } else if (!i.disabled) { + } else { i.disabled = true; } } diff --git a/web/templates/error_missing_structure.html b/web/templates/error_missing_structure.html index d6c41373f..81ca3aa39 100644 --- a/web/templates/error_missing_structure.html +++ b/web/templates/error_missing_structure.html @@ -6,11 +6,11 @@

Oops!

- There is no entry about {{name}} for {{lang_name}} version {{version}} yet. + There is no entry about {{name}} for {{entry_name}} version {{version}} yet.

Would you like to add it? Check out our contribution guidelines.
- Then, when you're ready, you can start by adding a thesaurus file on github. + Then, when you're ready, you can start by adding a thesaurus file on github.

Template for `{{key}}.json`

Go to the Home Page » diff --git a/web/templates/index.html b/web/templates/index.html index fd6e415d5..f4cf766f2 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -13,42 +13,48 @@

The Polyglot Developer Reference

-
+ {% for category in languages %} +
+
+

{{ category.label }}

+
+
+

- Learn a Language + Compare {{ category.label }}

- Compare concepts side-by-side with a language you know and one you don't. + Compare concepts side-by-side between different {{ category.label|lower }}.

- - + {% for k, v in category.structures.items %} {% endfor %}
- - + {% for k, lang in category.entries.items %} {% for v in lang %} {% endfor %} {% endfor %} -
@@ -75,19 +81,17 @@

- A quick and easy way to remind yourself how to do something. - - Still under construction. + A quick and easy way to remind yourself how to do something in a specific {{ category.key|slice:":-1" }}.

- - + {% for k, v in category.structures.items %} {% endfor %} - - + {% for k, lang in category.entries.items %} {% for v in lang %} {% endfor %} @@ -104,6 +108,7 @@

+ {% endfor %}