Beispiel #1
0
 private static bool FileContainCheck(ItemFile file, IconFile icon)
 {
     foreach (var format in icon.Formats)
     {
         if (format.LowerCase.Length >= GENERAL_MIN_CHAR_LENGTH && Regex.IsMatch(format.LowerCase, "[a-z]") &&
             file.Formats.Any(x => x.LowerCase.GetWords().Length <= GENERAL_MIN_CHAR_LENGTH &&
                              x.LowerCase.ContainsWord(format.LowerCase)))
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
        private static int SimilarCheck(ItemFile file, IconFile test)
        {
            var s1 = file.Formats[0].LowerCase;
            var s2 = test.Formats[0].LowerCase;

            if (s1.Length > s2.Length)
            {
                s1.Substring(0, s2.Length);
            }
            else
            {
                s2.Substring(0, s1.Length);
            }

            if (s1.Length <= GENERAL_MIN_CHAR_LENGTH)
            {
                return(0);
            }

            return(SPELLCHECK_MAX_ERRORS - SpellCheck(s1, s2));
        }