Exemple #1
0
        private bool CheckFilters(WordFilters filters, WordData data)
        {
            if (filters.allowedCategories != null && !filters.allowedCategories.Contains(data.Category))
            {
                return(false);
            }

            if (filters.excludeArticles && data.Article != WordDataArticle.None)
            {
                return(false);
            }
            if (filters.requireDrawings && !data.HasDrawing())
            {
                return(false);
            }
            if (filters.excludeColorWords && data.Category == WordDataCategory.Colors)
            {
                return(false);
            }
            if (filters.excludePluralDual && data.Form != WordDataForm.Singular)
            {
                return(false);
            }
            if (filters.excludeDiacritics && WordHasDiacriticCombo(data))
            {
                return(false);
            }
            if (filters.excludeLetterVariations && WordHasLetterVariations(data))
            {
                return(false);
            }
            if (filters.requireDiacritics && !WordHasDiacriticCombo(data))
            {
                return(false);
            }
            if (filters.excludeDipthongs && WordHasDipthongs(data))
            {
                return(false);
            }
            if (filters.excludeDuplicateLetters && WordContainsDuplicateLetters(data))
            {
                return(false);
            }
            if (filters.excludeSpaces && WordContainsLetter(data, AppManager.I.DB.GetLetterDataById(" ")))
            {
                return(false);
            }
            return(true);
        }
 private bool CheckFilters(WordFilters filters, WordData data)
 {
     if (filters.excludeArticles && data.Article != WordDataArticle.None)
     {
         return(false);
     }
     if (filters.requireDrawings && !data.HasDrawing())
     {
         return(false);
     }
     if (filters.excludeColorWords && data.Category == WordDataCategory.Color)
     {
         return(false);
     }
     if (filters.excludePluralDual && data.Form != WordDataForm.Singular)
     {
         return(false);
     }
     if (filters.excludeDiacritics && WordHasDiacriticCombo(data))
     {
         return(false);
     }
     if (filters.excludeLetterVariations && WordHasLetterVariations(data))
     {
         return(false);
     }
     if (filters.requireDiacritics && !WordHasDiacriticCombo(data))
     {
         return(false);
     }
     if (filters.excludeDipthongs && WordHasDipthongs(data))
     {
         return(false);
     }
     return(true);
 }