Skip to content

Commit

Permalink
Merge branch 'main' into all_in_one
Browse files Browse the repository at this point in the history
  • Loading branch information
wkyoshida authored Jan 10, 2025
2 parents 8fad882 + 49df8d8 commit 9efac94
Show file tree
Hide file tree
Showing 14 changed files with 348 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ repos:
args: [--fix]

- id: ruff-format

- repo: https://github.com/numpy/numpydoc
rev: v1.8.0
hooks:
- id: numpydoc-validation
files: ^src/
exclude: ^tests/
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[tool.pytest.ini_options]
pythonpath = "src"

[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"ES01",
"EX01",
"SA01",
]
4 changes: 2 additions & 2 deletions src/scribe_data/load/send_dbs_to_scribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@
)
language_db_dict["translation"]["full_path_to_scribe_ios_db"] = (
PATH_TO_SCRIBE_DATA_ROOT.parent
/ f"{language_db_dict["translation"]['scribe_ios_db_path']}"
/ f"{language_db_dict['translation']['scribe_ios_db_path']}"
)
language_db_dict["translation"]["scribe_android_db_path"] = (
get_android_data_path() / "TranslationData.sqlite"
)
language_db_dict["translation"]["full_path_to_scribe_android_db"] = (
PATH_TO_SCRIBE_DATA_ROOT.parent
/ f"{language_db_dict["translation"]['scribe_android_db_path']}"
/ f"{language_db_dict['translation']['scribe_android_db_path']}"
)

