Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Streaming example output stuck words #560

Closed
fabianoluzbr opened this issue Apr 19, 2021 · 1 comment
Closed

Streaming example output stuck words #560

fabianoluzbr opened this issue Apr 19, 2021 · 1 comment

Comments

@fabianoluzbr
Copy link

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

@fabianoluzbr
Copy link
Author

fabianoluzbr commented Apr 20, 2021

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())

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant