Skip to content

Commit b5faf0a

Browse files
committed
add zidian config for kangxi
1 parent 3743834 commit b5faf0a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

configs.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ var simple1={
4545
}
4646

4747
}
48+
var zidian1={ //for single character search
49+
func:{
50+
tokenize:tokenizers.simple
51+
,setNormalizeTable:setNormalizeTable
52+
,normalize: normalize1
53+
,isSkip: isSkip1
54+
}
55+
}
4856
var tibetan1={
4957
func:{
5058
tokenize:tokenizers.tibetan
@@ -53,4 +61,4 @@ var tibetan1={
5361
,isSkip:isSkip_tibetan
5462
}
5563
}
56-
module.exports={"simple1":simple1,"tibetan1":tibetan1}
64+
module.exports={"simple1":simple1,"tibetan1":tibetan1,"zidian1":zidian1};

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ var getAPI=function(config) {
2525
config=config||config_simple;
2626
var func=configs[config].func;
2727
func.optimize=optimize;
28-
if (config=="simple1") {
29-
//add common custom function here
30-
} else if (config=="tibetan1") {
3128

32-
} else throw "config "+config +"not supported";
29+
if (!configs[config]) {
30+
throw "config "+config +"not supported";
31+
}
3332

3433
return func;
3534
}

0 commit comments

Comments
 (0)