for language in language_db_dict:
Expand Down
39 changes: 39 additions & 0 deletions src/scribe_data/wikidata/data-contracts/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"numbers": { "nominativeSingular": "nominativePlural" },
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Präsens",
"1": { "ich": "indicativePresentFirstPersonSingular" },
"2": { "du": "indicativePresentSecondPersonSingular" },
"3": { "er/sie/es": "indicativePresentThirdPersonSingular" },
"4": { "wir": "indicativePresentFirstPersonPlural" },
"5": { "ihr": "indicativePresentSecondPersonPlural" },
"6": { "sie/Sie": "indicativePresentThirdPersonPlural" }
},
"2": {
"title": "Preterite",
"1": { "ich": "indicativePreteriteFirstPersonSingular" },
"2": { "du": "indicativePreteriteFirstPersonPlural" },
"3": { "er/sie/es": "indicativePreteriteSecondPersonSingular" },
"4": { "wir": "indicativePreteriteSecondPersonPlural" },
"5": { "ihr": "indicativePreteriteThirdPersonSingular" },
"6": { "sie/Sie": "indicativePreteriteThirdPersonPlural" }
},
"3": {
"title": "Perfekt",
"1": { "ich": "auxiliaryVerb pastParticiple" },
"2": { "du": "auxiliaryVerb pastParticiple" },
"3": { "er/sie/es": "auxiliaryVerb pastParticiple" },
"4": { "wir": "auxiliaryVerb pastParticiple" },
"5": { "ihr": "auxiliaryVerb pastParticiple" },
"6": { "sie/Sie": "auxiliaryVerb pastParticiple" }
}
}
}
21 changes: 21 additions & 0 deletions src/scribe_data/wikidata/data-contracts/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"numbers": { "singular": "plural" },
"genders": {
"canonical": [],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": ""
}
}
}
42 changes: 42 additions & 0 deletions src/scribe_data/wikidata/data-contracts/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"numbers": {
"feminineSingular": "femininePlural",
"masculineSingular": "masculinePlural"
},
"genders": {
"canonical": [],
"feminines": ["feminineSingular"],
"masculines": ["masculineSingular"],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Presente",
"1": { "yo": "indicativePresentFirstPersonSingular" },
"2": { "tú": "indicativePresentFirstPersonPlural" },
"3": { "él/ella/Ud.": "indicativePresentSecondPersonSingular" },
"4": { "nosotros": "indicativePresentSecondPersonPlural" },
"5": { "vosotros": "indicativePresentThirdPersonSingular" },
"6": { "ellos/ellas/Uds.": "indicativePresentThirdPersonPlural" }
},
"2": {
"title": "Pretérito",
"1": { "yo": "preteriteFirstPersonSingular" },
"2": { "tú": "preteriteFirstPersonPlural" },
"3": { "él/ella/Ud.": "preteriteSecondPersonSingular" },
"4": { "nosotros": "preteriteSecondPersonPlural" },
"5": { "vosotros": "preteriteThirdPersonSingular" },
"6": { "ellos/ellas/Uds.": "preteriteThirdPersonPlural" }
},
"3": {
"title": "Imperfecto",
"1": { "yo": "pastImperfectFirstPersonSingular" },
"2": { "tú": "pastImperfectFirstPersonPlural" },
"3": { "él/ella/Ud.": "pastImperfectSecondPersonSingular" },
"4": { "nosotros": "pastImperfectSecondPersonPlural" },
"5": { "vosotros": "pastImperfectThirdPersonSingular" },
"6": { "ellos/ellas/Uds.": "pastImperfectThirdPersonPlural" }
}
}
}
48 changes: 48 additions & 0 deletions src/scribe_data/wikidata/data-contracts/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"numbers": { "singular": "plural" },
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Présent",
"1": { "je": "indicativePresentFirstPersonSingular" },
"2": { "tu": "indicativePresentFirstPersonPlural" },
"3": { "il/elle": "indicativePresentSecondPersonSingular" },
"4": { "nous": "indicativePresentSecondPersonPlural" },
"5": { "vous": "indicativePresentThirdPersonSingular" },
"6": { "ils/elles": "indicativePresentThirdPersonPlural" }
},
"2": {
"title": "Passé simple",
"1": { "je": "indicativePreteriteFirstPersonSingular" },
"2": { "tu": "indicativePreteriteFirstPersonPlural" },
"3": { "il/elle": "indicativePreteriteSecondPersonSingular" },
"4": { "nous": "indicativePreteriteSecondPersonPlural" },
"5": { "vous": "indicativePreteriteThirdPersonSingular" },
"6": { "ils/elles": "indicativePreteriteThirdPersonPlural" }
},
"3": {
"title": "Imparfait",
"1": { "je": "indicativeImperfectFirstPersonSingular" },
"2": { "tu": "indicativeImperfectFirstPersonPlural" },
"3": { "il/elle": "indicativeImperfectSecondPersonSingular" },
"4": { "nous": "indicativeImperfectSecondPersonPlural" },
"5": { "vous": "indicativeImperfectThirdPersonSingular" },
"6": { "ils/elles": "indicativeImperfectThirdPersonPlural" }
},
"4": {
"title": "Futur",
"1": { "je": "indicativeSimpleFutureFirstPersonSingular" },
"2": { "tu": "indicativeSimpleFutureFirstPersonPlural" },
"3": { "il/elle": "indicativeSimpleFutureSecondPersonSingular" },
"4": { "nous": "indicativeSimpleFutureSecondPersonPlural" },
"5": { "vous": "indicativeSimpleFutureThirdPersonSingular" },
"6": { "ils/elles": "indicativeSimpleFutureThirdPersonPlural" }
}
}
}
39 changes: 39 additions & 0 deletions src/scribe_data/wikidata/data-contracts/it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"numbers": { "singular": "plural" },
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Presente",
"1": { "io": "presentIndicativeFirstPersonSingular" },
"2": { "tu": "presentIndicativeFirstPersonPlural" },
"3": { "lei/lui": "presentIndicativeSecondPersonSingular" },
"4": { "noi": "presentIndicativeSecondPersonPlural" },
"5": { "voi": "presentIndicativeThirdPersonSingular" },
"6": { "loro": "presentIndicativeThirdPersonPlural" }
},
"2": {
"title": "Preterito",
"1": { "io": "preteriteFirstPersonSingular" },
"2": { "tu": "preteriteFirstPersonPlural" },
"3": { "lei/lui": "preteriteSecondPersonSingular" },
"4": { "noi": "preteriteSecondPersonPlural" },
"5": { "voi": "preteriteThirdPersonSingular" },
"6": { "loro": "preteriteThirdPersonPlural" }
},
"3": {
"title": "Imperfetto",
"1": { "io": "pastImperfectFirstPersonSingular" },
"2": { "tu": "pastImperfectFirstPersonPlural" },
"3": { "lei/lui": "pastImperfectSecondPersonSingular" },
"4": { "noi": "pastImperfectSecondPersonPlural" },
"5": { "voi": "pastImperfectThirdPersonSingular" },
"6": { "loro": "pastImperfectThirdPersonPlural" }
}
}
}
48 changes: 48 additions & 0 deletions src/scribe_data/wikidata/data-contracts/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"numbers": { "singular": "plural" },
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Presente",
"1": { "eu": "indicativePresentFirstPersonSingular" },
"2": { "tu": "indicativePresentFirstPersonPlural" },
"3": { "ele/ela/você": "indicativePresentSecondPersonSingular" },
"4": { "nós": "indicativePresentSecondPersonPlural" },
"5": { "vós": "indicativePresentThirdPersonSingular" },
"6": { "eles/elas/vocês": "indicativePresentThirdPersonPlural" }
},
"2": {
"title": "Pretérito Perfeito",
"1": { "eu": "indicativePastPerfectFirstPersonSingular" },
"2": { "tu": "indicativePastPerfectFirstPersonPlural" },
"3": { "ele/ela/você": "indicativePastPerfectSecondPersonSingular" },
"4": { "nós": "indicativePastPerfectSecondPersonPlural" },
"5": { "vós": "indicativePastPerfectThirdPersonSingular" },
"6": { "eles/elas/vocês": "indicativePastPerfectThirdPersonPlural" }
},
"3": {
"title": "Pretérito Imperfeito",
"1": { "eu": "indicativePastImperfectFirstPersonSingular" },
"2": { "tu": "indicativePastImperfectFirstPersonPlural" },
"3": { "ele/ela/você": "indicativePastImperfectSecondPersonSingular" },
"4": { "nós": "indicativePastImperfectSecondPersonPlural" },
"5": { "vós": "indicativePastImperfectThirdPersonSingular" },
"6": { "eles/elas/vocês": "indicativePastImperfectThirdPersonPlural" }
},
"4": {
"title": "Futuro Simples",
"1": { "eu": "indicativePluperfectFirstPersonSingular" },
"2": { "tu": "indicativePluperfectFirstPersonPlural" },
"3": { "ele/ela/você": "indicativePluperfectSecondPersonSingular" },
"4": { "nós": "indicativePluperfectSecondPersonPlural" },
"5": { "vós": "indicativePluperfectThirdPersonSingular" },
"6": { "eles/elas/vocês": "indicativePluperfectThirdPersonPlural" }
}
}
}
28 changes: 28 additions & 0 deletions src/scribe_data/wikidata/data-contracts/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"numbers": { "nominativeSingular": "nominativePlural" },
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Настоящее",
"1": { "я": "indicativePresentFirstPersonSingular" },
"2": { "ты": "indicativePresentFirstPersonPlural" },
"3": { "он/она/оно": "indicativePresentSecondPersonSingular" },
"4": { "мы": "indicativePresentSecondPersonPlural" },
"5": { "вы": "indicativePresentThirdPersonSingular" },
"6": { "они": "indicativePresentThirdPersonPlural" }
},
"2": {
"title": "Прошедшее",
"1": { "я/ты/она": "feminineIndicativePast" },
"2": { "я/ты/он": "masculineIndicativePast" },
"3": { "оно": "neuterIndicativePast" },
"4": { "мы/вы/они": "indicativePastPlural" }
}
}
}
29 changes: 29 additions & 0 deletions src/scribe_data/wikidata/data-contracts/sv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"numbers": {
"nominativeIndefiniteSingular": "nominativeIndefinitePlural",
"nominativeDefiniteSingular": "nominativeDefinitePlural"
},
"genders": {
"canonical": ["gender"],
"feminines": [],
"masculines": [],
"commons": [],
"neuters": []
},
"conjugations": {
"1": {
"title": "Aktiv",
"1": { "": "activeInfinitive" },
"2": { "": "activePresent" },
"3": { "": "activePreterite" },
"4": { "": "activeSupine" }
},
"2": {
"title": "Passiv",
"1": { "": "passiveInfinitive" },
"2": { "": "passivePresent" },
"3": { "": "passivePreterite" },
"4": { "": "passiveSupine" }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# tool: scribe-data
# All German (Q188) nouns (Q1084) and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?nominativeSingular

WHERE {
?lexeme dct:language wd:Q188 ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?nominativeSingular .
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?nominativeSingular
?nominativePlural
?gender

WHERE {
?lexeme dct:language wd:Q188 ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?nominativeSingular .
wikibase:lexicalCategory wd:Q1084 .

# MARK: Nominative Plural

Expand All @@ -20,15 +17,4 @@ WHERE {
?nominativePluralForm ontolex:representation ?nominativePlural ;
wikibase:grammaticalFeature wd:Q131105, wd:Q146786 .
}

# MARK: Gender(s)

OPTIONAL {
?lexeme wdt:P5185 ?nounGender .
}

SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
?nounGender rdfs:label ?gender .
}
}
Loading

0 comments on commit 9efac94

Please sign in to comment.