updated 修复错误数据

This commit is contained in:
路人甲 2024-07-30 00:32:40 +08:00
parent a73f632938
commit 2c6ca7e5e2
10 changed files with 40 additions and 22 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,11 +2,18 @@
* 缓存数据
*/
import _input from './data/input.js';
import _sort from './data/sort.js';
import {modeData} from './mode.js';
let _hash = Object.assign({},modeData,_input);
let cacheData = {};
let _hash = Object.assign({},modeData);
for(let key in _input){
_hash[key] = (_hash[key]||[]).concat(_input[key]);
}
for(let key in _sort){
_hash[key] = (_hash[key]||[]).concat(_sort[key]);
}
let cacheData = {};
for(let key in _hash){
_hash[key].forEach(function(name){
if(typeof cacheData[name]=='undefined'){

View File

@ -3,8 +3,6 @@
*/
export default {
// 其他旁系
'{G2}':['祖父'],
'{G2},w':['祖母'],
'{G2},s':['父'],
'{G2},s,w':['母'],
'{G2},s,s':['兄弟'],

View File

@ -6,8 +6,12 @@ export default {
'xb,w':['兄弟媳妇','兄弟妇'],
'xs':['姐妹','亲姐妹','同胞姐妹'],
'xs,h':['姐妹夫','姊妹婿'],
'f,xb':['伯叔父','几爸爸','几爸','几爹'],
'f,xb,w':['伯叔母','几妈妈','几妈','几娘'],
'f,xb':['伯叔父'],
'f,xb,w':['伯叔母'],
'f,f,xb':['从祖祖父','从祖父'],
'f,f,xb,w':['从祖祖母','从祖母'],
'm,f,xb':['外从祖祖父'],
'm,f,xb,w':['外从祖祖母'],
'h,xb':['伯叔'],
'h,xb,w':['妯娌','娣姒','娣姒姊妹','婶子'],
};

View File

@ -55,8 +55,6 @@ export default {
'f,f,ob,w':['伯婆','姆婆','大奶奶','伯娭毑'],
'f,f,lb':['叔公','叔祖','叔翁','小爷爷','晚公','幺爷','细嗲'],
'f,f,lb,w':['叔婆','婶婆','小奶奶','叔娭毑','晚婆','幺奶'],
'f,f,xb':['伯叔祖父','从祖父','几爷爷','几大爷','几嗲','几爷','几公'],
'f,f,xb,w':['伯叔祖母','从祖母','几奶奶','几大娘','几奶','几婆'],
'f,f,xs':['姑奶奶','祖姑','姑奶','恩婆','姑娭毑'],
'f,f,xs,h':['姑爷爷','祖姑丈','恩爹','姑丈公','丈公'],
'f,m,ob':['大舅爷','大舅爹'],
@ -71,8 +69,6 @@ export default {
'm,f,ob,w':['伯外婆','外姆婆','大外婆','大姥姥','大姥奶'],
'm,f,lb':['叔外公','外叔祖','叔外祖','小外公','小姥爷','小外爷'],
'm,f,lb,w':['叔外婆','外婶婆','小外婆','小姥姥','婶姥姥','小姥奶'],
'm,f,xb':['堂外祖父','几外公','几姥爷','几外爷'],
'm,f,xb,w':['堂外祖母','几外婆','几姥姥','几姥奶','几外奶','几姥'],
'm,f,xs':['姑外婆','姑婆','恩婆'],
'm,f,xs,h':['姑外公','姑公','恩爹','外姑丈公','外丈公'],
'm,m,xb':['舅外公','舅公','舅爹'],

11
src/module/data/sort.js Normal file
View File

@ -0,0 +1,11 @@
/*
* 排序字段
*/
export default {
'f,xb':['几爸爸','几爸','几爹'],
'f,xb,w':['几妈妈','几妈','几娘'],
'f,f,xb':['几爷爷','几大爷','几嗲','几爷','几公'],
'f,f,xb,w':['几奶奶','几大娘','几奶','几婆'],
'm,f,xb':['几外公','几姥爷','几外爷'],
'm,f,xb,w':['几外婆','几姥姥','几姥奶','几外奶','几姥'],
};

View File

@ -2,6 +2,7 @@
* 标识符 - 唯一性关系链关系链转换成中文表述
*/
import _pair from './data/pair.js';
import _sort from './data/sort.js';
import {number2zh} from './unit.js';
import {selector2id} from './selector.js';
@ -99,9 +100,12 @@ export function getItemsById(id){
let num = id.match(/&([\d]+)(,[hw])?$/)[1];
let zh = number2zh(num);
id = id.replace(/&\d+/g,'');
if(modeData[id]){
let item = '';
if(_sort[id]){
let item = _sort[id][0].replace('几',zh);
items.push(item);
}else if(modeData[id]){
let gen = getGenById(id);
let item = '';
if(gen<3&&!id.match(/[hw],/)){
modeData[id].forEach(function(name){
if(!item&&name.includes('几')){
@ -112,8 +116,6 @@ export function getItemsById(id){
item = modeData[id][0];
item = item.match(/^[大小]/)?item.replace(/^[大小]/,zh):zh+item;
}
}else{
item = modeData[id][0]
}
items.push(item);
}