EmilStenstrom / conllu

A CoNLL-U parser that takes a CoNLL-U formatted string and turns it into a nested python dictionary.
MIT License
311 stars 50 forks source link

Add a `__next__()` method to `TokenList` ? #52

Closed plefebvre91 closed 3 years ago

plefebvre91 commented 3 years ago

Hi,

Maybe adding a __next__() method to the TokenList type could be interesting. Currently when the TokenList is transformed into an iterator with iter(), next(my_list) returns only the first element of the tuple (id/form/lemma/etc.).

EmilStenstrom commented 3 years ago

Hi! Yes, this would be a nice addition! Would you mind contributing a patch? Preferably with tests :)

plefebvre91 commented 3 years ago

Oups, I probably got a bit confused, it seems it already do the job :confused: (The unit test I was writing was OK before I wrote the code :expressionless: ).

EmilStenstrom commented 3 years ago

That’s a good thing!