
Hello, Apologies for the late reply but I had to prep the code. On 10/28/2011 09:43 AM, Daniel Fischer wrote:
On Thursday 27 October 2011, 17:02:46, Hugo Ferreira wrote:
But something seems to be wrong here. If I do:
scoreRule_ r zs = Z.foldlz' (scoreElem r) (0, 0) zs where scoreElem r s z = let (nCorrect, nIncorrect) = s in case ruleApplication r z of Just tag -> if tag == correct then (nCorrect+1, nIncorrect) else (nCorrect, nIncorrect+1) Nothing -> (nCorrect, nIncorrect) where c = Z.cursor z (correct,_) = c
it works correctly, however this does not work:
scoreRule_ r zs = Z.foldlz' (scoreElem r) (0, 0) zs where scoreElem r (!nCorrect, !nIncorrect) z = case ruleApplication r z of Just tag -> if tag == correct then (nCorrect+1, nIncorrect) else (nCorrect, nIncorrect+1) Nothing -> (nCorrect, nIncorrect) where c = Z.cursor z (correct,_) = c
I have been staring at this for some time now, but cannot understand why it does not work. Any ideas?
No. Looks perfectly okay (well, the indentation is wrong, but that's the same for the working version above and is probably due to the mail client).
Not really. That's pretty much the indentation I am using. I actually had additional trace statements. Can you please tell me what's wrong?
Can you post the complete source for diagnosis?
I have attached the code + cabal files. I think that is all that is required. I am not sending the training data because it is too large (+7 Mega bytes). That is available at http://nlpwp.org/nlpwp-data.zip TIA, Hugo F.