Ejemplo n.º 1
0
        private bool CheckFilters(LetterFilters filters, LetterData data)
        {
            if (filters.requireDiacritics && !data.IsOfKindCategory(LetterKindCategory.DiacriticCombo))
            {
                return(false);
            }
            if (!FilterByDiacritics(filters.excludeDiacritics, data))
            {
                return(false);
            }
            if (!FilterByLetterVariations(filters.excludeLetterVariations, data))
            {
                return(false);
            }
            if (!FilterByDipthongs(filters.excludeDiphthongs, data))
            {
                return(false);
            }

            // always skip symbols
            if (data.IsOfKindCategory(LetterKindCategory.Symbol))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool CheckFilters(LetterFilters filters, LetterData data)
        {
            if (filters.requireDiacritics && !data.IsOfKindCategory(LetterKindCategory.DiacriticCombo))
            {
                return(false);
            }
            if (!FilterByDiacritics(filters.excludeDiacritics, data))
            {
                return(false);
            }
            if (!FilterByLetterVariations(filters.excludeLetterVariations, data))
            {
                return(false);
            }
            if (!FilterByDipthongs(filters.excludeDiphthongs, data))
            {
                return(false);
            }
            if (!FilterByKind(!filters.includeAccentedLetters, data, LetterDataKind.AccentedLetter))
            {
                return(false);
            }
            if (!FilterByKind(!filters.includeSpecialCharacters, data, LetterDataKind.SpecialChar))
            {
                return(false);
            }

            // always skip symbols
            if (data.IsOfKindCategory(LetterKindCategory.Symbol))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
        public List <LetterData> GetAllLettersAndForms(LetterFilters filters)
        {
            var baseLetters      = dbManager.FindLetterData(x => CheckFilters(filters, x));
            var lettersWithForms = ExtractLettersWithForms(baseLetters);

            return(lettersWithForms);
        }
Ejemplo n.º 4
0
        public List <LetterData> GetAllBaseLetters()
        {
            var p = new LetterFilters(excludeDiacritics: LetterFilters.ExcludeDiacritics.All,
                                      excludeLetterVariations: LetterFilters.ExcludeLetterVariations.All, excludeDiphthongs: true);

            return(GetAllLetters(p));
        }
Ejemplo n.º 5
0
 };                                                                                        // HACK: this is just for dancing dots, to be removed later on
 private bool CheckFilters(LetterFilters filters, LetterData data)
 {
     if (filters.requireDiacritics && !data.IsOfKindCategory(LetterKindCategory.DiacriticCombo))
     {
         return(false);
     }
     if (filters.excludeDiacritics && data.IsOfKindCategory(LetterKindCategory.DiacriticCombo))
     {
         return(false);
     }
     if (filters.excludeDiacritics_keepMain && data.IsOfKindCategory(LetterKindCategory.DiacriticCombo) &&
         !mainDiacriticsIds.Contains(data.Symbol))
     {
         return(false);
     }
     if (filters.excludeLetterVariations && data.IsOfKindCategory(LetterKindCategory.LetterVariation))
     {
         return(false);
     }
     if (data.IsOfKindCategory(LetterKindCategory.Symbol))
     {
         return(false);                                                  // always skip symbols
     }
     return(true);
 }
Ejemplo n.º 6
0
 public QuestionBuilderParameters()
 {
     this.correctChoicesHistory = PackListHistory.RepeatWhenFull;
     this.wrongChoicesHistory   = PackListHistory.RepeatWhenFull;
     this.useJourneyForCorrect  = true;
     this.useJourneyForWrong    = false;
     this.correctSeverity       = SelectionSeverity.MayRepeatIfNotEnough;
     this.wrongSeverity         = SelectionSeverity.MayRepeatIfNotEnough;
     this.letterFilters         = new LetterFilters();
     this.wordFilters           = new WordFilters();
     this.phraseFilters         = new PhraseFilters();
 }
Ejemplo n.º 7
0
        public List <LetterData> GetNotCommonLettersInWords(LetterFilters letterFilters, LetterEqualityStrictness letterEqualityStrictness, WordData[] words)
        {
            var commonLetters                = GetCommonLettersInWords(letterEqualityStrictness, words);
            var nonCommonLetters             = GetAllLettersAndForms(letterFilters);
            var nonCommonLettersWithComparer = new HashSet <LetterData>(new StrictLetterDataComparer(letterEqualityStrictness));

            nonCommonLettersWithComparer.UnionWith(nonCommonLetters);
            foreach (var commonLetter in commonLetters)
            {
                nonCommonLettersWithComparer.Remove(commonLetter);
            }
            return(nonCommonLettersWithComparer.ToList());
        }
Ejemplo n.º 8
0
        public void OnMouseDown()
        {
            var view = GetComponent <LivingLetterController>();

            view.ToggleDance();

            var letterFilters = new LetterFilters();

            letterFilters.excludeDiphthongs = true;
            var letter = AppManager.I.Teacher.GetRandomTestLetterLL(letterFilters, useMaxJourneyData: true);

            view.Init(letter);

            AudioManager.I.PlayLetter(letter.Data, true);
        }
Ejemplo n.º 9
0
 public List <LetterData> GetLettersByType(LetterDataType choice, LetterFilters filters)
 {
     return(dbManager.FindLetterData(x => x.Type == choice && CheckFilters(filters, x)));
 }
Ejemplo n.º 10
0
 public List <LetterData> GetVowelLetter(LetterFilters filters)
 {
     return(dbManager.FindLetterData(x => x.Type == LetterDataType.LongVowel && CheckFilters(filters, x)));
 }
Ejemplo n.º 11
0
 public List <LetterData> GetConsonantLetter(LetterFilters filters)
 {
     return(dbManager.FindLetterData(x =>
                                     x.Type == LetterDataType.Consonant || x.Type == LetterDataType.Powerful && CheckFilters(filters, x)));
 }
Ejemplo n.º 12
0
 public List <LetterData> GetLettersBySunMoon(LetterDataSunMoon choice, LetterFilters filters)
 {
     return(dbManager.FindLetterData(x => x.SunMoon == choice && CheckFilters(filters, x)));
 }
Ejemplo n.º 13
0
        public List <LetterData> GetLettersNotIn(LetterEqualityStrictness equalityStrictness, LetterFilters filters, params LetterData[] tabooArray)
        {
            var comparer         = new StrictLetterDataComparer(equalityStrictness);
            var lettersWithForms = GetAllLettersAndForms(filters);

            return(lettersWithForms.Where(x => !tabooArray.Contains(x, comparer)).ToList());
        }
Ejemplo n.º 14
0
 public List <LetterData> GetAllLetters(LetterFilters filters)
 {
     return(dbManager.FindLetterData(x => CheckFilters(filters, x)));
 }
Ejemplo n.º 15
0
        public List <LetterData> GetLettersNotIn(LetterFilters filters, params LetterData[] tabooArray)
        {
            var tabooList = new List <LetterData>(tabooArray);

            return(GetLettersNotIn(tabooList.ConvertAll(x => x.Id), filters));
        }
Ejemplo n.º 16
0
 private List <LetterData> GetLettersNotIn(List <string> tabooList, LetterFilters filters)
 {
     return(dbManager.FindLetterData(x => !tabooList.Contains(x.Id) && CheckFilters(filters, x)));
 }