fix word segmentated search

This commit is contained in:
polv committed 2026-03-06 12:57:20 +07:00
1 parent 1614db6e99
commit dd52b82cc7
9 files changed
+54 -8

No files matched your search

+2 -2
View File
@@ -53,7 +53,7 @@ function SearchPage() {
if (!isMonitorClipboard) return;
const intervalId = setInterval(async () => {
const newText = await readText();
const newText = (await readText()).replace(/ /g, "");
set_clipboardText((clipboardText) => {
if (clipboardText !== newText) {
@@ -134,7 +134,7 @@ function SearchPage() {
});
if (isNew) {
if (!result.length && !isFromSplit && ender === "" && q.length > 2) {
if (!result.length && !isFromSplit && /^[^ ]{3,} $/.test(q)) {
const segs = await invoke<{ surface: string }[]>("tokenize", {
text: q,
});