mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-18 23:52:51 -06:00
gr F ? ?
This commit is contained in:
2
bin/jgf2
2
bin/jgf2
@@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# change the value of GFHOME to the directory where you have the gf binary
|
# change the value of GFHOME to the directory where you have the gf binary
|
||||||
GFHOME=/home/aarne/GF2/bin
|
GFHOME=/home/aarne/GF/bin
|
||||||
|
|
||||||
JGUILIB=$GFHOME/java/
|
JGUILIB=$GFHOME/java/
|
||||||
GF=$GFHOME/gf2
|
GF=$GFHOME/gf2
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import Compile
|
|||||||
---- import GFTex
|
---- import GFTex
|
||||||
import TeachYourself -- also a subshell
|
import TeachYourself -- also a subshell
|
||||||
|
|
||||||
|
import Randomized ---
|
||||||
|
import Editing (goFirstMeta) ---
|
||||||
|
|
||||||
import ShellState
|
import ShellState
|
||||||
import Option
|
import Option
|
||||||
import Information
|
import Information
|
||||||
@@ -24,6 +27,8 @@ import PrGrammar
|
|||||||
|
|
||||||
import Monad (foldM)
|
import Monad (foldM)
|
||||||
import System (system)
|
import System (system)
|
||||||
|
import Random (newStdGen) ----
|
||||||
|
import Zipper ----
|
||||||
|
|
||||||
import Operations
|
import Operations
|
||||||
import UseIO
|
import UseIO
|
||||||
@@ -168,9 +173,19 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = case comm of
|
|||||||
CTranslate il ol -> do
|
CTranslate il ol -> do
|
||||||
let a' = opST2CommandArg (optParseArgErr opts (sgr il)) a
|
let a' = opST2CommandArg (optParseArgErr opts (sgr il)) a
|
||||||
returnArg (opTS2CommandArg (optLinearizeTreeVal opts (sgr ol)) a') sa
|
returnArg (opTS2CommandArg (optLinearizeTreeVal opts (sgr ol)) a') sa
|
||||||
CGenerateRandom n -> do
|
CGenerateRandom n -> case a of
|
||||||
|
ASTrm _ -> do
|
||||||
|
case s2t a of
|
||||||
|
ATrms [trm] -> do
|
||||||
|
g <- newStdGen
|
||||||
|
case (goFirstMeta (tree2loc trm) >>= refineRandom g 41 cgr) of
|
||||||
|
Ok trm' -> returnArg (ATrms [loc2tree trm']) sa
|
||||||
|
Bad s -> returnArg (AError s) sa
|
||||||
|
_ -> returnArg a sa
|
||||||
|
_ -> do
|
||||||
ts <- randomTreesIO opts gro (optIntOrN opts flagNumber n)
|
ts <- randomTreesIO opts gro (optIntOrN opts flagNumber n)
|
||||||
returnArg (ATrms ts) sa
|
returnArg (ATrms ts) sa
|
||||||
|
|
||||||
CPutTerm -> changeArg (opTT2CommandArg (optTermCommand opts gro) . s2t) sa
|
CPutTerm -> changeArg (opTT2CommandArg (optTermCommand opts gro) . s2t) sa
|
||||||
----- CWrapTerm f -> changeArg (opTT2CommandArg (return . wrapByFun opts gro f)) sa
|
----- CWrapTerm f -> changeArg (opTT2CommandArg (return . wrapByFun opts gro f)) sa
|
||||||
CMorphoAnalyse -> changeArg (AString . morphoAnalyse opts gro . prCommandArg) sa
|
CMorphoAnalyse -> changeArg (AString . morphoAnalyse opts gro . prCommandArg) sa
|
||||||
@@ -229,6 +244,7 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = case comm of
|
|||||||
gro = grammarOfOptState opts st
|
gro = grammarOfOptState opts st
|
||||||
opts = addOptions opts0 (globalOptions st)
|
opts = addOptions opts0 (globalOptions st)
|
||||||
src = srcModules st
|
src = srcModules st
|
||||||
|
cgr = canModules st
|
||||||
|
|
||||||
s2t a = case a of
|
s2t a = case a of
|
||||||
ASTrm s -> err AError (ATrms . return) $ string2treeErr gro s
|
ASTrm s -> err AError (ATrms . return) $ string2treeErr gro s
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ pCommand ws = case ws of
|
|||||||
"p" : s -> aString CParse s
|
"p" : s -> aString CParse s
|
||||||
"t" : i:o: s -> aString (CTranslate (language i) (language o)) s
|
"t" : i:o: s -> aString (CTranslate (language i) (language o)) s
|
||||||
"gr" : [] -> aUnit (CGenerateRandom 1)
|
"gr" : [] -> aUnit (CGenerateRandom 1)
|
||||||
"gr" : n : [] -> aUnit (CGenerateRandom (readIntArg n)) -- deprecated 12/5/2001
|
"gr" : t -> aTerm (CGenerateRandom 1) t
|
||||||
|
--- "gr" : n : [] -> aUnit (CGenerateRandom (readIntArg n)) -- deprecated 12/5/2001
|
||||||
"pt" : s -> aTerm CPutTerm s
|
"pt" : s -> aTerm CPutTerm s
|
||||||
----- "wt" : f : s -> aTerm (CWrapTerm (string2id f)) s
|
----- "wt" : f : s -> aTerm (CWrapTerm (string2id f)) s
|
||||||
"ma" : s -> aString CMorphoAnalyse s
|
"ma" : s -> aString CMorphoAnalyse s
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module Today where today = "Tor Apr 29 09:41:39 CEST 2004"
|
module Today where today = "Fri Apr 30 07:57:27 CEST 2004"
|
||||||
|
|||||||
Reference in New Issue
Block a user