Skip to content

Commit

Permalink
Re-compiled changes etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrdek committed Dec 5, 2023
1 parent 536572f commit 9e948f3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 26 deletions.
21 changes: 10 additions & 11 deletions bin/Debug/net462/DataCalc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public static IQueryable<IEnumerable<T>> CollEvenLength<T>(this IQueryable<IEnum
/// Retrieves a Queryable of string based on IEnumerable of string data types that equal
/// to a current hamming value of N and input type str2 that are checked against.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="str1">The leftmost string part to compare with</param>
/// <param name="str2">The rightmost string part to compare against</param>
/// <param name="distCheck">The hamming value to check per string comparison</param>
Expand All @@ -149,12 +148,12 @@ public static IQueryable<IEnumerable<T>> CollEvenLength<T>(this IQueryable<IEnum
/// IQueryable<string></string> hamCheckStr = new List<string></string>{"test1","test2","test3","test2","10times49","20times46","times"}.AsQueryable();
/// var sourceStrings = new List<string></string> { "abc", "def", "xyz" }.AsQueryable();
///
/// sourceStrings.WhereDist<string></string>("abg",1);
/// sourceStrings.WhereDist<string></string>("aee",2);
/// hamCheckStr.WhereDist<string></string>("test3",1); // all return the appropriate filtered queryable search results.
/// sourceStrings.WhereDist("abg",1);
/// sourceStrings.WhereDist("aee",2);
/// hamCheckStr.WhereDist("test3",1); // all return the appropriate filtered queryable search results.
/// </code>
/// </example>
public static IQueryable<string> WhereDist<T>(this IQueryable<string> str1, string str2, int distCheck)
public static IQueryable<string> WhereDist(this IQueryable<string> str1, string str2, int distCheck)
{

Expression<Func<string, bool>> distFilter = s1 => HammingDist(s1, str2) == distCheck;
Expand Down Expand Up @@ -281,7 +280,7 @@ public static T FreqOccur<T>(this IQueryable<T> source)
public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source, int defaultLen = 0)
{

Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "");
Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "",RegexOptions.None,TimeSpan.FromSeconds(25));
//preset filter for default values equality
Func<int, int> toUnsigned = (len) => len < 0 ? (-len) : len;
int limitInt = toUnsigned(defaultLen);
Expand All @@ -296,7 +295,7 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
Expression<Func<string, int[,]>> transfMap = str => ConvertTo2Dim(new[] { str }.AsQueryable(),

(int)Char.GetNumericValue(str.Length.ToString()[0]),
(int)(str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0])
(str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0])
);

//default filtering part, returns full set of values as 2dim array nxm
Expand Down Expand Up @@ -354,11 +353,11 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
if (conditions.Length == 0)
{
//checks for nulls etc prior to cleaning processed data..
Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "");
Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "",RegexOptions.None,TimeSpan.FromSeconds(25));
Expression<Func<string, int[,]>> transfMap = str => ConvertTo2Dim(new[] { str }.AsQueryable(),

(int)Char.GetNumericValue(str.Length.ToString()[0]),
(int)(str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0])
(str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0])
);


Expand All @@ -369,15 +368,15 @@ public static IQueryable<int[,]> SelectIntMatrix(this IQueryable<string> source,
}
else
{ //project the selected items per length into 1-dim counterpart..
Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "");
Expression<Func<string, string>> changeStr = strEl => Regex.Replace(string.IsNullOrEmpty(strEl) ? "0" : strEl, @"^\D$", "",RegexOptions.None,TimeSpan.FromSeconds(25));

Expression<Func<string, int[,]>> transfMap = str => (conditions.Any(condition => condition(str))) ?
new int[1, str.Length]
.Cast<int>()
.Select((_, index) => char.IsDigit(str[index]) ? (int)char.GetNumericValue(str[index]) : 0)
.ToArray()
.To2DArray(1, str.Length)
: ConvertTo2Dim(new[] { str }.AsQueryable(), (int)Char.GetNumericValue(str.Length.ToString()[0]), (int)(str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0]));
: ConvertTo2Dim(new[] { str }.AsQueryable(), (int)Char.GetNumericValue(str.Length.ToString()[0]), (str.Length) / (int)Char.GetNumericValue(str.Length.ToString()[0]));

var executedSource = source.Select(changeStr);
var resultArrays = executedSource.Select(transfMap.Compile());
Expand Down
Binary file modified bin/Debug/net462/Queryabl.dll
Binary file not shown.
Binary file modified bin/Debug/net462/Queryabl.pdb
Binary file not shown.
9 changes: 4 additions & 5 deletions bin/Debug/net462/Queryabl.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions xrefmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,22 @@ references:
isSpec: "True"
fullName: Queryabl.DataCalc.Where
nameWithType: DataCalc.Where
- uid: Queryabl.DataCalc.WhereDist(System.Linq.IQueryable{System.String},System.String,System.Int32)
name: WhereDist(IQueryable<string>, string, int)
href: docs/Queryabl.DataCalc.html#Queryabl_DataCalc_WhereDist_System_Linq_IQueryable_System_String__System_String_System_Int32_
commentId: M:Queryabl.DataCalc.WhereDist(System.Linq.IQueryable{System.String},System.String,System.Int32)
name.vb: WhereDist(IQueryable(Of String), String, Integer)
fullName: Queryabl.DataCalc.WhereDist(System.Linq.IQueryable<string>, string, int)
fullName.vb: Queryabl.DataCalc.WhereDist(System.Linq.IQueryable(Of String), String, Integer)
nameWithType: DataCalc.WhereDist(IQueryable<string>, string, int)
nameWithType.vb: DataCalc.WhereDist(IQueryable(Of String), String, Integer)
- uid: Queryabl.DataCalc.WhereDist*
name: WhereDist
href: docs/Queryabl.DataCalc.html#Queryabl_DataCalc_WhereDist_
commentId: Overload:Queryabl.DataCalc.WhereDist
isSpec: "True"
fullName: Queryabl.DataCalc.WhereDist
nameWithType: DataCalc.WhereDist
- uid: Queryabl.DataCalc.WhereDist``1(System.Linq.IQueryable{System.String},System.String,System.Int32)
name: WhereDist<T>(IQueryable<string>, string, int)
href: docs/Queryabl.DataCalc.html#Queryabl_DataCalc_WhereDist__1_System_Linq_IQueryable_System_String__System_String_System_Int32_
commentId: M:Queryabl.DataCalc.WhereDist``1(System.Linq.IQueryable{System.String},System.String,System.Int32)
name.vb: WhereDist(Of T)(IQueryable(Of String), String, Integer)
fullName: Queryabl.DataCalc.WhereDist<T>(System.Linq.IQueryable<string>, string, int)
fullName.vb: Queryabl.DataCalc.WhereDist(Of T)(System.Linq.IQueryable(Of String), String, Integer)
nameWithType: DataCalc.WhereDist<T>(IQueryable<string>, string, int)
nameWithType.vb: DataCalc.WhereDist(Of T)(IQueryable(Of String), String, Integer)
- uid: Queryabl.DataCalc.Where``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})
name: Where<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>)
href: docs/Queryabl.DataCalc.html#Queryabl_DataCalc_Where__1_System_Linq_IQueryable___0__System_Linq_Expressions_Expression_System_Func___0_System_Boolean___
Expand Down

0 comments on commit 9e948f3

Please sign in to comment.