diff --git a/index.html b/index.html
index 66a3a92..a7fa10f 100644
--- a/index.html
+++ b/index.html
@@ -30,7 +30,7 @@
- 现在单字{{single}}个, 词组{{words}}个!
+ 现有单字{{single}}个, 词组{{words}}个!
diff --git a/js/index.js b/js/index.js
index 10b8356..03c54b7 100644
--- a/js/index.js
+++ b/js/index.js
@@ -34,7 +34,8 @@ Anot({
fetch('./data/table.txt')
.then(r => r.text())
.then(r => {
- // console.log(r)
+ //
+
r.split('\n').forEach(it => {
it = it
.trim()
@@ -48,10 +49,6 @@ Anot({
}
})
- window.foo = WB_TABLE
-
- console.log(WB_TABLE)
-
this.single = WB_TABLE.length
})
},
@@ -70,10 +67,10 @@ Anot({
params.txt = params.txt.replace(/[\sa-z]/g, '')
}
- if (params.txt.length > 1) {
- res = params.txt.split('').map(t => WB_TABLE.get(t))
- } else {
+ if (reverse || params.txt.length === 1) {
res = [WB_TABLE.get(params.txt)]
+ } else {
+ res = params.txt.split('').map(t => WB_TABLE.get(t))
}
if (reverse) {
@@ -100,7 +97,7 @@ Anot({
.join('\n')
}
- this.result = `查询结果: \n${res}`
+ this.result = `查询耗时: ${t1}ms\n查询结果: \n${res}`
}
}
})
diff --git a/js/lib/core.js b/js/lib/core.js
index d2f3fe6..c0474ba 100644
--- a/js/lib/core.js
+++ b/js/lib/core.js
@@ -48,6 +48,7 @@ export class Enum {
}
get(k) {
+ console.log('>>>>', k)
if (this.#dict_k[k]) {
return this.#dict_k[k]
} else if (this.#dict_v[k]) {