mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
don't crash dumping empty wordlists
This commit is contained in:
parent
f35136099d
commit
2204d951a7
1 changed files with 4 additions and 3 deletions
|
@ -220,15 +220,16 @@ def process(args):
|
|||
|
||||
nodes = loadNodes( dawg, nodeSize )
|
||||
words = []
|
||||
expandDAWG( nodes, nodeSize, offset, data, words )
|
||||
assert len(words) == nWords
|
||||
if nodes:
|
||||
expandDAWG( nodes, nodeSize, offset, data, words )
|
||||
assert len(words) == nWords
|
||||
if args.DUMP_WORDS:
|
||||
for word in words:
|
||||
print(word)
|
||||
|
||||
def mkParser():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--dict', dest = 'DAWG', type = str, required = True,
|
||||
parser.add_argument('--dawg', dest = 'DAWG', type = str, required = True,
|
||||
help = 'the .xwd file to load')
|
||||
parser.add_argument('--dump-words', dest = 'DUMP_WORDS', default = False,
|
||||
action = 'store_true', help = 'write wordlist to stdout')
|
||||
|
|
Loading…
Reference in a new issue