def setup_pats(self, s): (r0, r1, r2) = rsplit(s) self.r0 = [encodew(w) for w in r0] self.r1 = [encodew(w) for w in r1] self.r2 = [encodew(w) for w in r2] self.matchpat = re.compile( r'\W*'.join(c for (c, t) in splitchars(s) if t), re.I | re.UNICODE) self.checkpat = self.matchpat return
def setup_pats(self, s): (r0,r1,r2) = rsplit(s) self.r0 = [ encodew(w) for w in r0 ] self.r1 = [ encodew(w) for w in r1 ] self.r2 = [ encodew(w) for w in r2 ] self.matchpat = re.compile( r'\W*'.join( c for (c,t) in splitchars(s) if t ), re.I | re.UNICODE) self.checkpat = self.matchpat return
def setup_pats(self, s): (r0, r1, r2) = rsplit(s) self.r0 = [encodew(w) for w in r0] self.r1 = [encodew(w) for w in r1] self.r2 = [encodew(w) for w in r2] self.matchpat = re.compile( r'\W*'.join(c for (c, t) in splitchars(s) if t), re.I | re.UNICODE) if not self.ALL_ALPHABET.match(s): self.checkpat = re.compile( r'\s*'.join( re.escape(c) for (c, t) in splitchars(s) if not c.isspace()), re.UNICODE) else: self.checkpat = self.matchpat return
def setup_pats(self, s): (r0,r1,r2) = rsplit(s) self.r0 = [ encodew(w) for w in r0 ] self.r1 = [ encodew(w) for w in r1 ] self.r2 = [ encodew(w) for w in r2 ] self.matchpat = re.compile( r'\W*'.join( c for (c,t) in splitchars(s) if t ), re.I | re.UNICODE) if not self.ALL_ALPHABET.match(s): self.checkpat = re.compile( r'\s*'.join( re.escape(c) for (c,t) in splitchars(s) if not c.isspace() ), re.UNICODE) else: self.checkpat = self.matchpat return
def splitterms_yomi(s): from utils import isplit, encodew, encodey from yomi import index_yomi for x in isplit(s): yield encodew(x) for x in index_yomi(s): yield encodey(x) return
def splitterms_normal(s): from utils import isplit, encodew for x in isplit(s): yield encodew(x) return