mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
ml and tl
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/05/17 11:20:25 $
|
||||
-- > CVS $Author: peb $
|
||||
-- > CVS $Revision: 1.37 $
|
||||
-- > CVS $Date: 2005/05/17 12:37:17 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.38 $
|
||||
--
|
||||
-- GF shell command interpreter.
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -232,15 +232,17 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
|
||||
CTranslationQuiz il ol -> do
|
||||
warnDiscont opts
|
||||
justOutput opts (teachTranslation opts (sgr il) (sgr ol)) sa
|
||||
CTranslationList il ol n -> do
|
||||
warnDiscont opts
|
||||
CTranslationList il ol -> do
|
||||
warnDiscont opts
|
||||
let n = optIntOrN opts flagNumber 10
|
||||
qs <- transTrainList opts (sgr il) (sgr ol) (toInteger n)
|
||||
returnArg (AString $ foldr (+++++) [] [unlines (s:ss) | (s,ss) <- qs]) sa
|
||||
|
||||
CMorphoQuiz -> do
|
||||
warnDiscont opts
|
||||
justOutput opts (teachMorpho opts gro) sa
|
||||
CMorphoList n -> do
|
||||
CMorphoList -> do
|
||||
let n = optIntOrN opts flagNumber 10
|
||||
warnDiscont opts
|
||||
qs <- useIOE [] $ morphoTrainList opts gro (toInteger n)
|
||||
returnArg (AString $ foldr (+++++) [] [unlines (s:ss) | (s,ss) <- qs]) sa
|
||||
|
||||
@@ -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" ++
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
13
src/HelpFile
13
src/HelpFile
@@ -310,11 +310,13 @@ tq, translation_quiz: tq Lang Lang
|
||||
examples:
|
||||
tq -cat=NP TestResourceEng TestResourceSwe -- quiz for NPs
|
||||
|
||||
tl, translation_list: tl Lang Lang Int
|
||||
Random-generates a list of Int translation exercises from Lang1 to Lang2.
|
||||
tl, translation_list: tl Lang Lang
|
||||
Random-generates a list of ten translation exercises from Lang1
|
||||
to Lang2. The number can be changed by a flag.
|
||||
HINT: use wf to save the exercises in a file.
|
||||
flags:
|
||||
-cat
|
||||
-number
|
||||
examples:
|
||||
tl -cat=NP TestResourceEng TestResourceSwe -- quiz list for NPs
|
||||
|
||||
@@ -330,13 +332,14 @@ mq, morphology_quiz: mq
|
||||
examples:
|
||||
mq -cat=N -lang=TestResourceSwe -- quiz for Swedish nouns
|
||||
|
||||
ml, morphology_list: ml Int
|
||||
Random-generates a list of Int morphological exercises,
|
||||
keeping score of success.
|
||||
ml, morphology_list: ml
|
||||
Random-generates a list of ten morphological exercises,
|
||||
keeping score of success. The number can be changed with a flag.
|
||||
HINT: use wf to save the exercises in a file.
|
||||
flags:
|
||||
-cat
|
||||
-lang
|
||||
-number
|
||||
examples:
|
||||
ml -cat=N -lang=TestResourceSwe -- quiz list for Swedish nouns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user