Initial implementation of voice works scanning.

This commit is contained in:
2025-09-11 00:07:49 -04:00
parent f250276a99
commit 3c0a39b324
50 changed files with 1351 additions and 88 deletions

View File

@@ -4,10 +4,10 @@ namespace JSMR.Infrastructure.Data.Repositories.VoiceWorks;
public static class MySqlBooleanQuery
{
// Main entry
public static string Normalize(string input)
{
if (string.IsNullOrWhiteSpace(input)) return string.Empty;
if (string.IsNullOrWhiteSpace(input))
return string.Empty;
// Split into top-level tokens by spaces (not inside quotes/parentheses)
var tokens = SplitTopLevel(input.Trim(), ' ');
@@ -16,7 +16,12 @@ public static class MySqlBooleanQuery
foreach (var raw in tokens)
{
var t = raw.Trim();
if (t.Length == 0) continue;
if (t.Length == 0)
continue;
if (t is "|")
continue;
// Preserve explicit boolean operators user may already supply
if (t[0] == '-' || t[0] == '+')
@@ -63,7 +68,7 @@ public static class MySqlBooleanQuery
var orParts = SplitTopLevel(token, '|')
.Select(p => NormalizeOrAtom(p.Trim()))
.Where(p => p.Length > 0);
return "(" + string.Join("|", orParts) + ")";
return "(" + string.Join(" ", orParts) + ")";
}
// Plain atom -> as-is