I have four speakers like this:
Team_A=[Fred,Bob]
Team_B=[John,Jake]
They are having a conversation and it is all represented by a string, ie. convo
=
Fred
hello
John
hi
Bob
how is it going?
Jake
we are doing fine
How do I disassemble and reassemble the string so I can split it into 2 strings, 1 string of what Team_A
said, and 1 string from what Team_A
said?
output: team_A_said="hello how is it going?"
, team_B_said="hi we are doing fine"
The lines don't matter.
I have this awful find
... then slice
code that is not scalable. Can someone suggest something else? Any libraries to help with this?
I didn't find anything in nltk
library