-
Notifications
You must be signed in to change notification settings - Fork 12
Description
When trying to run the generator with the parameter set to generate non-grammatic phrases, I'm running into a KeyNotFoundException error, even using the precompiled PassPhraseGenerator console application. I'm including the command-line execution below, what am I doing wrong?
The error is thrown in the ChooseWord static method of the DictionaryExtensions class on this line:
var count = dict.CountOf()
which appears to be because Word is not in the WordsByType Dictionary:
Example run showing command line and error:
C:\GitSource\PassphraseConsole>passphrasegenerator n 4
Readable Passphrase Generator 1.4.0
Generating 10 non-grammatic phrase(s) of length '4'...
Must be between 1 and 999 characters.
Dictionary contains 18,505 words (loaded in 54.04ms)
Average combinations ~5.423E+018 (~62.23 bits)
Total combinations 5.423E+018 - 5.423E+018 (62.23 - 62.23 bits)
Using no mutators
System.Collections.Generic.KeyNotFoundException: The given key 'MurrayGrant.ReadablePassphrase.Words.Word' was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at MurrayGrant.ReadablePassphrase.Dictionaries.WordDictionary.CountOf[T]() in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Words\Dictionaries\WordDictionary.cs:line 79 at MurrayGrant.ReadablePassphrase.Dictionaries.DictionaryExtensions.ChooseWord[T](WordDictionary dict, RandomSourceBase randomness, IEnumerable1 alreadyChosen, Func2 wordPredicate) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Core\Dictionaries\DictionaryExtensions.cs:line 32 at MurrayGrant.ReadablePassphrase.WordTemplate.AnyTemplate.ChooseWord(WordDictionary words, RandomSourceBase randomness, IEnumerable1 alreadyChosen) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Core\WordTemplate\AnyTemplate.cs:line 37
at MurrayGrant.ReadablePassphrase.ReadablePassphraseGenerator.TemplateToWords(IEnumerable1 template, GenerateTarget target, String wordDelimiter) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Core\ReadablePassphraseGenerator.cs:line 609 at MurrayGrant.ReadablePassphrase.ReadablePassphraseGenerator.GenerateInternal(IEnumerable1 phraseDescription, String wordDelimiter, GenerateTarget result) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Core\ReadablePassphraseGenerator.cs:line 555
at MurrayGrant.ReadablePassphrase.ReadablePassphraseGenerator.Generate(IEnumerable1 phraseDescription, String wordDelimiter, IEnumerable1 mutators) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\ReadablePassphrase.Core\ReadablePassphraseGenerator.cs:line 405
at MurrayGrant.ReadablePassphrase.Generator.Program.RunMain() in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\PassphraseGenerator\Program.cs:line 195
at MurrayGrant.ReadablePassphrase.Generator.Program.Main(String[] args) in C:\Users\msn\OneDrive\source\ReadablePassphrase.git\trunk\PassphraseGenerator\Program.cs:line 68
