-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #565 from xxyzz/de
Fix exceptions/warnings and translate some raw tags in de edition
- Loading branch information
Showing
8 changed files
with
213 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
from .models import WordEntry | ||
|
||
# https://de.wiktionary.org/wiki/Vorlage:K | ||
K_TEMPLATE_TAGS = { | ||
"Abl.": "ablative", | ||
"Ablativ": "ablative", | ||
"abw.": "derogatory", | ||
"AE": "US", | ||
"AmE": "US", | ||
"adv.": "adverbial", | ||
"Akkusativ": "accusative", | ||
"alemann.": "Alemannic", | ||
"alemannisch": "Alemannic", | ||
"allg.": "general", | ||
"allgemein": "general", | ||
"alltagsspr.": "colloquial", | ||
"amtsspr.": "officialese", | ||
# "ansonsten": "otherwise", # combined with other text | ||
"attr.": "attributive", | ||
# "auch": "also", | ||
"bair.": "Bavarian", | ||
"bairisch": "Bavarian", | ||
"bar.": "Bavarian", | ||
"BE": "British", | ||
"BrE": "British", | ||
"Bedva.": "outdated", | ||
"Bedvatd.": "outdated", | ||
# "bei": "", | ||
# "bes.": "especially", | ||
# "besonders": "especially", | ||
# "beziehungsweise": "", | ||
# "bzw.": "", | ||
# "bildungsspr.": "", | ||
# "bis": "", | ||
# "bisweilen": "", | ||
# "das": "", | ||
"Dativ": "dative", | ||
# "DDR": "", | ||
# "der": "", | ||
"dichter.": "poetic", | ||
# "die": "", | ||
"Dim.": "diminutive", | ||
"Dimin.": "diminutive", | ||
"Diminutiv": "diminutive", | ||
# "eher": "", | ||
"erzg.": "Erzgebirgisch", | ||
"erzgeb.": "Erzgebirgisch", | ||
"erzgebirgisch": "Erzgebirgisch", | ||
"euph.": "euphemistic", | ||
"fachspr.": "jargon", | ||
"fam.": "familiär", | ||
"fig": "figurative", | ||
"fig.": "figurative", | ||
# "früher": "", | ||
# "gegenwartslateinisch": "", | ||
"geh.": "gehoben", | ||
"Genitiv": "genitive", | ||
"gsm": "Swiss German", | ||
"häufig": "often", | ||
"haben": "auxiliary", | ||
"hebben": "auxiliary", | ||
"hauptsächlich": "primarily", | ||
"hist.": "historical", | ||
"ieS": "narrowly", | ||
"i.e.S.": "narrowly", | ||
"i. e. S.": "narrowly", | ||
# "im": "", | ||
# "in": "", | ||
# "in Bezug auf": "relational", | ||
"indekl.": "indeclinable", | ||
# "insbes.": "", | ||
"Instrumental": "instrumental", | ||
"intrans.": "intransitive", | ||
"intransitiv": "intransitive", | ||
# "iPl": "in plural", | ||
"iron.": "ironic", | ||
# "iwS": "", | ||
# "jugendspr.": "", | ||
"kinderspr.": "childish", | ||
"kirchenlateinisch": "Church Latin", | ||
"klasslat.": "Classical Latin", | ||
"klassischlateinisch": "Classical Latin", | ||
"kPl.": "no-plural", | ||
"kSg.": "no-singulative", | ||
"kSt.": "no-comparative", | ||
"landsch.": "regional", | ||
"lautm.": "onomatopoeic", | ||
"Ling.": "linguistics", | ||
"mA": "accusative", | ||
"md.": "Central German", | ||
"mdal.": "dialectal", | ||
"Med.": "medicine", # topic | ||
# "meist": "mostly", | ||
# "meistens": "mostly", | ||
"metaphor.": "metaphoric", | ||
"meton.": "metonymically", | ||
"mG": "genitive", | ||
"mitteld.": "Central German", | ||
# "mitunter": "", | ||
"mlat.": "Medieval Latin", | ||
"mittellateinisch": "Medieval Latin", | ||
"mundartl.": "dialectal", | ||
"nDu.": "only-dual", | ||
"nigr.": "Niger", | ||
"nigrisch": "Niger", | ||
"nkLat.": "post-Classical Latin", | ||
"nachklassischlateinisch": "post-Classical Latin", | ||
"nlat.": "New Latin", | ||
"neulateinisch": "New Latin", | ||
"nordd.": "North German", | ||
"norddeutsch": "North German", | ||
"nordwestd.": "Northwestern Germany", | ||
"nPl.": "plural-only", | ||
"Österreich": "Austrian German", | ||
"österr.": "Austrian German", | ||
"österreichisch": "Austrian German", | ||
"ostfränkisch": "East Franconian German", | ||
"pej.": "pejorative", | ||
"poet.": "poetic", | ||
} | ||
|
||
|
||
def translate_raw_tags(data: WordEntry) -> None: | ||
raw_tags = [] | ||
for raw_tag in data.raw_tags: | ||
if raw_tag in K_TEMPLATE_TAGS: | ||
data.tags.append(K_TEMPLATE_TAGS[raw_tag]) | ||
else: | ||
raw_tags.append(raw_tag) | ||
data.raw_tags = raw_tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.