3 ms·
Let's not store the whole file in memory at once!
by lurker14 14y ago
Let's not store the whole file in memory at once!
- Lexarius 14y agoOk. import dawg with open('/usr/share/dict/words','r') as words: d = dawg.DAWG(w.strip() for w in words)
- kmike84 14y agoI think the point of using data structures like DAWG is to reduce the memory consumption to the point it is feasable to store the whole dataset in memory. Practical DAWG application would be the following anyway: import dawg d = dawg.DAWG().load('words.dawg') because DAWG minimization may require a lot of memory.