Initial implementation of voice works scanning.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user