private void GetFilteredWords(string category) { CategoryFilter = category; FilteredWords = AllWords.Where(x => x.Category == CategoryFilter).ToList(); IsCatListVisible = false; IsFilteredWordsVisible = true; }
/// <summary> /// Refresh all the words /// </summary> private async void RefreshWords() { IEnumerable <string> words = await Task.Run(async() => { return(await ThesaurusAPIHelper.GetWordsAsync()); }); AllWords.Clear(); AllWords.AddRange(words); }
public override async void OnNavigatedTo(INavigationParameters parameters) { IsCatButtonEnabled = false; AllWords = await _databaseService.GetAllWords(); if (IsFilteredWordsVisible) { FilteredWords = AllWords.Where(x => x.Category == CategoryFilter).ToList(); } IsCatButtonEnabled = true; }
static void Main() { AllWords.GetInstance(); var lines = File.ReadAllText($@"{_directory}\ccImport.txt"); var useNewCode = true; var solvedPuzzle = (useNewCode ? new PuzzleSolver(PuzzleImporter.ConvertOldToNew(lines)) : new PuzzleSolver(lines)).SolveCodeCracker(); solvedPuzzle.CreateHtmlResults(_directory); solvedPuzzle.CreateTextFileResults(_directory); }
internal DeJargonizerResult( IEnumerable <string> allWords, IEnumerable <string> commonWords, IEnumerable <string> normalWords, IEnumerable <string> rareWords) { CommonWords = commonWords.ToList(); NormalWords = normalWords.ToList(); RareWords = rareWords.ToList(); AllWords = allWords.ToList(); CommonWordsPercentage = CommonWords.Count / (double)AllWords.Count; NormalWordsPercentage = NormalWords.Count / (double)AllWords.Count; RareWordsPercentage = RareWords.Count / (double)AllWords.Count; Score = !AllWords.Any() ? 0 : (int)Math.Round(100 - (NormalWords.Count * 0.5f + RareWords.Count) * 100 / AllWords.Count); }
public void Add(Word word) { short ix = (short)AllWords.FindIndex(x => x.Text == word.Text); _chain.Add(ix); }
/// <summary> /// Method to check if the word exists in our wordslist /// </summary> /// <param name="word"></param> /// <returns>bool</returns> public bool Exists(string word) { return(AllWords.Contains(word)); }
public static bool existsInDB(string word) { var exists = AllWords.Contains(word); return(exists); }
public Startup(IConfiguration configuration) { AllWords.GetInstance(); Configuration = configuration; }