mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +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 )
|
nodes = loadNodes( dawg, nodeSize )
|
||||||
words = []
|
words = []
|
||||||
expandDAWG( nodes, nodeSize, offset, data, words )
|
if nodes:
|
||||||
assert len(words) == nWords
|
expandDAWG( nodes, nodeSize, offset, data, words )
|
||||||
|
assert len(words) == nWords
|
||||||
if args.DUMP_WORDS:
|
if args.DUMP_WORDS:
|
||||||
for word in words:
|
for word in words:
|
||||||
print(word)
|
print(word)
|
||||||
|
|
||||||
def mkParser():
|
def mkParser():
|
||||||
parser = argparse.ArgumentParser()
|
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')
|
help = 'the .xwd file to load')
|
||||||
parser.add_argument('--dump-words', dest = 'DUMP_WORDS', default = False,
|
parser.add_argument('--dump-words', dest = 'DUMP_WORDS', default = False,
|
||||||
action = 'store_true', help = 'write wordlist to stdout')
|
action = 'store_true', help = 'write wordlist to stdout')
|
||||||
|
|
Loading…
Add table
Reference in a new issue