Compare commits

...

2 Commits

Author SHA1 Message Date
b9d861a8fa fix destination path for dictionary 2022-01-30 21:58:10 -08:00
b446288ad2 it was bugging me, ok 2022-01-10 11:29:19 -08:00
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ task(dictionary, "Generate dictionary from BNC XML files"):
echo output.strip().splitlines()[^1] echo output.strip().splitlines()[^1]
task(pack, "Pack dictionary into fixed-width file and compress"): task(pack, "Compress dictionary file"):
echo "Packing dictionary" echo "Packing dictionary"
echo runCmd("nim c --run src/dictionary.nim data/dictionary.txt data/dictionary.pack") echo runCmd("nim c --run src/dictionary.nim data/dictionary.txt data/dictionary.pack")

View File

@ -48,7 +48,7 @@ proc loadWords*(path: string): Dictionary =
continue continue
result.words.add(word) result.words.add(word)
for _ in 0..<(25 - word.len): for _ in 0 ..< (25 - word.len):
result.words.add(' ') result.words.add(' ')

View File

@ -67,7 +67,7 @@ iterator iterWords*(filename: string): string =
when isMainModule: when isMainModule:
let path = r"C:\Users\Joe\Documents\Code\words\BNC\2554\download\Texts\A\A0\A00.xml" let path = r"C:\Users\Joe\Documents\Code\passphrase\data\BNC\2554\download\Texts\A\A0\A00.xml"
var count = 0 var count = 0
for word in iterWords(path): for word in iterWords(path):
inc count inc count