Thanks indeed for your tips. Now I understand the difference between tuples and
dictionaries deeper.
--
http://mail.python.org/mailman/listinfo/python-list
yes, thanks all your tips. I did try sorted with itemgetter. However, the
sorted results are same as follows whether I set reverse=True or reverse=
False. Isn't it strange? Thanks.
import nltk
from nltk.corpus import wordnet as wn
pairs = {'car':'automobile', 'gem':'jewel',
Dear all, the problem has been solved as follows. Thanks anyway:
import nltk
from nltk.corpus import wordnet as wn
pairs = {'car':'automobile', 'gem':'jewel', 'journey':'voyage'}
list_simi=[]
for key in pairs:
word1 = wn.synset(str(key) + '.n.01')
word2 =
On Mon, Oct 8, 2012 at 9:13 PM, Token Type typeto...@gmail.com wrote:
yes, thanks all your tips. I did try sorted with itemgetter. However, the
sorted results are same as follows whether I set reverse=True or reverse=
False. Isn't it strange? Thanks.
First of all, sorted does not sort the
On Oct 9, 1:13 pm, Token Type typeto...@gmail.com wrote:
yes, thanks all your tips. I did try sorted with itemgetter.
However, the sorted results are same as follows whether I
set reverse=True or reverse= False. Isn't it strange? Thanks.
That's because you're sorting each entry individually,
Thanks indeed for all your suggestions. When I try my above codes, what puzzles
me is that when the data in the dictionary increase, some data become missing
in the sorted result. Quite odd. In the pairs, we have {'journey':'voyage'} but
in the sorted result no ('journey-voyage',0.25), which
On Oct 9, 2:16 pm, Token Type typeto...@gmail.com wrote:
When I try my above codes, what puzzles me is that when
the data in the dictionary increase, some data become
missing in the sorted result. Quite odd. In the pairs,
we have {'journey':'voyage'} but in the sorted result no (
In order to solve the following question,
http://nltk.googlecode.com/svn/trunk/doc/book/ch02.html:
★ Use one of the predefined similarity measures to score the similarity of each
of the following pairs of words. Rank the pairs in order of decreasing
similarity. How close is your ranking to the
On 07/10/2012 17:15, Token Type wrote:
In order to solve the following question,
http://nltk.googlecode.com/svn/trunk/doc/book/ch02.html:
★ Use one of the predefined similarity measures to score the similarity of each of
the following pairs of words. Rank the pairs in order of decreasing
On 10/7/2012 12:15 PM, Token Type wrote:
In this case, I need to use loop to iterate each element in the above
pairs. How can I refer to each element in the above pairs, i.e. pairs
= [(car, automobile), (gem, jewel), (journey, voyage) ]. What's the
index for 'car' and for 'automobile'? Thanks
10 matches
Mail list logo