protected override List <UInt64> ConvertToValueListInternal(object value, out decimal factor) { factor = 0M; if (value == null) { return(null); } if (value is UInt64) { UInt64 intVal = (UInt64)value; if (intVal < TensDigitsPlusOne) { List <UInt64> single = new List <UInt64>(); single.Add(intVal); return(single); } } string valString = value.ToString(); List <UInt64> retList = new List <UInt64>(); StringBuilder intsSb = new StringBuilder(valString.Length); foreach (char c in valString) { if (char.IsDigit(c)) { intsSb.Append(c); } } int digitCount = intsSb.Length; if (digitCount == this.createArgs.NumberCharatersInData) { factor = 1M; retList.Add(UInt64.Parse(intsSb.ToString())); return(retList); } factor = (decimal)(this.createArgs.NumberCharatersInData - (Math.Abs(this.createArgs.NumberCharatersInData - digitCount))) / (decimal)this.createArgs.NumberCharatersInData; List <string> strings = new List <string>(); //if bigger or smaller.. there could be a bunch of matches //!!!RM this can slow things down. maybe want to turn it off //or as a differnt pass if (digitCount > this.createArgs.NumberCharatersInData) { //ColumnFuzzyMatcher.GetStringWithRemoved(intsSb, strings, 0, 0, digitCount - this.createArgs.NumberCharatersInData); ColumnFuzzyMatcher.GetStringWithRemovedMultiple(intsSb, strings, digitCount - this.createArgs.NumberCharatersInData); } else { //ColumnFuzzyMatcher.GetStringWithAdded(intsSb, strings, 0, 0, this.createArgs.NumberCharatersInData - digitCount); ColumnFuzzyMatcher.GetStringWithAddedMultiple(intsSb, strings, this.createArgs.NumberCharatersInData - digitCount); } foreach (string s in strings) { retList.Add(UInt64.Parse(s)); } return(retList); }
//private System.Data.DataColumn dobNameColumn; /// <summary> /// /// </summary> /// <param name="creditCardTable"></param> /// <param name="consumerTable"></param> /// <param name="creditCardRowList"></param> /// <param name="consumerRowList"></param> /// <param name="dataModelTransaction"></param> public CardSocialLastNameFuzzyMatcher(CreditCardDataTable creditCardTable, ConsumerDataTable consumerTable, List <RowLockingWrapper <CreditCardRow> > creditCardRowList, List <RowLockingWrapper <ConsumerRow> > consumerRowList, IDataModelTransaction dataModelTransaction) { //get the credit card number column this.creditCardColumn = creditCardTable.OriginalAccountNumberColumn; //create the matcher for the credit card number. //will support Exact and Parts lookup types (validation is implicit) this.cardMatcher = ColumnFuzzyMatcher.CreateFuzzyMatcher(new MatcherCreateArgs(16, DataCharType.DigitsOnly, SupportedLookupType.ExactLookup | SupportedLookupType.UseDataMasksForProbable, ExtendedStorageTypes.ConvertToValue | ExtendedStorageTypes.ConvertToValueList, this.creditCardColumn)); //load up the matcher foreach (RowLockingWrapper <CreditCardRow> curCreditCardRow in creditCardRowList) { curCreditCardRow.AcquireReaderLock(); try { this.cardMatcher.AddTableRowToMap(curCreditCardRow); } finally { curCreditCardRow.ReleaseReaderLock(); } } this.ssnColumn = consumerTable.SocialSecurityNumberColumn; this.socialMatcher = ColumnFuzzyMatcher.CreateFuzzyMatcher(new MatcherCreateArgs(9, DataCharType.DigitsOnly, SupportedLookupType.ExactLookup | SupportedLookupType.UseDataMasksForProbable, ExtendedStorageTypes.ConvertToValue | ExtendedStorageTypes.ConvertToValueList, this.ssnColumn)); //no parts for these this.lastNameColumn = consumerTable.LastNameColumn; this.lastNameMatcher = ColumnFuzzyMatcher.CreateFuzzyMatcher(new MatcherCreateArgs(12, DataCharType.String, SupportedLookupType.ValidateOnly, ExtendedStorageTypes.ConvertToValue | ExtendedStorageTypes.ConvertToValueList, this.lastNameColumn)); this.firstNameColumn = consumerTable.FirstNameColumn; this.firstNameMatcher = ColumnFuzzyMatcher.CreateFuzzyMatcher(new MatcherCreateArgs(12, DataCharType.String, SupportedLookupType.ValidateOnly, ExtendedStorageTypes.ConvertToValue | ExtendedStorageTypes.ConvertToValueList, this.firstNameColumn)); foreach (RowLockingWrapper <ConsumerRow> consumerRow in consumerRowList) { consumerRow.AcquireReaderLock(); try { this.firstNameMatcher.AddTableRowToMap(consumerRow); this.lastNameMatcher.AddTableRowToMap(consumerRow); this.socialMatcher.AddTableRowToMap(consumerRow); } finally { consumerRow.ReleaseReaderLock(); } } //this.dobMatcher = ColumnFuzzyMatcher.CreateFuzzyMatcher(ColumnFuzzyMatcher.DataCharType.DateTime, // ColumnFuzzyMatcher.SupportedLookupType.ValidateOnly, // ds.Consumer.LastNameColumn); //this.dobMatcher.AddTableRowsToMap(); }