no message

main
BlinkDL 3 years ago
parent f79137b524
commit 13bb641007

@ -85,13 +85,14 @@ class TOKENIZER():
self.UNKNOWN_CHAR = self.stoi[UNKNOWN_CHAR] self.UNKNOWN_CHAR = self.stoi[UNKNOWN_CHAR]
def refine_context(self, context): def refine_context(self, context):
context = context.strip().split('\n') if self.charMode:
for c in range(len(context)): context = context.strip().split('\n')
context[c] = context[c].strip().strip('\u3000').strip('\r') for c in range(len(context)):
context = list(filter(lambda c: c != '', context)) context[c] = context[c].strip().strip('\u3000').strip('\r')
context = '\n' + ('\n'.join(context)).strip() context = list(filter(lambda c: c != '', context))
if context == '': context = '\n' + ('\n'.join(context)).strip()
context = '\n' if context == '':
context = '\n'
return context return context

Loading…
Cancel
Save