Datasets:
Tasks:
Text Classification
Formats:
parquet
Languages:
Ancient Greek (to 1453)
Size:
100K - 1M
License:
| from scripts import build_dataset as BUILD | |
| def test_valid_nine_position_tag_is_preserved(): | |
| assert BUILD.canonical_xpos( | |
| "VERB", "v3siia---", "Aspect=Imp|Mood=Ind|Number=Sing|Person=3" | |
| ) == "v3siia---" | |
| def test_proiel_xpos_is_rebuilt_from_upos_without_false_person(): | |
| assert BUILD.canonical_xpos("SCONJ", "G-", "_") == "c--------" | |
| def test_ud_features_fill_positional_morphology(): | |
| assert BUILD.canonical_xpos( | |
| "VERB", | |
| "V-", | |
| "Aspect=Imp|Mood=Ind|Number=Plur|Person=3|Tense=Past|VerbForm=Fin|Voice=Act", | |
| ) == "v3piia---" | |
| def test_every_ordinary_token_row_is_normalized(): | |
| source = ( | |
| "# sent_id = test\n" | |
| "1\tκαί\tκαί\tSCONJ\tG-\t_\t2\tmark\t_\t_\n" | |
| "2\tλέγει\tλέγω\tVERB\tV-\tMood=Ind|Number=Sing|Person=3|Tense=Pres|Voice=Act\t0\troot\t_\t_\n" | |
| ) | |
| normalized = BUILD.canonicalize_conllu_xpos(source) | |
| rows = [line.split("\t") for line in normalized.splitlines() if line and not line.startswith("#")] | |
| assert [row[4] for row in rows] == ["c--------", "v3spia---"] | |
| def test_native_relations_are_mapped_to_ud_v2(): | |
| relation = BUILD.canonical_native_deprel | |
| assert relation("SBJ", "NOUN", 2) == "nsubj" | |
| assert relation("OBJ", "NOUN", 2) == "obj" | |
| assert relation("ATR", "ADJ", 2) == "amod" | |
| assert relation("ATR", "NOUN", 2) == "nmod" | |
| assert relation("ADV", "VERB", 2) == "advcl" | |
| assert relation("AuxP", "ADP", 2) == "case" | |
| assert relation("AuxC", "SCONJ", 2) == "mark" | |
| assert relation("OBJ_CO", "NOUN", 2) == "conj" | |
| assert relation("unknown-native-label", "X", 2) == "dep" | |
| assert relation("SBJ", "NOUN", 0) == "root" | |