private void GenerarPrefix(string palabra) { this.prefix1 = Prefix.Prefix6Min(palabra); if (palabra.Length > 6) { this.prefix2 = Prefix.Prefix12Min(palabra); } if (palabra.Length > 12) { this.prefix3 = Prefix.Prefix18Min(palabra); } }
public static bool IsPrefix(string normalized, string normalizedTestForPrefix) { bool result; if (Prefix.Prefix6Min(normalizedTestForPrefix) > Prefix.Prefix6Min(normalized) || Prefix.Prefix6Max(normalized) > Prefix.Prefix6Max(normalizedTestForPrefix)) { result = false; } else { int length = normalizedTestForPrefix.Length; result = (length <= 6 || (Prefix.Prefix12Min(normalizedTestForPrefix) <= Prefix.Prefix12Min(normalized) && Prefix.Prefix12Max(normalized) <= Prefix.Prefix12Max(normalizedTestForPrefix) && (length <= 12 || (Prefix.Prefix18Min(normalizedTestForPrefix) <= Prefix.Prefix18Min(normalized) && Prefix.Prefix18Max(normalized) <= Prefix.Prefix18Max(normalizedTestForPrefix))))); } return(result); }