@@ -138,7 +138,6 @@ public static IQueryable<IEnumerable<T>> CollEvenLength<T>(this IQueryable<IEnum
138138 /// Retrieves a Queryable of string based on IEnumerable of string data types that equal
139139 /// to a current hamming value of N and input type str2 that are checked against.
140140 /// </summary>
141- /// <typeparam name="T"></typeparam>
142141 /// <param name="str1">The leftmost string part to compare with</param>
143142 /// <param name="str2">The rightmost string part to compare against</param>
144143 /// <param name="distCheck">The hamming value to check per string comparison</param>
@@ -149,12 +148,12 @@ public static IQueryable<IEnumerable<T>> CollEvenLength<T>(this IQueryable<IEnum
149148 /// IQueryable<string></string> hamCheckStr = new List<string></string>{"test1","test2","test3","test2","10times49","20times46","times"}.AsQueryable();
150149 /// var sourceStrings = new List<string></string> { "abc", "def", "xyz" }.AsQueryable();
151150 ///
152- /// sourceStrings.WhereDist<string></string> ("abg",1);
153- /// sourceStrings.WhereDist<string></string> ("aee",2);
154- /// hamCheckStr.WhereDist<string></string> ("test3",1); // all return the appropriate filtered queryable search results.
151+ /// sourceStrings.WhereDist("abg",1);
152+ /// sourceStrings.WhereDist("aee",2);
153+ /// hamCheckStr.WhereDist("test3",1); // all return the appropriate filtered queryable search results.
155154 /// </code>
156155 /// </example>
157- public static IQueryable < string > WhereDist < T > ( this IQueryable < string > str1 , string str2 , int distCheck )
156+ public static IQueryable < string > WhereDist ( this IQueryable < string > str1 , string str2 , int distCheck )
158157 {
159158
160159 Expression < Func < string , bool > > distFilter = s1 => HammingDist ( s1 , str2 ) == distCheck ;
@@ -281,7 +280,7 @@ public static T FreqOccur<T>(this IQueryable<T> source)
281280 public static IQueryable < int [ , ] > SelectIntMatrix ( this IQueryable < string > source , int defaultLen = 0 )
282281 {
283282
284- Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" ) ;
283+ Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" , RegexOptions . None , TimeSpan . FromSeconds ( 25 ) ) ;
285284 //preset filter for default values equality
286285 Func < int , int > toUnsigned = ( len ) => len < 0 ? ( - len ) : len ;
287286 int limitInt = toUnsigned ( defaultLen ) ;
@@ -296,7 +295,7 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
296295 Expression < Func < string , int [ , ] > > transfMap = str => ConvertTo2Dim ( new [ ] { str } . AsQueryable ( ) ,
297296
298297 ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) ,
299- ( int ) ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] )
298+ ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] )
300299 ) ;
301300
302301 //default filtering part, returns full set of values as 2dim array nxm
@@ -354,11 +353,11 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
354353 if ( conditions . Length == 0 )
355354 {
356355 //checks for nulls etc prior to cleaning processed data..
357- Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" ) ;
356+ Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" , RegexOptions . None , TimeSpan . FromSeconds ( 25 ) ) ;
358357 Expression < Func < string , int [ , ] > > transfMap = str => ConvertTo2Dim ( new [ ] { str } . AsQueryable ( ) ,
359358
360359 ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) ,
361- ( int ) ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] )
360+ ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] )
362361 ) ;
363362
364363
@@ -369,15 +368,15 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
369368 }
370369 else
371370 { //project the selected items per length into 1-dim counterpart..
372- Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" ) ;
371+ Expression < Func < string , string > > changeStr = strEl => Regex . Replace ( string . IsNullOrEmpty ( strEl ) ? "0" : strEl , @"^\D$" , "" , RegexOptions . None , TimeSpan . FromSeconds ( 25 ) ) ;
373372
374373 Expression < Func < string , int [ , ] > > transfMap = str => ( conditions . Any ( condition => condition ( str ) ) ) ?
375374 new int [ 1 , str . Length ]
376375 . Cast < int > ( )
377376 . Select ( ( _ , index ) => char . IsDigit ( str [ index ] ) ? ( int ) char . GetNumericValue ( str [ index ] ) : 0 )
378377 . ToArray ( )
379378 . To2DArray ( 1 , str . Length )
380- : ConvertTo2Dim ( new [ ] { str } . AsQueryable ( ) , ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) , ( int ) ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) ) ;
379+ : ConvertTo2Dim ( new [ ] { str } . AsQueryable ( ) , ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) , ( str . Length ) / ( int ) Char . GetNumericValue ( str . Length . ToString ( ) [ 0 ] ) ) ;
381380
382381 var executedSource = source . Select ( changeStr ) ;
383382 var resultArrays = executedSource . Select ( transfMap . Compile ( ) ) ;
0 commit comments