Error in Chain of Function calls (Code Attached)

Girish Sahani girish at cse.iitb.ac.in
Fri Jun 9 04:51:22 EDT 2006


> Girish Sahani wrote:
>> Hi,
>>
>> There is a code in my main function which is something like:
>>
>>         while prunedFinal != []:
>>             prunedNew = genColocations(prunedK) ***
>>             tableInstancesNew =
>> genTableInstances(prunedNew,tableInstancesK)
>>             tiCountDict = tiCount(tableInstancesNew)
>>             tiDict = findPI(tableInstancesNew)
>>             prunedFinal = pruneTI(tiDict,pi)
>>             rulesDict = genRules(prunedFinal)
>>             cpDict = findCP(rulesDict)
>>             prunedRulesList = pruneCP(cpDict,cp)
>>             prunedK = prunedFinal
>>             tableInstancesK = tableInstancesNew
>>         else:
>>             return prunedRulesList
>>
>> prunedK and tableInstancesK are defined in the main function.
>
> defined as what ? functions, strings, lists, classes, ... ?
PrunedK is a list that contains 2 length strings and tableInstancesK is a
dictionary,its keys are 2 length strings and values are lists of lists
>
>> Before the
>> main function, i have defined the other functions such as
>> genColocations,genTableInstances,etc. Output of genColocations is to be
>> given to the next function genTableInstances,output of this function to
>> tiCount and findPI, and so on.
>> However i am getting an error at the line marked with ***.
>
> Which error ? How do you hope us to be of any help here if you don't *at
> least* provide the full traceback ? FWIW, the canonical way to do things
> is to:
> - provide minimal *runnable* code exposing the problem
> - explain what you hoped to get
> - explain what you got instead (including full traceback)
>
> As a matter of fact, it's often the case that one solves the problem
> when working on the first point !-)
>
> (snip)
Ohh...I was thinking that posting the whole code would not be a good idea.
The error i get above is:
line 266, in colocationMiner
prunedNew = genColocations(prunedK)

 Anyways, i've attached the file colocations.py. The expected output is a
List of rules (prunedRulesList).These rules are themselves lists.e.g
['ab','c'] denotes the rule ab=>c.
Please do have a look if you have time :).
>
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in 'onurb at xiludom.gro'.split('@')])"
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: colocation.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20060609/bd627afe/attachment.ksh>


More information about the Python-list mailing list