Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Quelle Wörterbuch: https://sebastian-software.de/blog/2015-07/rechtschreibung-und-jekyll/
- """
- from string import ascii_uppercase
- from pathlib import Path
- def get_sum(dictionary):
- table = " " + ascii_uppercase
- with dictionary.open() as fd:
- for line in fd:
- word, _, type = line.partition("/")
- word = word.upper()
- if len(word) == 6 and all(c in ascii_uppercase for c in word):
- word_sum = sum(map(table.index, word))
- if word_sum == 66:
- yield word
- dictionary = Path.home() / "Desktop/de-DE.dic"
- words = '\n'.join(sorted(set(get_sum(dictionary))))
- print(words)
- print(len(words))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement