Пример #1
0
        public Dictionary <string, string> ExportSettings(bool suppressWarnings)
        {
            Dictionary <string, string> SettingsDict = new Dictionary <string, string>();

            SettingsDict.Add("SelectedEncoding", SelectedEncoding);
            SettingsDict.Add("IncomingTextLocation", IncomingTextLocation);
            SettingsDict.Add("OutputLocation", OutputLocation);
            SettingsDict.Add("VocabSize", VocabSize.ToString());
            SettingsDict.Add("VectorSize", VectorSize.ToString());
            SettingsDict.Add("CosineCutoff", CosineCutoff.ToString());

            int WordListLength = 0;

            if (WordList != null)
            {
                WordListLength = WordList.Length;
            }

            SettingsDict.Add("WordListLength", WordListLength.ToString());

            for (int i = 0; i < WordListLength; i++)
            {
                SettingsDict.Add("WordList" + i.ToString(), WordList[i]);
            }

            return(SettingsDict);
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("VocabSizeId,Age,Vocabulary")] VocabSize vocabSize)
        {
            if (id != vocabSize.VocabSizeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vocabSize);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VocabSizeExists(vocabSize.VocabSizeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(vocabSize));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("VocabSizeId,Age,Vocabulary")] VocabSize vocabSize)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vocabSize);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(vocabSize));
        }
Пример #4
0
        public Dictionary <string, string> ExportSettings(bool suppressWarnings)
        {
            Dictionary <string, string> SettingsDict = new Dictionary <string, string>();

            SettingsDict.Add("InputModelFilename", InputModelFilename);
            SettingsDict.Add("SelectedEncoding", SelectedEncoding);
            SettingsDict.Add("VocabSize", VocabSize.ToString());
            SettingsDict.Add("VectorSize", VectorSize.ToString());

            return(SettingsDict);
        }