update
parent
5a1f3c45a1
commit
a0ab7c9162
|
@ -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 i{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}.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}}
|
|
@ -12,7 +12,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
|
|
||||||
i {
|
b {
|
||||||
color: var(--color-red-1);
|
color: var(--color-red-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,223 @@
|
||||||
|
八进制
|
||||||
|
闭源
|
||||||
|
编程
|
||||||
|
编译
|
||||||
|
编译器
|
||||||
|
编译型语言
|
||||||
|
变量
|
||||||
|
表单
|
||||||
|
表空间
|
||||||
|
表锁
|
||||||
|
捕获
|
||||||
|
不可重复读
|
||||||
|
布尔型
|
||||||
|
参数
|
||||||
|
常量
|
||||||
|
超文本标记语言
|
||||||
|
超文本预处理器
|
||||||
|
成员
|
||||||
|
成员方法
|
||||||
|
成员函数
|
||||||
|
成员属性
|
||||||
|
程序集
|
||||||
|
抽象
|
||||||
|
抽象方法
|
||||||
|
抽象类
|
||||||
|
初始化
|
||||||
|
触发器
|
||||||
|
传参
|
||||||
|
创建
|
||||||
|
纯虚方法
|
||||||
|
从库
|
||||||
|
存储过程
|
||||||
|
存储引擎
|
||||||
|
错误
|
||||||
|
代理服务器
|
||||||
|
代理模式
|
||||||
|
单精度
|
||||||
|
单片机
|
||||||
|
导入
|
||||||
|
地址
|
||||||
|
递归
|
||||||
|
递推
|
||||||
|
第一类对象
|
||||||
|
调试
|
||||||
|
定义
|
||||||
|
动态
|
||||||
|
动态规划
|
||||||
|
短整型
|
||||||
|
断点
|
||||||
|
堆栈
|
||||||
|
队列
|
||||||
|
对象
|
||||||
|
多态
|
||||||
|
多维数组
|
||||||
|
二叉链表
|
||||||
|
二叉树
|
||||||
|
二分法
|
||||||
|
二进制
|
||||||
|
二维数组
|
||||||
|
反射
|
||||||
|
返回类型
|
||||||
|
返回值
|
||||||
|
泛型
|
||||||
|
方法
|
||||||
|
防注入
|
||||||
|
访问
|
||||||
|
访问器
|
||||||
|
非线性链表
|
||||||
|
分治算法
|
||||||
|
封装
|
||||||
|
封装字段
|
||||||
|
服务层
|
||||||
|
服务器
|
||||||
|
浮点数
|
||||||
|
父类
|
||||||
|
复制
|
||||||
|
赋值
|
||||||
|
覆盖
|
||||||
|
高级语言
|
||||||
|
高精度
|
||||||
|
高可用
|
||||||
|
共用体
|
||||||
|
构造函数
|
||||||
|
构造体
|
||||||
|
关系型
|
||||||
|
广搜
|
||||||
|
哈希
|
||||||
|
函数
|
||||||
|
函数式
|
||||||
|
红黑树
|
||||||
|
后端
|
||||||
|
缓冲
|
||||||
|
缓冲池
|
||||||
|
幻象读
|
||||||
|
回溯算法
|
||||||
|
汇编语言
|
||||||
|
基本类型
|
||||||
|
基类
|
||||||
|
集合类
|
||||||
|
继承
|
||||||
|
监视
|
||||||
|
阶乘
|
||||||
|
接口
|
||||||
|
结构体
|
||||||
|
解释
|
||||||
|
解释器
|
||||||
|
解释型语言
|
||||||
|
进程
|
||||||
|
静态
|
||||||
|
局部变量
|
||||||
|
均衡树
|
||||||
|
开发
|
||||||
|
开源
|
||||||
|
控件
|
||||||
|
快排
|
||||||
|
框架
|
||||||
|
类变量
|
||||||
|
离线数据库
|
||||||
|
链表
|
||||||
|
列表
|
||||||
|
鲁棒性
|
||||||
|
逻辑运算符
|
||||||
|
落盘点
|
||||||
|
冒泡排序
|
||||||
|
面向对象
|
||||||
|
面向过程
|
||||||
|
命令行
|
||||||
|
命名空间
|
||||||
|
模块
|
||||||
|
模块化
|
||||||
|
内存占用率
|
||||||
|
内容分发网络
|
||||||
|
排序
|
||||||
|
派生类
|
||||||
|
判断
|
||||||
|
抛出
|
||||||
|
平衡树
|
||||||
|
前端
|
||||||
|
强制转换
|
||||||
|
请求
|
||||||
|
全局变量
|
||||||
|
全栈
|
||||||
|
三维数组
|
||||||
|
深搜
|
||||||
|
十进制
|
||||||
|
十六进制
|
||||||
|
实参
|
||||||
|
实例
|
||||||
|
实例变量
|
||||||
|
实现接口
|
||||||
|
事件
|
||||||
|
输出
|
||||||
|
输入
|
||||||
|
属性
|
||||||
|
属性代理
|
||||||
|
数据
|
||||||
|
数据包
|
||||||
|
数据结构
|
||||||
|
数据库
|
||||||
|
数据类型
|
||||||
|
数据适配器
|
||||||
|
数组
|
||||||
|
双精度
|
||||||
|
双写
|
||||||
|
顺序存储
|
||||||
|
死锁
|
||||||
|
算法
|
||||||
|
算术运算符
|
||||||
|
贪心算法
|
||||||
|
提取接口
|
||||||
|
跳出循环
|
||||||
|
图形用户界面
|
||||||
|
吞吐量
|
||||||
|
伪变量
|
||||||
|
委托
|
||||||
|
委托代理
|
||||||
|
文件读写
|
||||||
|
文件系统
|
||||||
|
析构函数
|
||||||
|
下标
|
||||||
|
线程
|
||||||
|
线性链表
|
||||||
|
响应超时
|
||||||
|
响应速度
|
||||||
|
向上转型
|
||||||
|
协程
|
||||||
|
协议
|
||||||
|
行级锁
|
||||||
|
形参
|
||||||
|
修饰符
|
||||||
|
虚方法
|
||||||
|
虚拟主机
|
||||||
|
循环
|
||||||
|
样式
|
||||||
|
一维数组
|
||||||
|
异常
|
||||||
|
应用程序开发
|
||||||
|
邮件服务器
|
||||||
|
语句
|
||||||
|
元素
|
||||||
|
元组
|
||||||
|
源码
|
||||||
|
云主机
|
||||||
|
占用率
|
||||||
|
长整型
|
||||||
|
整型
|
||||||
|
只读
|
||||||
|
指针
|
||||||
|
重载
|
||||||
|
注入
|
||||||
|
转型
|
||||||
|
转义
|
||||||
|
字典
|
||||||
|
字段
|
||||||
|
字符串
|
||||||
|
字符串
|
||||||
|
字符型
|
||||||
|
字节
|
||||||
|
自动回收
|
||||||
|
子类
|
||||||
|
组复制
|
||||||
|
组件
|
||||||
|
组提交
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
<div class="wrapper flex column">
|
<div class="wrapper flex column">
|
||||||
<header class="table-info flex alc">
|
<header class="table-info flex alc">
|
||||||
现有单字<i>{{single}}</i>个, 词组<i>{{words}}</i>个, 异形字<i>{{dy}}</i>个, emoji<i>{{emoji}}</i>个 !
|
现有单字GB2312(<b>{{gb2312}}</b>) + GBK(<b>{{gbk}}</b>) 个、词组<b>{{words}}</b>个、异形字<b>{{dy}}</b>个、emoji<b>{{emoji}}</b>个 !
|
||||||
<wc-link class="download" type="primary" underline @click="openDownloadPanel">下载词库</wc-link>
|
<wc-link class="download" type="primary" underline @click="openDownloadPanel">下载词库</wc-link>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<section class="field flex alc">
|
<section class="field flex alc">
|
||||||
<wc-radio-group :duplex="filter.version" @change="search">
|
<wc-radio-group :duplex="filter.version" @change="search">
|
||||||
<wc-radio value="86">86版</wc-radio>
|
<wc-radio value="86">86版</wc-radio>
|
||||||
<wc-radio value="18030" type="danger">18030版(86修正版)</wc-radio>
|
<wc-radio value="86f" type="danger">86修正版</wc-radio>
|
||||||
</wc-radio-group>
|
</wc-radio-group>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -84,14 +84,15 @@
|
||||||
<span class="label">编码版本</span>
|
<span class="label">编码版本</span>
|
||||||
<wc-radio-group :duplex="dlOpt.version" @change="search">
|
<wc-radio-group :duplex="dlOpt.version" @change="search">
|
||||||
<wc-radio value="86">86版</wc-radio>
|
<wc-radio value="86">86版</wc-radio>
|
||||||
<wc-radio value="18030" type="danger">18030版(86修正版)</wc-radio>
|
<wc-radio value="86f" type="danger">86修正版</wc-radio>
|
||||||
</wc-radio-group>
|
</wc-radio-group>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="field flex">
|
<section class="field flex">
|
||||||
<span class="label">词库选择</span>
|
<span class="label">词库选择</span>
|
||||||
<wc-checkbox-group :duplex="dlOpt.tables">
|
<wc-checkbox-group :duplex="dlOpt.tables">
|
||||||
<wc-checkbox readonly value="table">单字库</wc-checkbox>
|
<wc-checkbox readonly value="2312">GB2312</wc-checkbox>
|
||||||
|
<wc-checkbox value="gbk">GBK</wc-checkbox>
|
||||||
<wc-checkbox readonly value="words">词组库</wc-checkbox>
|
<wc-checkbox readonly value="words">词组库</wc-checkbox>
|
||||||
<wc-checkbox readonly value="dy">异形字库</wc-checkbox>
|
<wc-checkbox readonly value="dy">异形字库</wc-checkbox>
|
||||||
<wc-checkbox value="emoji">emoji</wc-checkbox>
|
<wc-checkbox value="emoji">emoji</wc-checkbox>
|
||||||
|
|
70
js/index.js
70
js/index.js
|
@ -15,11 +15,15 @@ import '//unpkg.yutent.top/@bytedo/wcui/dist/form/switch.js'
|
||||||
import fetch from '//unpkg.yutent.top/@bytedo/fetch/dist/index.js'
|
import fetch from '//unpkg.yutent.top/@bytedo/fetch/dist/index.js'
|
||||||
|
|
||||||
import { Enum } from './lib/core.js'
|
import { Enum } from './lib/core.js'
|
||||||
import FIXED_18030 from './lib/18030.js'
|
import FIXED_86F from './lib/86_fixed.js'
|
||||||
|
|
||||||
|
const VER_86 = '86'
|
||||||
|
const VER_86F = '86f'
|
||||||
|
|
||||||
const WB_CODE_NAME = { 1: '一级简码', 2: '二级简码', 3: '三级简码', 4: '四级简码' }
|
const WB_CODE_NAME = { 1: '一级简码', 2: '二级简码', 3: '三级简码', 4: '四级简码' }
|
||||||
const WB_TABLE = new Enum()
|
const WB_TABLE_2312 = new Enum()
|
||||||
const WB_TABLE_18030 = new Enum(FIXED_18030)
|
const WB_TABLE_GBK = new Enum()
|
||||||
|
const WB_TABLE_86F = new Enum(FIXED_86F)
|
||||||
const WB_WORDS = new Enum()
|
const WB_WORDS = new Enum()
|
||||||
const WB_DY = new Enum()
|
const WB_DY = new Enum()
|
||||||
const WB_EMOJI = new Enum()
|
const WB_EMOJI = new Enum()
|
||||||
|
@ -27,40 +31,52 @@ const WB_EMOJI = new Enum()
|
||||||
Anot({
|
Anot({
|
||||||
$id: 'app',
|
$id: 'app',
|
||||||
state: {
|
state: {
|
||||||
single: 0,
|
gb2312: 0,
|
||||||
|
gbk: 0,
|
||||||
words: 0,
|
words: 0,
|
||||||
dy: 0,
|
dy: 0,
|
||||||
emoji: 0,
|
emoji: 0,
|
||||||
result: '',
|
result: '',
|
||||||
filter: {
|
filter: {
|
||||||
text: '',
|
text: '',
|
||||||
version: '86'
|
version: VER_86
|
||||||
},
|
},
|
||||||
dlOpt: {
|
dlOpt: {
|
||||||
pos: 'front',
|
pos: 'front',
|
||||||
version: '86',
|
version: VER_86,
|
||||||
reverse: true,
|
reverse: true,
|
||||||
pinyin: true,
|
pinyin: true,
|
||||||
tables: ['table', 'words', 'dy']
|
tables: ['2312', 'words', 'dy']
|
||||||
},
|
},
|
||||||
preview: ''
|
preview: ''
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
fetch('./data/table.txt').then(r => r.text()),
|
fetch('./data/gb2312.txt').then(r => r.text()),
|
||||||
|
fetch('./data/gbk.txt').then(r => r.text()),
|
||||||
fetch('./data/words.txt').then(r => r.text()),
|
fetch('./data/words.txt').then(r => r.text()),
|
||||||
fetch('./data/dy.txt').then(r => r.text()),
|
fetch('./data/dy.txt').then(r => r.text()),
|
||||||
fetch('./data/emoji.txt').then(r => r.text())
|
fetch('./data/emoji.txt').then(r => r.text())
|
||||||
]).then(([table, words, dy, emoji]) => {
|
]).then(([gb2312, gbk, words, dy, emoji]) => {
|
||||||
//
|
//
|
||||||
|
|
||||||
table.split('\n').forEach(it => {
|
gb2312.split('\n').forEach(it => {
|
||||||
it = it.split(' ')
|
it = it.split(' ')
|
||||||
|
|
||||||
let k = it.shift()
|
let k = it.shift()
|
||||||
|
|
||||||
if (k) {
|
if (k) {
|
||||||
WB_TABLE.add(k, it)
|
WB_TABLE_2312.add(k, it)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
gbk.split('\n').forEach(it => {
|
||||||
|
it = it.split(' ')
|
||||||
|
|
||||||
|
let k = it.shift()
|
||||||
|
|
||||||
|
if (k) {
|
||||||
|
WB_TABLE_GBK.add(k, it)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -94,7 +110,8 @@ Anot({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.single = WB_TABLE.length
|
this.gb2312 = WB_TABLE_2312.length
|
||||||
|
this.gbk = WB_TABLE_GBK.length
|
||||||
this.words = WB_WORDS.length
|
this.words = WB_WORDS.length
|
||||||
this.dy = WB_DY.length
|
this.dy = WB_DY.length
|
||||||
this.emoji = WB_EMOJI.length
|
this.emoji = WB_EMOJI.length
|
||||||
|
@ -105,7 +122,7 @@ Anot({
|
||||||
search() {
|
search() {
|
||||||
var { text, version } = this.filter
|
var { text, version } = this.filter
|
||||||
var reverse = false
|
var reverse = false
|
||||||
var res, res18030
|
var res, resf
|
||||||
|
|
||||||
text = text.trim().toLowerCase()
|
text = text.trim().toLowerCase()
|
||||||
|
|
||||||
|
@ -121,28 +138,31 @@ Anot({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reverse || text.length === 1) {
|
if (reverse || text.length === 1) {
|
||||||
res = [WB_TABLE.get(text)]
|
res = [WB_TABLE_2312.get(text) || WB_TABLE_GBK.get(text)]
|
||||||
if (version === '18030') {
|
if (version === VER_86F) {
|
||||||
res18030 = [WB_TABLE_18030.get(text)]
|
resf = [WB_TABLE_86F.get(text)]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res = text.split('').map(t => WB_TABLE.get(t))
|
res = text.split('').map(t => WB_TABLE_2312.get(t) || WB_TABLE_GBK.get(t))
|
||||||
if (version === '18030') {
|
if (version === VER_86F) {
|
||||||
res18030 = text.split('').map(t => WB_TABLE_18030.get(t))
|
resf = text.split('').map(t => WB_TABLE_86F.get(t))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
text = text.toUpperCase()
|
text = text.toUpperCase()
|
||||||
// 反查时, 直接替换结果
|
// 反查时, 直接替换结果
|
||||||
if (res18030 && res18030[0]) {
|
if (resf && resf[0]) {
|
||||||
res = res18030
|
res = resf
|
||||||
}
|
}
|
||||||
if (res[0]) {
|
if (res[0]) {
|
||||||
res = `【 ${text} 】👉\t${res[0]
|
res = `【 ${text} 】👉\t${res[0]
|
||||||
.map(
|
.map(
|
||||||
t =>
|
t =>
|
||||||
`${t}(${(res18030 && res18030[0] ? WB_TABLE_18030.get(t) : WB_TABLE.get(t))
|
`${t}(${(resf && resf[0]
|
||||||
|
? WB_TABLE_86F.get(t)
|
||||||
|
: WB_TABLE_2312.get(t) || WB_TABLE_GBK.get(t)
|
||||||
|
)
|
||||||
.join('、')
|
.join('、')
|
||||||
.toUpperCase()})`
|
.toUpperCase()})`
|
||||||
)
|
)
|
||||||
|
@ -151,8 +171,8 @@ Anot({
|
||||||
res = `【 ${text} 】👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库。`
|
res = `【 ${text} 】👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库。`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (res18030) {
|
if (resf) {
|
||||||
res18030.forEach((it, i) => {
|
resf.forEach((it, i) => {
|
||||||
if (it) {
|
if (it) {
|
||||||
res[i] = it
|
res[i] = it
|
||||||
}
|
}
|
||||||
|
@ -191,7 +211,7 @@ Anot({
|
||||||
for (let it of arr) {
|
for (let it of arr) {
|
||||||
it = it.replace(/[\w\s\t]+/g, '')
|
it = it.replace(/[\w\s\t]+/g, '')
|
||||||
all.add(it)
|
all.add(it)
|
||||||
if (!WB_TABLE.get(it) && !WB_WORDS.get(it) && !WB_DY.get(it)) {
|
if (!WB_TABLE_2312.get(it) && !WB_WORDS.get(it) && !WB_DY.get(it)) {
|
||||||
unknow.add(it)
|
unknow.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,10 +60,8 @@ export class Enum {
|
||||||
var v = this.#dict_k[k]
|
var v = this.#dict_k[k]
|
||||||
if (v) {
|
if (v) {
|
||||||
delete this.#dict_k[k]
|
delete this.#dict_k[k]
|
||||||
if (Array.isArray(v)) {
|
for (let t of v) {
|
||||||
for (let t of v) {
|
delete this.#dict_v[t]
|
||||||
delete this.#dict_v[t]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.length--
|
this.length--
|
||||||
}
|
}
|
||||||
|
@ -87,7 +85,16 @@ export class Enum {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString(forV) {
|
||||||
return JSON.stringify(this.#dict_k)
|
var dict = forV ? this.#dict_v : this.#dict_k
|
||||||
|
var text = ''
|
||||||
|
for (let k in dict) {
|
||||||
|
text += `${k} ${dict[k].join(' ')}\n`
|
||||||
|
}
|
||||||
|
return text.trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson(forV) {
|
||||||
|
return JSON.stringify(forV ? this.#dict_v : this.#dict_k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue