Closed fabianoluzbr closed 3 years ago
def greedy_merge(self, s, prev_char=''): s_merged = '' count = 0 for i in range(len(s)): if s[i] != prev_char: prev_char = s[i] if prev_char != '_': if count > 20: s_merged += " "+prev_char else: s_merged += prev_char count = 0 else: if s[i] == '_': count = count + 1 return " ".join(s_merged.split())
Hi folks, can anyone tell me why the words that come out of the streaming examples stick together? For example:
Hi guyshow are you
Thanks