File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ var simple1={
45
45
}
46
46
47
47
}
48
+ var zidian1 = { //for single character search
49
+ func :{
50
+ tokenize :tokenizers . simple
51
+ , setNormalizeTable :setNormalizeTable
52
+ , normalize : normalize1
53
+ , isSkip : isSkip1
54
+ }
55
+ }
48
56
var tibetan1 = {
49
57
func :{
50
58
tokenize :tokenizers . tibetan
@@ -53,4 +61,4 @@ var tibetan1={
53
61
, isSkip :isSkip_tibetan
54
62
}
55
63
}
56
- module . exports = { "simple1" :simple1 , "tibetan1" :tibetan1 }
64
+ module . exports = { "simple1" :simple1 , "tibetan1" :tibetan1 , "zidian1" : zidian1 } ;
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ var getAPI=function(config) {
25
25
config = config || config_simple ;
26
26
var func = configs [ config ] . func ;
27
27
func . optimize = optimize ;
28
- if ( config == "simple1" ) {
29
- //add common custom function here
30
- } else if ( config == "tibetan1" ) {
31
28
32
- } else throw "config " + config + "not supported" ;
29
+ if ( ! configs [ config ] ) {
30
+ throw "config " + config + "not supported" ;
31
+ }
33
32
34
33
return func ;
35
34
}
You can’t perform that action at this time.
0 commit comments