Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Steven D'Aprano
age[s]". There is no such list, and there never will be, because there is no limit to the number and kind of possible error messages. Instead, you should actually read the error message you see. Python is telling you what the problem is. Pay attention to it. AttributeError: 'list&

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 1:01 AM, Token Type wrote: > Thanks. By the way, do we have a list of explanations of error message? If > so, whenever we come across error message, we can refer to it and solve the > problem accordingly. Not really, but if you paste the message into Google or DuckDuckGo

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Token Type
Thanks. By the way, do we have a list of explanations of error message? If so, whenever we come across error message, we can refer to it and solve the problem accordingly. -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-10 Thread Jean-Michel Pichavant
Token Type wrote: In fact, I'm guessing that's your problem. I think you're ending up with a list of lists of strings, when you think you're getting a list of strings. Thanks. You guess right. It turns out that lemma_list is a list of list, as I tested in the previous post. I of

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
In article , Token Type wrote: > > structures are simple, just plain print will work, but for more > > > > complicated structures, pprint.pprint() is a life saver. > > > > I did try . However, > > >>> pprint.pprint(lemma_list) > > Traceback (most recent call last): > File "", line 1, in

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
In article <43a68990-d6cf-4362-8c47-b13ce780b...@googlegroups.com>, Token Type wrote: > Thanks very much for all of your tips. Take noun as an example. First, I need > find all the lemma_names in all the synsets whose pos is 'n'. Second, for > each lemma_name, I will check all their sense numb

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> structures are simple, just plain print will work, but for more > > complicated structures, pprint.pprint() is a life saver. > I did try . However, >>> pprint.pprint(lemma_list) Traceback (most recent call last): File "", line 1, in pprint.pprint(lemma_list) NameError: name 'pprint

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> In fact, I'm guessing that's your problem. I think you're ending up > > with a list of lists of strings, when you think you're getting a list of > > strings. > Thanks. You guess right. It turns out that lemma_list is a list of list, as I tested in the previous post. -- http://mail.python

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
Thanks very much for all of your tips. Take noun as an example. First, I need find all the lemma_names in all the synsets whose pos is 'n'. Second, for each lemma_name, I will check all their sense number. 1) Surely,we can know the number of synset whose pos is noun by >>> len([synset for syn

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-08 Thread Cameron Simpson
On 08Sep2012 13:45, Roy Smith wrote: | First, I don't understand this code: | | In article , | Token Type wrote: | > synset_list = list(wn.all_synsets(pos)) | > lemma_list = [synset.lemma_names for synset in synset_list] | | It looks like you're taking an iterable, converting it to a l

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-08 Thread Roy Smith
In article , Token Type wrote: > I wrote the following function to solve it. However, it pops up > "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I > supposed [synset.lemma_names for synset in synset_list] has made all the &

wordnet NLTK Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-08 Thread Token Type
en(synset_list) >>> average_polysemy('n') 3 > > I wrote the following function to solve it. However, it pops up > "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I > supposed [synset.lemma_names

AttributeError: 'list' object has no attribute 'lower'

2012-09-08 Thread Token Type
semy of nouns, verbs, adjectives, and adverbs according to WordNet.http://nltk.googlecode.com/svn/trunk/doc/book/ch02.html I wrote the following function to solve it. However, it pops up "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I supposed