QubitPi commited on
Commit
0a8078a
·
unverified ·
1 Parent(s): 4ccd21b

Remove declension type attribute for German noun (#134)

Browse files
Files changed (3) hide show
  1. README.md +0 -4
  2. german.yaml +1 -21
  3. huggingface/german_parser.py +1 -13
README.md CHANGED
@@ -372,7 +372,6 @@ declension table of the following template:
372
  - term:
373
  definition:
374
  audio:
375
- declension-type: weak/strong/mixed
376
  declension:
377
  - ["", singular, plural]
378
  - [nominative, ████████, ██████]
@@ -387,7 +386,6 @@ For example:
387
  - term: das Gespräch
388
  definition: the conversation
389
  audio: https://upload.wikimedia.org/wikipedia/commons/f/f5/De-Gespr%C3%A4ch.ogg
390
- declension-type: strong
391
  declension:
392
  - ["", singular, plural ]
393
  - [nominative, Gespräch, Gespräche ]
@@ -396,8 +394,6 @@ For example:
396
  - [accusative, Gespräch, Gespräche ]
397
  ```
398
 
399
- Note that [feminine nouns do not have `declension-type` field](https://en.wikipedia.org/wiki/Weak_noun#German)
400
-
401
  > [!TIP]
402
  >
403
  > __The declension tables for nouns are almost all sourced from
 
372
  - term:
373
  definition:
374
  audio:
 
375
  declension:
376
  - ["", singular, plural]
377
  - [nominative, ████████, ██████]
 
386
  - term: das Gespräch
387
  definition: the conversation
388
  audio: https://upload.wikimedia.org/wikipedia/commons/f/f5/De-Gespr%C3%A4ch.ogg
 
389
  declension:
390
  - ["", singular, plural ]
391
  - [nominative, Gespräch, Gespräche ]
 
394
  - [accusative, Gespräch, Gespräche ]
395
  ```
396
 
 
 
397
  > [!TIP]
398
  >
399
  > __The declension tables for nouns are almost all sourced from
german.yaml CHANGED
@@ -144,7 +144,6 @@ vocabulary:
144
  - term: das Zehntel
145
  definition: the 10th
146
  audio: https://upload.wikimedia.org/wikipedia/commons/b/bd/De-Zehntel.ogg
147
- declension-type: strong
148
  declension:
149
  - ["", singular, plural ]
150
  - [nominative, Zehntel, Zehntel ]
@@ -242,7 +241,6 @@ vocabulary:
242
  - term: das Buch
243
  definition: the book
244
  audio: https://upload.wikimedia.org/wikipedia/commons/2/28/De-Buch2.ogg
245
- declension-type: strong
246
  declension:
247
  - ["", singular, plural ]
248
  - [nominative, Buch, Bücher ]
@@ -3927,7 +3925,6 @@ vocabulary:
3927
  - term: das Gespräch
3928
  definition: the conversation
3929
  audio: https://upload.wikimedia.org/wikipedia/commons/f/f5/De-Gespr%C3%A4ch.ogg
3930
- declension-type: strong
3931
  declension:
3932
  - ["", singular, plural ]
3933
  - [nominative, Gespräch, Gespräche ]
@@ -4108,7 +4105,6 @@ vocabulary:
4108
  - term: der Wecker
4109
  definition: the alarm clock
4110
  audio: https://upload.wikimedia.org/wikipedia/commons/4/4b/LL-Q188_%28deu%29-Sebastian_Wallroth-Wecker.wav
4111
- declension-type: strong
4112
  declension:
4113
  - ["", singular, plural ]
4114
  - [nominative, Wecker, Wecker ]
@@ -4138,7 +4134,6 @@ vocabulary:
4138
  - term: der Hausrat
4139
  definition: the household goods
4140
  audio: https://upload.wikimedia.org/wikipedia/commons/a/a7/De-Hausrat.ogg
4141
- declension-type: strong
4142
  declension:
4143
  - ["", singular, plural]
4144
  - [nominative, Hausrat, N/A ]
@@ -4150,7 +4145,6 @@ vocabulary:
4150
  - the jewelry
4151
  - the decoration
4152
  audio: https://upload.wikimedia.org/wikipedia/commons/6/69/De-Schmuck.ogg
4153
- declension-type: strong
4154
  declension:
4155
  - ["", singular, plural ]
4156
  - [nominative, Schmuck, Schmucke ]
@@ -4160,7 +4154,6 @@ vocabulary:
4160
  - term: das Möbel
4161
  definition: the furniture
4162
  audio: https://upload.wikimedia.org/wikipedia/commons/7/77/De-M%C3%B6bel.ogg
4163
- declension-type: strong
4164
  declension:
4165
  - ["", singular, plural]
4166
  - [nominative, Möbel, Möbel ]
@@ -4182,7 +4175,6 @@ vocabulary:
4182
  - term: der Pulli
4183
  definition: the sweater
4184
  audio: https://upload.wikimedia.org/wikipedia/commons/2/2a/De-Pulli.ogg
4185
- declension-type: strong
4186
  declension:
4187
  - ["", singular, plural]
4188
  - [nominative, Pulli, Pullis]
@@ -4192,7 +4184,6 @@ vocabulary:
4192
  - term: der Schuh
4193
  definition: the shoe
4194
  audio: https://upload.wikimedia.org/wikipedia/commons/c/c6/De-Schuh2.ogghttps://upload.wikimedia.org/wikipedia/commons/c/c6/De-Schuh2.ogg
4195
- declension-type: strong
4196
  declension:
4197
  - ["", singular, plural ]
4198
  - [nominative, Schuh, "Schuhe, Schuh" ]
@@ -4202,7 +4193,6 @@ vocabulary:
4202
  - term: der Tiergarten
4203
  definition: the zoo
4204
  audio: https://upload.wikimedia.org/wikipedia/commons/9/91/De-Tiergarten.ogg
4205
- declension-type: strong
4206
  declension:
4207
  - ["", singular, plural ]
4208
  - [nominative, Tiergarten, Tiergärten]
@@ -4527,7 +4517,6 @@ vocabulary:
4527
  - term: der Offizier
4528
  definition: (military) commissioned officer
4529
  audio: https://upload.wikimedia.org/wikipedia/commons/6/6f/De-Offizier.ogg
4530
- declension-type: strong
4531
  declension:
4532
  - ["", singular, plural ]
4533
  - [nominative, Offizier, Offiziere ]
@@ -4777,7 +4766,6 @@ vocabulary:
4777
  - term: der Schwächling
4778
  definition: (derogatory) the weakling
4779
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cf/De-Schw%C3%A4chling.ogg
4780
- declension-type: strong
4781
  declension:
4782
  - ["", singular, plural ]
4783
  - [nominative, Schwächling, Schwächlinge ]
@@ -5200,6 +5188,7 @@ vocabulary:
5200
  definition: to determine
5201
  - term: der Hauptmann
5202
  definition: (military) the captain
 
5203
  declension:
5204
  - ["", singular, plural ]
5205
  - [nominative, Hauptmann, "Hauptleute, Hauptmänner" ]
@@ -5318,7 +5307,6 @@ vocabulary:
5318
  - term: das Mädchen
5319
  definition: the girl
5320
  audio: https://upload.wikimedia.org/wikipedia/commons/3/3e/De-M%C3%A4dchen2.ogg
5321
- declension-type: strong
5322
  declension:
5323
  - ["", singular, plural ]
5324
  - [nominative, Mädchen, Mädchen]
@@ -5647,7 +5635,6 @@ vocabulary:
5647
  - term: der Befehl
5648
  definition: the command
5649
  audio: https://upload.wikimedia.org/wikipedia/commons/a/ac/De-Befehl.ogg
5650
- declension-type: strong
5651
  declension:
5652
  - ["", singular, plural ]
5653
  - [nominative, Befehl, Befehle ]
@@ -5989,7 +5976,6 @@ vocabulary:
5989
  - term: der Partisan
5990
  definition: the partisan
5991
  audio: https://upload.wikimedia.org/wikipedia/commons/8/81/De-Partisan.ogg
5992
- declension-type: weak
5993
  declension:
5994
  - ["", singular, plural ]
5995
  - [nominative, Partisan, Partisanen]
@@ -6026,7 +6012,6 @@ vocabulary:
6026
  - forest
6027
  - woods
6028
  audio: https://upload.wikimedia.org/wikipedia/commons/3/30/De-Wald2.ogg
6029
- declension-type: strong
6030
  declension:
6031
  - ["", singular, plural ]
6032
  - [nominative, Wald, Wälder ]
@@ -6060,7 +6045,6 @@ vocabulary:
6060
  - term: der Sturmbannführer
6061
  definition: (military rank of the Nazi SA, SS and NSFK) major
6062
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cc/De-Sturmbannf%C3%BChrer.ogg
6063
- declension-type: strong
6064
  declension:
6065
  - ["", singular, plural ]
6066
  - [nominative, Sturmbannführer, Sturmbannführer ]
@@ -6142,7 +6126,6 @@ vocabulary:
6142
  - term: das Auge
6143
  definition: the eye
6144
  audio: https://upload.wikimedia.org/wikipedia/commons/9/9a/De-Auge2.ogg
6145
- declension-type: mixed
6146
  declension:
6147
  - ["", singular, plural]
6148
  - [nominative, Auge, Augen ]
@@ -6169,7 +6152,6 @@ vocabulary:
6169
  - term: der Umstand
6170
  definition: the circumstance
6171
  audio: https://upload.wikimedia.org/wikipedia/commons/a/a2/De-Umstand.ogg
6172
- declension-type: strong
6173
  declension:
6174
  - ["", singular, plural ]
6175
  - [nominative, Umstand, Umstände ]
@@ -6289,7 +6271,6 @@ vocabulary:
6289
  - the people
6290
  - the race
6291
  audio: https://upload.wikimedia.org/wikipedia/commons/b/bf/De-Volk.ogg
6292
- declension-type: strong
6293
  declension:
6294
  - ["", singular, plural ]
6295
  - [nominative, Volk, Völker ]
@@ -6975,7 +6956,6 @@ vocabulary:
6975
  - characteristic
6976
  - attribute
6977
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cf/De-Merkmal.ogg
6978
- declension-type: strong
6979
  declension:
6980
  - ["", singular, plural ]
6981
  - [nominative, Merkmal, Merkmale ]
 
144
  - term: das Zehntel
145
  definition: the 10th
146
  audio: https://upload.wikimedia.org/wikipedia/commons/b/bd/De-Zehntel.ogg
 
147
  declension:
148
  - ["", singular, plural ]
149
  - [nominative, Zehntel, Zehntel ]
 
241
  - term: das Buch
242
  definition: the book
243
  audio: https://upload.wikimedia.org/wikipedia/commons/2/28/De-Buch2.ogg
 
244
  declension:
245
  - ["", singular, plural ]
246
  - [nominative, Buch, Bücher ]
 
3925
  - term: das Gespräch
3926
  definition: the conversation
3927
  audio: https://upload.wikimedia.org/wikipedia/commons/f/f5/De-Gespr%C3%A4ch.ogg
 
3928
  declension:
3929
  - ["", singular, plural ]
3930
  - [nominative, Gespräch, Gespräche ]
 
4105
  - term: der Wecker
4106
  definition: the alarm clock
4107
  audio: https://upload.wikimedia.org/wikipedia/commons/4/4b/LL-Q188_%28deu%29-Sebastian_Wallroth-Wecker.wav
 
4108
  declension:
4109
  - ["", singular, plural ]
4110
  - [nominative, Wecker, Wecker ]
 
4134
  - term: der Hausrat
4135
  definition: the household goods
4136
  audio: https://upload.wikimedia.org/wikipedia/commons/a/a7/De-Hausrat.ogg
 
4137
  declension:
4138
  - ["", singular, plural]
4139
  - [nominative, Hausrat, N/A ]
 
4145
  - the jewelry
4146
  - the decoration
4147
  audio: https://upload.wikimedia.org/wikipedia/commons/6/69/De-Schmuck.ogg
 
4148
  declension:
4149
  - ["", singular, plural ]
4150
  - [nominative, Schmuck, Schmucke ]
 
4154
  - term: das Möbel
4155
  definition: the furniture
4156
  audio: https://upload.wikimedia.org/wikipedia/commons/7/77/De-M%C3%B6bel.ogg
 
4157
  declension:
4158
  - ["", singular, plural]
4159
  - [nominative, Möbel, Möbel ]
 
4175
  - term: der Pulli
4176
  definition: the sweater
4177
  audio: https://upload.wikimedia.org/wikipedia/commons/2/2a/De-Pulli.ogg
 
4178
  declension:
4179
  - ["", singular, plural]
4180
  - [nominative, Pulli, Pullis]
 
4184
  - term: der Schuh
4185
  definition: the shoe
4186
  audio: https://upload.wikimedia.org/wikipedia/commons/c/c6/De-Schuh2.ogghttps://upload.wikimedia.org/wikipedia/commons/c/c6/De-Schuh2.ogg
 
4187
  declension:
4188
  - ["", singular, plural ]
4189
  - [nominative, Schuh, "Schuhe, Schuh" ]
 
4193
  - term: der Tiergarten
4194
  definition: the zoo
4195
  audio: https://upload.wikimedia.org/wikipedia/commons/9/91/De-Tiergarten.ogg
 
4196
  declension:
4197
  - ["", singular, plural ]
4198
  - [nominative, Tiergarten, Tiergärten]
 
4517
  - term: der Offizier
4518
  definition: (military) commissioned officer
4519
  audio: https://upload.wikimedia.org/wikipedia/commons/6/6f/De-Offizier.ogg
 
4520
  declension:
4521
  - ["", singular, plural ]
4522
  - [nominative, Offizier, Offiziere ]
 
4766
  - term: der Schwächling
4767
  definition: (derogatory) the weakling
4768
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cf/De-Schw%C3%A4chling.ogg
 
4769
  declension:
4770
  - ["", singular, plural ]
4771
  - [nominative, Schwächling, Schwächlinge ]
 
5188
  definition: to determine
5189
  - term: der Hauptmann
5190
  definition: (military) the captain
5191
+ audio: https://upload.wikimedia.org/wikipedia/commons/8/85/De-Hauptmann.ogg
5192
  declension:
5193
  - ["", singular, plural ]
5194
  - [nominative, Hauptmann, "Hauptleute, Hauptmänner" ]
 
5307
  - term: das Mädchen
5308
  definition: the girl
5309
  audio: https://upload.wikimedia.org/wikipedia/commons/3/3e/De-M%C3%A4dchen2.ogg
 
5310
  declension:
5311
  - ["", singular, plural ]
5312
  - [nominative, Mädchen, Mädchen]
 
5635
  - term: der Befehl
5636
  definition: the command
5637
  audio: https://upload.wikimedia.org/wikipedia/commons/a/ac/De-Befehl.ogg
 
5638
  declension:
5639
  - ["", singular, plural ]
5640
  - [nominative, Befehl, Befehle ]
 
5976
  - term: der Partisan
5977
  definition: the partisan
5978
  audio: https://upload.wikimedia.org/wikipedia/commons/8/81/De-Partisan.ogg
 
5979
  declension:
5980
  - ["", singular, plural ]
5981
  - [nominative, Partisan, Partisanen]
 
6012
  - forest
6013
  - woods
6014
  audio: https://upload.wikimedia.org/wikipedia/commons/3/30/De-Wald2.ogg
 
6015
  declension:
6016
  - ["", singular, plural ]
6017
  - [nominative, Wald, Wälder ]
 
6045
  - term: der Sturmbannführer
6046
  definition: (military rank of the Nazi SA, SS and NSFK) major
6047
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cc/De-Sturmbannf%C3%BChrer.ogg
 
6048
  declension:
6049
  - ["", singular, plural ]
6050
  - [nominative, Sturmbannführer, Sturmbannführer ]
 
6126
  - term: das Auge
6127
  definition: the eye
6128
  audio: https://upload.wikimedia.org/wikipedia/commons/9/9a/De-Auge2.ogg
 
6129
  declension:
6130
  - ["", singular, plural]
6131
  - [nominative, Auge, Augen ]
 
6152
  - term: der Umstand
6153
  definition: the circumstance
6154
  audio: https://upload.wikimedia.org/wikipedia/commons/a/a2/De-Umstand.ogg
 
6155
  declension:
6156
  - ["", singular, plural ]
6157
  - [nominative, Umstand, Umstände ]
 
6271
  - the people
6272
  - the race
6273
  audio: https://upload.wikimedia.org/wikipedia/commons/b/bf/De-Volk.ogg
 
6274
  declension:
6275
  - ["", singular, plural ]
6276
  - [nominative, Volk, Völker ]
 
6956
  - characteristic
6957
  - attribute
6958
  audio: https://upload.wikimedia.org/wikipedia/commons/c/cf/De-Merkmal.ogg
 
6959
  declension:
6960
  - ["", singular, plural ]
6961
  - [nominative, Merkmal, Merkmale ]
huggingface/german_parser.py CHANGED
@@ -109,16 +109,4 @@ def get_declension_attributes(word: object) -> dict[str, str]:
109
  for j, col in enumerate(row):
110
  declension_attributes[f"{declension_type}-{i}-{j}"] = declension_table[i][j]
111
 
112
- return get_declension_type_attributes(word) | declension_attributes
113
-
114
-
115
- def get_declension_type_attributes(word: object) -> dict[str, str]:
116
- """
117
- Returns the declension type of delinable word as a single-entry dictionary if the word has a "declension-type"
118
- field, otherwise an empty dictionary is returned.
119
-
120
- :param word: A vocabulary represented in YAML dictionary
121
-
122
- :return: a single-entry map if "declension-type" key is presented in the word or an empty dictionary otherwise
123
- """
124
- return {"declension type": word["declension-type"]} if "declension-type" in word else {}
 
109
  for j, col in enumerate(row):
110
  declension_attributes[f"{declension_type}-{i}-{j}"] = declension_table[i][j]
111
 
112
+ return declension_attributes