gchrupala / morfette

Supervised learning of morphology
BSD 2-Clause "Simplified" License
28 stars 5 forks source link

Non-exhaustive patterns in functions #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

After install, running morfette without parameters prints instructions, but any 
attempt to run a function results in:

$ ./morfette predict MODEL-DIR FOO.txt BAR.txt
morfette: src/GramLab/Morfette/Utils.hs:(209,1)-(239,34): Non-exhaustive 
patterns in function train

eval, predict, train, etc. all produce the same error (with a change in 
coordinates for the Utils.hs file)

What version of the product are you using? On what operating system?

Mac OSX 10.6.3
Haskell Platform 7.0.3
morfette 0.3.2 (I also tried 0.3.1)

Please provide any additional information below.

Original issue reported on code.google.com by katefulg...@gmail.com on 15 Dec 2011 at 7:46

GoogleCodeExporter commented 9 years ago
That's a bad error message, but the problem is that you should be calling the 
predict command like this:

morfette predict MODEL-DIR < TEST-FILE > ANALYZED-TEST-DATA

Note that there is only one argument to the command (MODEL-DIR). The input is 
read from standard input, the output written to standard output.

More details: http://sites.google.com/site/morfetteweb/quick-start

Original comment by pitekus on 15 Dec 2011 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by pitekus on 15 Dec 2011 at 11:06

GoogleCodeExporter commented 9 years ago
Hey everyone,
I'm having this error everytime I'm using the wrong dir as morfette's model 
argument.
The original poster said he coudn't get the train function to work.... maybe he 
could get the src and check the contrib directory which contains some usefull 
wrappers.

Original comment by djame.seddah@gmail.com on 15 Dec 2011 at 11:12

GoogleCodeExporter commented 9 years ago
This error should definitely not happen if the number of arguments is correct 
(even if the directory is wrong). Can you check and show an example?

Original comment by pitekus on 15 Dec 2011 at 12:32

GoogleCodeExporter commented 9 years ago
Hi Grzegorz,
I've been able to reproduce this bug which occurs in two cases
1°  there're less than 2 fields of data per line (typical case : a punct which 
lacks a lemma in a treebank (PONCT .) instead of (PONCT .@.) so if one rewrites 
the leaf to get word lemma pos, there will be only tw o fields and bang.
2°  there're more than 3 fields  (typical case :  the (X (SYM @)) line in the 
PTB which is lemmatized @^@ but as a scriot which works for french and italian 
(tr "@" "^" | tr '^' '\t') will generate 4 fields
@^@ SYM -> ^^^ SYM > \t\t\tSYM  and bang morfette crashes  (one night it took 
me to catch on my own data)
Solutions:
1) the best  : make morfette more explicit (like display the faulting line and 
some context)
2) run a checker script
http://pauillac.inria.fr/~seddah/check.pl

Original comment by djame.seddah@gmail.com on 19 Dec 2011 at 2:49

Attachments:

GoogleCodeExporter commented 9 years ago
Are we talking about the  non-exhaustive pattern match bug here? 

Original comment by pitekus on 19 Dec 2011 at 8:25

GoogleCodeExporter commented 9 years ago
Yes, but as far as I understand it's not really a bug.  this error is caused by 
wrongly formated data. The error message should just be more informative (and 
provides some context about the data that generate this error)

Original comment by djame.seddah@gmail.com on 19 Dec 2011 at 12:51

GoogleCodeExporter commented 9 years ago
OK I'll reopen this a new issue, since it's about input format and not the 
argument list to commands (error msgs for commands have been fixed already)

Original comment by pitekus on 19 Dec 2011 at 3:24