public static bool CheckPersonName(String s) { if (s.Contains('.')) { return(true); } bool hasSpaces = s.Trim().Any(Char.IsWhiteSpace); if (!hasSpaces) { return(false); } string[] words = Regex.Split(s, @"[\,\s\n]+"); if (TextHelpers.CanBePatronymic(words[words.Length - 1])) { return(true); } if (words.Count() != 3) { var predictedField = ColumnByDataPredictor.PredictByString(s); if (!HeaderHelpers.IsNameDeclarationField(predictedField)) { return(false); } } return(true); }
public static bool TestFieldWithoutOwntypes(DeclarationField field, Cell cell) { if (cell.IsEmpty) { return(false); } string text = cell.GetText(true); if ((field & DeclarationField.SquareMask) > 0 && DataHelper.ParseSquare(text).HasValue) { return(true); } var predictedField = ColumnByDataPredictor.PredictByString(text); return((predictedField & ~DeclarationField.AllOwnTypes) == (field & ~DeclarationField.AllOwnTypes)); }