コード例 #1
0
ファイル: MatchingManager.cs プロジェクト: kwende/MitchMatch
        public static int SoftMatchCount(Row a, Row b, FieldInclusions toInclude)
        {
            int toReturn = 0;

            if (toInclude.SSN && FuzzySSNMatch(a.SSN, b.SSN))
            {
                toReturn++;
            }
            if (toInclude.Name && FuzzyStringMatch(a.FIRST + a.LAST, b.FIRST + b.LAST))
            {
                toReturn++;
            }
            if (toInclude.First && FuzzyStringMatch(a.FIRST, b.FIRST))
            {
                toReturn++;
            }
            if (toInclude.Last && FuzzyStringMatch(a.LAST, b.LAST))
            {
                toReturn++;
            }
            if (toInclude.DOB && FuzzyDateEquals(a.DOB, b.DOB))
            {
                toReturn++;
            }
            if (toInclude.Phone && FuzzyPhoneMatch(a.PHONE, b.PHONE))
            {
                toReturn++;
            }
            if (toInclude.Address && FuzzyAddressMatchEditDistance(a, b))
            {
                toReturn++;
            }
            if (toInclude.SSNSoft && FuzzySSNNoConflict(a.SSN, b.SSN)) // Counts SSN carrying no information as a match.
            {
                toReturn++;
            }
            if (toInclude.AddressSoft && FuzzyAddressMatchNumber(a.ADDRESS1, b.ADDRESS1))
            {
                toReturn++;
            }
            return(toReturn);
        }
コード例 #2
0
ファイル: MatchingManager.cs プロジェクト: kwende/MitchMatch
        public static string HardSelector(Row row, FieldInclusions toInclude)
        {
            string toReturn = "";

            if (toInclude.First || toInclude.Name)
            {
                if (row.FIRST == "")
                {
                    return("BADFORMAT");
                }
                toReturn += row.FIRST;
            }
            if (toInclude.Last || toInclude.Name)
            {
                if (row.LAST == "")
                {
                    return("BADFORMAT");
                }
                toReturn += row.LAST;
            }
            if (toInclude.SSN)
            {
                if (row.SSN == 0)
                {
                    return("BADFORMAT");
                }
                toReturn += row.SSN;
            }
            if (toInclude.DOB)
            {
                if (row.DOB == default(DateTime))
                {
                    return("BADFORMAT");
                }
                toReturn += row.DOB;
            }
            if (toInclude.Phone)
            {
                if (row.PHONE == 0)
                {
                    return("BADFORMAT");
                }
                toReturn += row.PHONE;
            }
            if (toInclude.Address)
            {
                if (row.ADDRESS1 == "")
                {
                    return("BADFORMAT");
                }
                toReturn += row.ADDRESS1;
            }
            if (toInclude.Email)
            {
                if (row.EMAIL == "")
                {
                    return("BADFORMAT");
                }
                toReturn += row.EMAIL;
            }
            return(toReturn);
        }