Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103741

Problem in creating list of lists

Newsgroups comp.lang.python
Date 2016-02-29 09:34 -0800
Message-ID <eaa322fe-a703-4688-804f-0f2ce33c022b@googlegroups.com> (permalink)
Subject Problem in creating list of lists
From subhabangalore@gmail.com

Show all headers | View raw


I have few sentences, like, 

the film was nice.  
leonardo is great. 
it was academy award.

Now I want them to be tagged with some standards which may look like,

the DT film NN was AV nice ADJ
leonardo NN is AV great ADJ
it PRP was AV academy NN award NN

I could do it but my goal is to see it as,
[[('the','DT'),('film', 'NN'),('was','AV'),('nice','ADJ')],[('leonardo','NN'),('is','AV'),('great','ADJ')],[('it','PRP'),
('was','AV'),('academy','NN'),('award','NN')]]

that is a list of lists where in each list there is a set of tuples. 
I could solve each one like I am getting 
one list with tuples, but not all within one.
As it is PoS Tagging so I am not being able to use zip.
If any one may please suggest. 

If any one may kindly suggest a solution.
Thanks in advance.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Problem in creating list of lists subhabangalore@gmail.com - 2016-02-29 09:34 -0800

csiph-web