mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-08 17:35:18 +00:00
fix word segmentated search
This commit is contained in:
1 parent
1614db6e99
commit
dd52b82cc7
9 files changed
+54
-8
No files matched your search
@@ -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,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user