[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Sun, 29 Feb 2004 15:00:33 +0000 (UTC) 
Subject:sort() 
From:kangaroo232002 
Volume-ID: 

many thanks to everyone who replied to my last query concerning elements in
lists, the help was much appreciated, all the methods suggested worked very
well, and are hopefully being utilised efficiently in my parser...

Hopefully a slightly simpler problem this time. i have decided to add cost
to my parse, and so now i have a list of lists

[[DET N V PREP 25] [DET V N PREP 72] [DET N N PREP 35]] .

I would like to use sort() if it was possible, but obviously using it on
this list i get an 'alphabefore' error. Is there a way of sorting the
elements in the list in relation to the number at the end of each of the
elements (which represents the total cost of the particular parse). In this
example I would receive a list along the lines of either

[[DET N V PREP 25] [DET N N PREP 35] [DET V N PREP 72]]

or the other way round. I apologise in advance if this is very simple!

Many thanks,
Ian.