updated 修复词义扩展出错bug
This commit is contained in:
parent
52cf8a9114
commit
ac3d7d5e1c
4
dist/relationship.min.js
vendored
4
dist/relationship.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1242,7 +1242,6 @@
|
||||
while(lists.length){
|
||||
var name = lists.shift(); //当前匹配词
|
||||
var items = []; //当前匹配词可能性
|
||||
var keywords = [name];
|
||||
for(var word in replaceMap){
|
||||
var name1 = name.replace(word,replaceMap[word]);
|
||||
var name2 = name.replace(replaceMap[word],word);
|
||||
@ -1253,6 +1252,7 @@
|
||||
keywords.push(name2);
|
||||
}
|
||||
}
|
||||
var keywords = [name];
|
||||
var getList = function(name){
|
||||
for(var filter in replaceFilter){
|
||||
var word_list = replaceFilter[filter];
|
||||
@ -1265,14 +1265,15 @@
|
||||
});
|
||||
}
|
||||
};
|
||||
keywords.forEach(getList);
|
||||
getList(name);
|
||||
// 是否存在该关系
|
||||
keywords.forEach(function(name){
|
||||
for(var i in _data){
|
||||
var value = _data[i];
|
||||
if(value.indexOf(name)>-1){
|
||||
if(_data[i].indexOf(name)>-1){
|
||||
items.push(i);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 同义词替换
|
||||
if(!items.length){
|
||||
for(var i in _data){
|
||||
|
Loading…
x
Reference in New Issue
Block a user