1
0
forked from GitHub/gf-core

ml and tl

This commit is contained in:
aarne
2005-05-17 11:37:17 +00:00
parent 9b42aff901
commit b12608fb09
6 changed files with 81 additions and 32 deletions

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/05/12 10:03:33 $
-- > CVS $Date: 2005/05/17 12:37:17 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.3 $
-- > CVS $Revision: 1.4 $
--
-- Help on shell commands. Generated from HelpFile by 'make help'.
-- PLEASE DON'T EDIT THIS FILE.
@@ -339,11 +339,13 @@ txtHelpFile =
"\n examples:" ++
"\n tq -cat=NP TestResourceEng TestResourceSwe -- quiz for NPs" ++
"\n" ++
"\ntl, translation_list: tl Lang Lang Int" ++
"\n Random-generates a list of Int translation exercises from Lang1 to Lang2." ++
"\ntl, translation_list: tl Lang Lang" ++
"\n Random-generates a list of ten translation exercises from Lang1" ++
"\n to Lang2. The number can be changed by a flag." ++
"\n HINT: use wf to save the exercises in a file." ++
"\n flags:" ++
"\n -cat" ++
"\n -number" ++
"\n examples:" ++
"\n tl -cat=NP TestResourceEng TestResourceSwe -- quiz list for NPs" ++
"\n" ++
@@ -359,13 +361,14 @@ txtHelpFile =
"\n examples:" ++
"\n mq -cat=N -lang=TestResourceSwe -- quiz for Swedish nouns" ++
"\n" ++
"\nml, morphology_list: ml Int" ++
"\n Random-generates a list of Int morphological exercises," ++
"\n keeping score of success." ++
"\nml, morphology_list: ml" ++
"\n Random-generates a list of ten morphological exercises," ++
"\n keeping score of success. The number can be changed with a flag." ++
"\n HINT: use wf to save the exercises in a file." ++
"\n flags:" ++
"\n -cat" ++
"\n -lang" ++
"\n -number" ++
"\n examples:" ++
"\n ml -cat=N -lang=TestResourceSwe -- quiz list for Swedish nouns" ++
"\n" ++

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/05/12 10:03:33 $
-- > CVS $Date: 2005/05/17 12:37:17 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.21 $
-- > CVS $Revision: 1.22 $
--
-- parsing GF shell commands. AR 11\/11\/2001
-----------------------------------------------------------------------------
@@ -104,9 +104,9 @@ pCommand ws = case ws of
"so" : s -> aUnit $ CShowOpers $ unwords s
"tq" : i:o:[] -> aUnit (CTranslationQuiz (language i) (language o))
"tl":i:o:n:[] -> aUnit (CTranslationList (language i) (language o) (readIntArg n))
"tl":i:o:[] -> aUnit (CTranslationList (language i) (language o))
"mq" : [] -> aUnit CMorphoQuiz
"ml" : n : [] -> aUnit (CMorphoList (readIntArg n))
"ml" : [] -> aUnit CMorphoList
"wf" : f : s -> aString (CWriteFile f) s
"af" : f : s -> aString (CAppendFile f) s

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/05/13 12:40:20 $
-- > CVS $Author: peb $
-- > CVS $Revision: 1.34 $
-- > CVS $Date: 2005/05/17 12:37:17 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.35 $
--
-- The datatype of shell commands and the list of their options.
-----------------------------------------------------------------------------
@@ -53,9 +53,9 @@ data Command =
| CShowOpers String
| CTranslationQuiz Language Language
| CTranslationList Language Language Int
| CTranslationList Language Language
| CMorphoQuiz
| CMorphoList Int
| CMorphoList
| CReadFile FilePath
| CWriteFile FilePath
@@ -180,9 +180,9 @@ optionsOfCommand co = case co of
CShowOpers _ -> flags "res"
CTranslationQuiz _ _ -> flags "cat"
CTranslationList _ _ _ -> flags "cat"
CTranslationList _ _ -> flags "cat number"
CMorphoQuiz -> flags "cat lang"
CMorphoList _ -> flags "cat lang"
CMorphoList -> flags "cat lang number"
CReadFile _ -> none
CWriteFile _ -> none