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&
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
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
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
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
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
> 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
> 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
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
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
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
&
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
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
13 matches
Mail list logo