update
parent
92f7e3f0a9
commit
de40e1a905
|
@ -1 +1 @@
|
|||
body{line-height:1.5;font-size:14px;color:var(--color-dark-1)}a{color:inherit;text-decoration:none}wc-switch{cursor:pointer}.app{width:100%;height:100vh}.flex{display:flex}.flex.column{flex-direction:column}.flex.ac{justify-content:center}.flex.alc{align-items:center}.flex.acc{justify-content:center;align-items:center}.flex.asc{justify-content:space-between;align-items:center}.wrapper{width:1024px}.topbar{width:100%;height:64px;background:#fff;box-shadow:0 6px 12px rgba(0,0,0,.05)}.topbar .logo{font-size:24px;color:var(--color-red-1)}.topbar .logo span{font-size:14px}.topbar .navs{font-size:16px}.topbar .navs .nav{margin-left:32px;cursor:pointer;transition:color .2s linear}.topbar .navs .nav.active,.topbar .navs .nav:hover{text-decoration:underline;color:var(--color-red-1)}.footer{width:100%;height:64px;border-top:1px solid var(--color-plain-2)}.main{overflow:hidden;flex:1}.main .wrapper{height:100%}.main .table-info{width:100%;height:64px}.main .table-info b{color:var(--color-red-1)}.main .table-info .download{margin-left:32px}.main .search{width:100%}.main .search .field{margin-top:16px}.main .search .field.result{line-height:2;font-family:Menlo;word-wrap:break-word;white-space:pre-wrap}.main .search .field wc-input{flex:1}.main .panel{overflow:hidden;flex:1;margin-top:32px}.main .panel .custom-file{position:relative;width:160px}.main .panel .custom-file input{position:absolute;width:100%;height:100%;opacity:0}.main .panel .tips{color:var(--color-orange-3)}.main .panel .scroll-view{overflow:hidden;flex:1}.main .panel .preview{margin-top:16px;font-family:Menlo;word-break:keep-all;white-space:pre-wrap}.main .about{padding:32px 16px}.main .about h2{font-size:24px}.main .about .logs .version{margin-top:32px;line-height:2;font-weight:bold;font-size:18px}.main .about .logs dd{color:var(--color-grey-3)}.main .about .logs ol{padding-left:2em;list-style:decimal}.download-layer{width:640px;padding-bottom:64px;background:#fff}.download-layer .field{margin-top:16px;padding:0 16px}.download-layer .field .label{min-width:120px;padding-right:16px;line-height:32px;text-align:right;font-weight:bold;color:var(--color-grey-3)}.download-layer .field .label::after{content:" : "}.download-layer .field .tips{margin-left:16px;line-height:32px;color:var(--color-orange-3)}.download-layer .field.ctrol{padding:0 128px;margin-top:64px}@media screen and (max-width: 1024px){.topbar,.main{padding:0 16px}.wrapper{width:100%}.footer .wrapper{flex-direction:column;align-items:center;justify-content:center}}
|
||||
body{line-height:1.5;font-size:14px;color:var(--color-dark-1)}a{color:inherit;text-decoration:none}wc-switch{cursor:pointer}.app{width:100%;height:100vh}.flex{display:flex}.flex.column{flex-direction:column}.flex.ac{justify-content:center}.flex.alc{align-items:center}.flex.acc{justify-content:center;align-items:center}.flex.asc{justify-content:space-between;align-items:center}.wrapper{width:1024px}.topbar{width:100%;height:64px;background:#fff;box-shadow:0 6px 12px rgba(0,0,0,.05)}.topbar .logo{font-size:24px;color:var(--color-red-1)}.topbar .logo span{font-size:14px}.topbar .navs{font-size:16px}.topbar .navs .nav{margin-left:32px;cursor:pointer;transition:color .2s linear}.topbar .navs .nav.active,.topbar .navs .nav:hover{text-decoration:underline;color:var(--color-red-1)}.footer{width:100%;height:64px;border-top:1px solid var(--color-plain-2)}.main{overflow:hidden;flex:1}.main .wrapper{height:100%}.main .table-info{width:100%;height:64px}.main .table-info b{color:var(--color-red-1)}.main .table-info .download{margin-left:32px}.main .search{width:100%}.main .search .field{margin-top:16px}.main .search .field.result{line-height:2;font-family:Menlo;word-wrap:break-word;white-space:pre-wrap}.main .search .field wc-input{flex:1}.main .panel{overflow:hidden;flex:1;margin-top:32px}.main .panel .custom-file{position:relative;width:160px}.main .panel .custom-file input{position:absolute;width:100%;height:100%;opacity:0}.main .panel .tips{color:var(--color-orange-3)}.main .panel .scroll-view{overflow:hidden;flex:1}.main .panel .preview{margin-top:16px;font-family:Menlo;word-break:keep-all;white-space:pre-wrap}.main .about{padding:32px 16px}.main .about h2{font-size:24px}.main .about .logs .version{margin-top:32px;line-height:2;font-weight:bold;font-size:18px}.main .about .logs dd{color:var(--color-grey-3)}.main .about .logs ol{padding-left:2em;list-style:decimal}.github{position:fixed;right:-30px;top:20px;z-index:9;width:120px;height:22px;line-height:22px;text-align:center;color:#fff;background:var(--color-dark-1);transform:rotate(45deg)}.download-layer{width:640px;padding-bottom:64px;background:#fff}.download-layer .field{margin-top:16px;padding:0 16px}.download-layer .field .label{min-width:120px;padding-right:16px;line-height:32px;text-align:right;font-weight:bold;color:var(--color-grey-3)}.download-layer .field .label::after{content:" : "}.download-layer .field .tips{margin-left:16px;line-height:32px;color:var(--color-orange-3)}.download-layer .field.ctrol{padding:0 128px;margin-top:64px}@media screen and (max-width: 1024px){.topbar,.main{padding:0 16px}.wrapper{width:100%}.footer .wrapper{flex-direction:column;align-items:center;justify-content:center}}
|
|
@ -102,6 +102,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
.github {
|
||||
position:fixed;
|
||||
right:-30px;
|
||||
top:20px;
|
||||
z-index:9;
|
||||
width:120px;
|
||||
height:22px;
|
||||
line-height:22px;
|
||||
text-align:center;
|
||||
color:#fff;
|
||||
background:var(--color-dark-1);
|
||||
transform:rotate(45deg);
|
||||
}
|
||||
|
||||
.download-layer {
|
||||
width: 640px;
|
||||
padding-bottom: 64px;
|
||||
|
|
|
@ -195,7 +195,6 @@
|
|||
一维数组
|
||||
异常
|
||||
应用程序开发
|
||||
邮件服务器
|
||||
语句
|
||||
元素
|
||||
元组
|
||||
|
|
98371
data/extra.txt
98371
data/extra.txt
File diff suppressed because it is too large
Load Diff
905
data/words.txt
905
data/words.txt
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@
|
|||
|
||||
<div class="wrapper flex column">
|
||||
<header class="table-info flex alc">
|
||||
现有单字GB2312(<b>{{gb2312}}</b>)个 + GBK(<b>{{gbk}}</b>)个、词组<b>{{words}}</b>个、异形字<b>{{dy}}</b>个、emoji<b>{{emoji}}</b>个 !
|
||||
现有单字GB2312(<b>{{gb2312}}</b>)个 + GBK(<b>{{gbk - gb2312}}</b>)个、异形字<b>{{dy}}</b>个、词组<b>{{words}}</b>个、emoji<b>{{emoji}}</b>个 !
|
||||
<wc-link class="download" type="primary" underline @click="openDownloadPanel">下载词库</wc-link>
|
||||
</header>
|
||||
|
||||
|
@ -76,6 +76,8 @@
|
|||
</div>
|
||||
</footer>
|
||||
|
||||
<a href="//github.com/yutent/wb-table" class="github" target="__target">GitHub</a>
|
||||
|
||||
|
||||
<wc-layer ref="dl" title="下载选项" mask mask-close>
|
||||
<div class="download-layer">
|
||||
|
|
28
js/index.js
28
js/index.js
|
@ -14,7 +14,7 @@ import '//unpkg.yutent.top/@bytedo/wcui/dist/form/checkbox.js'
|
|||
import '//unpkg.yutent.top/@bytedo/wcui/dist/form/switch.js'
|
||||
import fetch from '//unpkg.yutent.top/@bytedo/fetch/dist/index.js'
|
||||
|
||||
import { Enum } from './lib/core.js'
|
||||
import { Enum, saveFile, SString } from './lib/core.js'
|
||||
import FIXED_86F from './lib/86_fixed.js'
|
||||
|
||||
const VER_86 = '86'
|
||||
|
@ -56,8 +56,9 @@ Anot({
|
|||
fetch('./data/gbk.txt').then(r => r.text()),
|
||||
fetch('./data/words.txt').then(r => r.text()),
|
||||
fetch('./data/dy.txt').then(r => r.text()),
|
||||
fetch('./data/extra.txt').then(r => r.text()),
|
||||
fetch('./data/emoji.txt').then(r => r.text())
|
||||
]).then(([gb2312, gbk, words, dy, emoji]) => {
|
||||
]).then(([gb2312, gbk, words, dy, extra, emoji]) => {
|
||||
//
|
||||
|
||||
gb2312.split('\n').forEach(it => {
|
||||
|
@ -79,8 +80,8 @@ Anot({
|
|||
WB_TABLE_GBK.add(k, it)
|
||||
}
|
||||
})
|
||||
|
||||
words.split('\n').forEach(it => {
|
||||
//
|
||||
;(words + extra).split('\n').forEach(it => {
|
||||
it = it.split(' ')
|
||||
|
||||
let k = it.shift()
|
||||
|
@ -90,6 +91,8 @@ Anot({
|
|||
}
|
||||
})
|
||||
|
||||
console.log(WB_WORDS)
|
||||
|
||||
dy.split('\n').forEach(it => {
|
||||
it = it.split(' ')
|
||||
|
||||
|
@ -110,6 +113,8 @@ Anot({
|
|||
}
|
||||
})
|
||||
|
||||
WB_TABLE_GBK.concat(WB_TABLE_2312)
|
||||
|
||||
this.gb2312 = WB_TABLE_2312.length
|
||||
this.gbk = WB_TABLE_GBK.length
|
||||
this.words = WB_WORDS.length
|
||||
|
@ -138,12 +143,12 @@ Anot({
|
|||
}
|
||||
|
||||
if (reverse || text.length === 1) {
|
||||
res = [WB_TABLE_2312.get(text) || WB_TABLE_GBK.get(text)]
|
||||
res = [WB_TABLE_GBK.get(text)]
|
||||
if (version === VER_86F) {
|
||||
resf = [WB_TABLE_86F.get(text)]
|
||||
}
|
||||
} else {
|
||||
res = text.split('').map(t => WB_TABLE_2312.get(t) || WB_TABLE_GBK.get(t))
|
||||
res = text.split('').map(t => WB_TABLE_GBK.get(t))
|
||||
if (version === VER_86F) {
|
||||
resf = text.split('').map(t => WB_TABLE_86F.get(t))
|
||||
}
|
||||
|
@ -159,10 +164,7 @@ Anot({
|
|||
res = `【 ${text} 】👉\t${res[0]
|
||||
.map(
|
||||
t =>
|
||||
`${t}(${(resf && resf[0]
|
||||
? WB_TABLE_86F.get(t)
|
||||
: WB_TABLE_2312.get(t) || WB_TABLE_GBK.get(t)
|
||||
)
|
||||
`${t}(${(resf && resf[0] ? WB_TABLE_86F.get(t) : WB_TABLE_GBK.get(t))
|
||||
.join('、')
|
||||
.toUpperCase()})`
|
||||
)
|
||||
|
@ -211,7 +213,7 @@ Anot({
|
|||
for (let it of arr) {
|
||||
it = it.replace(/[\w\s\t]+/g, '')
|
||||
all.add(it)
|
||||
if (!WB_TABLE_2312.get(it) && !WB_WORDS.get(it) && !WB_DY.get(it)) {
|
||||
if (!WB_TABLE_GBK.get(it) && !WB_WORDS.get(it) && !WB_DY.get(it)) {
|
||||
unknow.add(it)
|
||||
}
|
||||
}
|
||||
|
@ -225,8 +227,8 @@ Anot({
|
|||
unknow.length
|
||||
} 个, 如下:\n\n${unknow.join('\t')}`
|
||||
|
||||
window.unknow = unknow
|
||||
console.log(unknow)
|
||||
// window.unknow = unknow
|
||||
// console.log(unknow)
|
||||
|
||||
// navigator.clipboard.writeText(Array.from(all).join('\n'))
|
||||
}
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
export function saveFile(bin, fileName) {
|
||||
var link = document.createElement('a')
|
||||
link.href = URL.createObjectURL(bin)
|
||||
link.download = fileName
|
||||
// 兼容火狐浏览器对于a链接click无效的问题,将a链接作为子节点放置到body元素下
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
// 下载后移除a链接
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
|
||||
/**
|
||||
* 增强版 String
|
||||
*/
|
||||
|
@ -102,10 +113,18 @@ export class Enum {
|
|||
}
|
||||
}
|
||||
|
||||
concat(...args) {
|
||||
for (let li of args) {
|
||||
li.forEach((it, k) => {
|
||||
this.add(k, it)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
forEach(callback, forV) {
|
||||
var dict = forV ? this.#dict_v : this.#dict_k
|
||||
for (let k in dict) {
|
||||
if (callback(k, dict[k]) === false) {
|
||||
if (callback(dict[k], k) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue