Esempio n. 1
0
 def match(self, model):
     ss = []
     for e in self.params:
         ss.append('、')
         ss.append(e.match(model))
     return tokibi.NChunk(*ss[1:])
Esempio n. 2
0
 def match(self, model) -> NExpr:
     value = self.params[0].match(model)
     if isinstance(value, tokibi.NLiteral) or isinstance(value, str):
         suffix = ' の'
         return tokibi.NChunk(value, f'{suffix} とき、|{suffix} 場合、')
     return value.modeCase()
Esempio n. 3
0
 def match(self, model) -> NExpr:
     value = self.params[0].match(model)
     suffix=' 間'
     if isinstance(value, tokibi.NLiteral) or isinstance(value, str):
         suffix = ' の' + suffix
     return tokibi.NChunk(value, f'{suffix}、|{suffix}、繰り返す')
Esempio n. 4
0
 def match(self, model) -> NExpr:
     left = self.params[0].match(model)
     right = self.params[1].match(model)
     return tokibi.NPhrase(tokibi.NChunk(tokibi.NContext(left, verb.THEN), 'または、|あるいは、'), right)