Ejemplo n.º 1
0
        public PassphraseController(Dictionary <string, string> dictionaries)
        {
            this.dictionary      = new DictionaryController(dictionaries);
            this.generator       = new PseudoSentenceController(this.dictionary);
            this.sentenceBuilder = new WordsController(dictionaries);

            this.rnd = new Random();
        }
        public PseudoSentenceController(DictionaryController dictonaries)
        {
            this.dictonaries = dictonaries;
            this.root        = new SentenceMember("sentence", "singular", true, new SentenceMember("nouns", "singular", false, null, null, null),
                                                  new SentenceMember("verbs", "singular", false, null, null, null),
                                                  new SentenceMember("nouns", "singular", false, null, null, null)
                                                  );

            Generated_bits = ((DictionaryController.Element) this.dictonaries.GetType().GetField("nouns").GetValue(dictonaries)).size_bits
                             + ((DictionaryController.Element) this.dictonaries.GetType().GetField("verbs").GetValue(dictonaries)).size_bits
                             + ((DictionaryController.Element) this.dictonaries.GetType().GetField("nouns").GetValue(dictonaries)).size_bits;
            Generated_words = 3;
        }