Ejemplo n.º 1
0
 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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 6
0
        public void Add(Word word)
        {
            short ix = (short)AllWords.FindIndex(x => x.Text == word.Text);

            _chain.Add(ix);
        }
Ejemplo n.º 7
0
 /// <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));
 }
Ejemplo n.º 8
0
        public static bool existsInDB(string word)
        {
            var exists = AllWords.Contains(word);

            return(exists);
        }
Ejemplo n.º 9
0
 public Startup(IConfiguration configuration)
 {
     AllWords.GetInstance();
     Configuration = configuration;
 }