File tree Expand file tree Collapse file tree 1 file changed +34
-20
lines changed Expand file tree Collapse file tree 1 file changed +34
-20
lines changed Original file line number Diff line number Diff line change @@ -30,31 +30,45 @@ def __init__(self, rm_space=False):
30
30
self .t2s = {}
31
31
self .s2t = {}
32
32
self .rmSpace = rm_space
33
+ self .isOther = self .is_X (self .otherSet )
34
+ self .isSinglePun = self .is_X (self .singlePunSet )
35
+ self .isHttp = self .is_X (self .httpSet )
36
+ self .isModalParticleSet = self .is_X (self .modalParticleSet )
33
37
34
38
35
- def isOther (self , c ):
36
- if (c in self .otherSet ):
37
- return True
38
- else :
39
- return False
39
+ def is_X (self , charType ):
40
+ def func (c ):
41
+ if (c in charType ):
42
+ return True
43
+ else :
44
+ return False
45
+ return func
46
+
47
+
48
+
49
+ # def isOther(self, c):
50
+ # if(c in self.otherSet):
51
+ # return True
52
+ # else:
53
+ # return False
40
54
41
- def isSinglePun (self , c ):
42
- if (c in self .singlePunSet ):
43
- return True
44
- else :
45
- return False
55
+ # def isSinglePun(self, c):
56
+ # if(c in self.singlePunSet):
57
+ # return True
58
+ # else:
59
+ # return False
46
60
47
- def isHttp (self , c ):
48
- if (c in self .httpSet ):
49
- return True
50
- else :
51
- return False
61
+ # def isHttp(self, c):
62
+ # if(c in self.httpSet):
63
+ # return True
64
+ # else:
65
+ # return False
52
66
53
- def isModalParticleSet (self , c ):
54
- if (c in self .modalParticleSet ):
55
- return True
56
- else :
57
- return False
67
+ # def isModalParticleSet(self, c):
68
+ # if(c in self.modalParticleSet):
69
+ # return True
70
+ # else:
71
+ # return False
58
72
59
73
def setT2SMap (self , filename ):
60
74
file = open (filename , "rb" )
You can’t perform that action at this time.
0 commit comments