mirror of
https://github.com/aquatix/alfagok.git
synced 2025-12-06 21:05:10 +01:00
Only use Scrabble words when available
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import os.path
|
||||||
import random
|
import random
|
||||||
|
|
||||||
MIN_LENGTH = 4
|
MIN_LENGTH = 4
|
||||||
@@ -12,9 +13,13 @@ with open('wikiwoordenboek_basiswoorden.lst', 'r', encoding='utf-8') as wordfile
|
|||||||
wikiwoorden_words = wordfile.readlines()
|
wikiwoorden_words = wordfile.readlines()
|
||||||
print(f'wikiwoorden basic list contains {len(wikiwoorden_words)} words')
|
print(f'wikiwoorden basic list contains {len(wikiwoorden_words)} words')
|
||||||
|
|
||||||
with open('scrabblewoorden.txt', 'r', encoding='utf-8') as wordfile:
|
scrabble_words = []
|
||||||
scrabble_words = wordfile.readlines()
|
if os.path.isfile('scrabblewoorden.txt'):
|
||||||
print(f'scrabblewoorden list contains {len(scrabble_words)} words')
|
with open('scrabblewoorden.txt', 'r', encoding='utf-8') as wordfile:
|
||||||
|
scrabble_words = wordfile.readlines()
|
||||||
|
print(f'scrabblewoorden list contains {len(scrabble_words)} words')
|
||||||
|
else:
|
||||||
|
print('scrabblewoorden.txt not found, skipped')
|
||||||
|
|
||||||
with open('basiswoorden-gekeurd.txt', 'r', encoding='utf-8') as wordfile:
|
with open('basiswoorden-gekeurd.txt', 'r', encoding='utf-8') as wordfile:
|
||||||
basis_words = wordfile.readlines()
|
basis_words = wordfile.readlines()
|
||||||
|
|||||||
Reference in New Issue
Block a user