I have a string:
[('I', 'PRP'), ('have', 'VBP'), ('lost', 'VBN'), ('a', 'DT'), ('pant', 'NN')]
Now I need to take the words in between single quotes in an array. as example:
array1[0] = I array1[1] = PRP array1[2] = have array1[3] = VBP And so on ...
The number of entries [assuming ('x', 'y') makes an entry] is variable in the original string. And the array needs to be a string array, not something like numpy ndarray. Now, how to do that with Python?
I also have a List object just like the original string. If the same result can be achieved by processing the list object, that would also work fine.