diff options
Diffstat (limited to 'data')
-rwxr-xr-x | data/noun-query.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/data/noun-query.sh b/data/noun-query.sh index 948bf02..c9d3224 100755 --- a/data/noun-query.sh +++ b/data/noun-query.sh @@ -12,6 +12,8 @@ sed -r -z "s/\n(\|[A-Z])/\1/g" noun-stage2 > noun-stage3 grep -e "Deutsch Substantiv Übersicht" noun-stage3 > noun-stage4 python -c """ +import re + with open('noun-stage4', 'r', encoding='utf8') as clean: cleanLines = clean.readlines() @@ -26,11 +28,12 @@ with open('nouns.csv', 'w', encoding='utf-8') as nouns: for d in dicts: try: + if not re.match(r'[A-Za-z_]', d['Nominativ Singular'][0]): + continue line = ','.join([d['Genus'], d['Nominativ Singular'], d['Nominativ Plural'], d['Akkusativ Singular'], d['Akkusativ Plural'], d['Dativ Singular'], d['Dativ Plural'], d['Genitiv Singular'], d['Genitiv Plural']]) nouns.write(line + '\n') except: pass """ - -rm noun-stage* +#rm noun-stage* |