1
0
forked from GitHub/gf-core

some fixes for Shae

This commit is contained in:
aarne
2004-06-23 11:57:17 +00:00
parent e5df982c93
commit d4e30498f6
8 changed files with 193 additions and 71 deletions

View File

@@ -27,6 +27,6 @@ lin
LucasCarton = pnReg ["Lucas-Carton"] neutrum nonmasculine ; --- - LucasCarton = pnReg ["Lucas-Carton"] neutrum nonmasculine ; --- -
LaCoupole = pnReg ["La-Coupole"] neutrum nonmasculine ; LaCoupole = pnReg ["La-Coupole"] neutrum nonmasculine ;
BurgerKing = pnS ["Burger King"] neutrum nonmasculine ; BurgerKing = pnS (variants {["Burger King"] ; "BK"}) neutrum nonmasculine ;
} }

View File

@@ -336,6 +336,21 @@ oper
VPart a => gewesen ! a VPart a => gewesen ! a
} ; } ;
-- auxiliary verbs
verbumAux : (_,_,_,_ : Str) -> Verbum = \konnen,kann,kannst,gekonnt ->
let gekonn = (adjReg gekonnt).s in
table {
VInf => konnen ;
VInd Sg P1 => kann ;
VInd Sg P2 => kannst ;
VInd Sg P3 => kann ;
VInd Pl P2 => konnen ;
VInd Pl _ => konnen ;
VImp Sg => nonExist ;
VImp Pl => nonExist ;
VPart a => gekonn ! a
} ;
-- The verb "have": -- The verb "have":
verbumHaben : Verbum = let { verbumHaben : Verbum = let {

View File

@@ -92,13 +92,13 @@ lin
CanVV = CanVV =
mkVerbSimple (verbSehen "können" "kann" "gekonnt") ** {isAux = True} ; --- mkVerbSimple (verbumAux "können" "kann" "kannst" "gekonnt") ** {isAux = True} ;
CanKnowVV = CanKnowVV =
mkVerbSimple (verbSehen "können" "kann" "gekonnt") ** {isAux = True} ; --- mkVerbSimple (verbumAux "können" "kann" "kannst" "gekonnt") ** {isAux = True} ;
MustVV = MustVV =
mkVerbSimple (verbSehen "müssen" "muss" "gemusst") ** {isAux = True} ; --- mkVerbSimple (verbumAux "müssen" "muss" "musst" "gemusst") ** {isAux = True} ;
WantVV = WantVV =
mkVerbSimple (verbSehen "wollen" "will" "gewollt") ** {isAux = True} ; --- mkVerbSimple (verbumAux "wollen" "will" "willst" "gewollt") ** {isAux = True} ;
EverywhereNP = ss "überall" ; EverywhereNP = ss "überall" ;

View File

@@ -25,6 +25,7 @@ main = do
xs <- getArgs xs <- getArgs
let (os,fs) = getOptions "-" xs let (os,fs) = getOptions "-" xs
opt j = oElem j os opt j = oElem j os
st0 = optInitShellState os
case 0 of case 0 of
_ | opt getHelp -> do _ | opt getHelp -> do
@@ -32,8 +33,8 @@ main = do
_ | opt forJava -> do _ | opt forJava -> do
putStrLnFlush $ encodeUTF8 welcomeMsg putStrLnFlush $ encodeUTF8 welcomeMsg
st <- useIOE emptyShellState $ st <- useIOE st0 $
foldM (shellStateFromFiles os) emptyShellState fs foldM (shellStateFromFiles os) st0 fs
sessionLineJ True st sessionLineJ True st
return () return ()
@@ -44,15 +45,15 @@ main = do
_ | opt doBatch -> do _ | opt doBatch -> do
if opt beSilent then return () else putStrLnFlush "<gfbatch>" if opt beSilent then return () else putStrLnFlush "<gfbatch>"
st <- useIOE emptyShellState $ st <- useIOE st0 $
foldM (shellStateFromFiles os) emptyShellState fs foldM (shellStateFromFiles os) st0 fs
gfBatch (initHState st) gfBatch (initHState st)
if opt beSilent then return () else putStrLnFlush "</gfbatch>" if opt beSilent then return () else putStrLnFlush "</gfbatch>"
return () return ()
_ -> do _ -> do
putStrLnFlush $ welcomeMsg putStrLnFlush $ welcomeMsg
st <- useIOE emptyShellState $ st <- useIOE st0 $
foldM (shellStateFromFiles os) emptyShellState fs foldM (shellStateFromFiles os) st0 fs
if null fs then return () else putCPU if null fs then return () else putCPU
gfInteract (initHState st) gfInteract (initHState st)
return () return ()

View File

@@ -67,6 +67,8 @@ emptyShellState = ShSt {
statistics = [] statistics = []
} }
optInitShellState os = addGlobalOptions os emptyShellState
type Language = Ident type Language = Ident
language = identC language = identC
prLanguage = prIdent prLanguage = prIdent
@@ -225,7 +227,7 @@ greatestAbstract gr = case allAbstracts gr of
-- all resource modules -- all resource modules
allResources :: G.SourceGrammar -> [Ident] allResources :: G.SourceGrammar -> [Ident]
allResources gr = [i | (i,M.ModMod m) <- M.modules gr, M.mtype m == M.MTResource] allResources gr = [i | (i,M.ModMod m) <- M.modules gr, M.isModRes m]
-- the greatest resource in dependency order -- the greatest resource in dependency order

View File

@@ -166,7 +166,7 @@ optionsOfCommand co = case co of
CHelp _ -> opts "all" CHelp _ -> opts "all"
CImpure ICEditSession -> opts "f" CImpure ICEditSession -> opts "f"
CImpure ICTranslateSession -> both "f" "cat" CImpure ICTranslateSession -> both "f langs" "cat"
_ -> none _ -> none

View File

@@ -35,6 +35,10 @@ i, import: i File
-abs set the name used for abstract syntax (with -old option) -abs set the name used for abstract syntax (with -old option)
-cnc set the name used for concrete syntax (with -old option) -cnc set the name used for concrete syntax (with -old option)
-res set the name used for resource (with -old option) -res set the name used for resource (with -old option)
-path use the (colon-separated) search path to find modules
examples:
i English.gf -- ordinary import of Concrete
i -retain german/ParadigmsGer.gf -- import of Resource to test
* rl, remove_language: rl Language * rl, remove_language: rl Language
Takes away the language from the state. Takes away the language from the state.
@@ -42,9 +46,12 @@ i, import: i File
e, empty: e e, empty: e
Takes away all languages and resets all global flags. Takes away all languages and resets all global flags.
sf, set_flags: sf Language? Flag* sf, set_flags: sf Flag*
The values of the Flags are set for Language. If no language The values of the Flags are set for Language. If no language
is specified, the flags are set globally. is specified, the flags are set globally.
examples:
sf -nocpu -- stop showing CPU time
sf -lang=Swe -- make Swe the default concrete
s, strip: s s, strip: s
Prune the state by removing source and resource modules. Prune the state by removing source and resource modules.
@@ -65,10 +72,14 @@ pg, print_grammar: pg
flags: flags:
-printer -printer
-lang -lang
examples:
pg -printer=cf -- show the context-free skeleton
pm, print_multigrammar: pm pm, print_multigrammar: pm
Prints the current multilingual grammar into a .gfcm file. Prints the current multilingual grammar in .gfcm form.
(Automatically executes the strip command (s) before doing this.) (Automatically executes the strip command (s) before doing this.)
examples:
pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm
po, print_options: po po, print_options: po
Print what modules there are in the state. Also Print what modules there are in the state. Also
@@ -88,8 +99,8 @@ eh, execute_history: eh File
ph, print_history; ph ph, print_history; ph
Prints the commands issued during the GF session. Prints the commands issued during the GF session.
The result is readable by the eh command. The result is readable by the eh command.
HINT: write "ph | wf foo.hist" to save the history. examples:
ph | wf foo.hist" -- save the history into a file
-- linearization, parsing, translation, and computation -- linearization, parsing, translation, and computation
@@ -106,10 +117,13 @@ l, linearize: l PattList? Tree
-table show parameters -table show parameters
-struct bracketed form -struct bracketed form
-record record, i.e. explicit GF concrete syntax term -record record, i.e. explicit GF concrete syntax term
-all show all forms and variants
flags: flags:
-lang linearize in this grammar -lang linearize in this grammar
-number give this number of forms at most -number give this number of forms at most
-unlexer filter output through unlexer -unlexer filter output through unlexer
examples:
l -lang=Swe -table -- show full inflection table in Swe
p, parse: p String p, parse: p String
Shows all Trees returned for String by the actual Shows all Trees returned for String by the actual
@@ -120,18 +134,23 @@ p, parse: p String
-ign ignore unknown words when parsing -ign ignore unknown words when parsing
-raw return context-free terms in raw form -raw return context-free terms in raw form
-v verbose: give more information if parsing fails -v verbose: give more information if parsing fails
-new use an experimental method (GF 2.0; sometimes very good)
flags: flags:
-cat parse in this category -cat parse in this category
-lang parse in this grammar -lang parse in this grammar
-lexer filter input through this lexer -lexer filter input through this lexer
-parser use this context-free parsing method -parser use this context-free parsing method
-number return this many results at most -number return this many results at most
examples:
p -cat=S -new "jag är gammal" -- print an S with the new method
tt, test_tokenizer: tt String tt, test_tokenizer: tt String
Show the token list sent to the parser when String is parsed. Show the token list sent to the parser when String is parsed.
HINT: can be useful when debugging the parser. HINT: can be useful when debugging the parser.
flags: flags:
-lexer use this lexer -lexer use this lexer
examples:
tt -lexer=codelit "2*(x + 3)" -- a favourite lexer for program code
cc, compute_concrete: cc Term cc, compute_concrete: cc Term
Compute a term by concrete syntax definitions. Uses the topmost Compute a term by concrete syntax definitions. Uses the topmost
@@ -144,6 +163,8 @@ cc, compute_concrete: cc Term
and hence not a valid input to a Tree-demanding command. and hence not a valid input to a Tree-demanding command.
flags: flags:
-res use another module than the topmost one -res use another module than the topmost one
examples:
cc -res=ParadigmsFin (nLukko "hyppy") -- inflect "hyppy" with nLukko
so, show_operations: so Type so, show_operations: so Type
Show oper operations with the given value type. Uses the topmost Show oper operations with the given value type. Uses the topmost
@@ -155,6 +176,8 @@ so, show_operations: so Type
topmost resource. In that case, use appropriate qualified name. topmost resource. In that case, use appropriate qualified name.
flags: flags:
-res use another module than the topmost one -res use another module than the topmost one
examples:
so -res=ParadigmsFin ResourceFin.N -- show N-paradigms in ParadigmsFin
t, translate: t Lang Lang String t, translate: t Lang Lang String
Parses String in Lang1 and linearizes the resulting Trees in Lang2. Parses String in Lang1 and linearizes the resulting Trees in Lang2.
@@ -162,6 +185,8 @@ t, translate: t Lang Lang String
-cat -cat
-lexer -lexer
-parser -parser
examples:
t Eng Swe -cat=S "every number is even or odd"
gr, generate_random: gr Tree? gr, generate_random: gr Tree?
Generates a random Tree of a given category. If a Tree Generates a random Tree of a given category. If a Tree
@@ -172,6 +197,10 @@ gr, generate_random: gr Tree?
-lang use the abstract syntax of this grammar -lang use the abstract syntax of this grammar
-number generate this number of trees (not impl. with Tree argument) -number generate this number of trees (not impl. with Tree argument)
-depth use this number of search steps at most -depth use this number of search steps at most
examples:
gr -cat=Query -- generate in category Query
gr (PredVP ? (NegVG ?)) -- generate a random tree of this form
gr -cat=S -tr | l -- gererate and linearize
gt, generate_trees: gt Tree? gt, generate_trees: gt Tree?
Generates all trees up to a given depth. If the depth is large, Generates all trees up to a given depth. If the depth is large,
@@ -186,6 +215,10 @@ gt, generate_trees: gt Tree?
-cat generate in this category -cat generate in this category
-lang use the abstract syntax of this grammar -lang use the abstract syntax of this grammar
-number generate (at most) this number of trees -number generate (at most) this number of trees
examples:
gt -depth=10 -cat=NP -- generate all NP's to depth 10
gt (PredVP ? (NegVG ?)) -- generate all trees of this form
gt -cat=S -tr | l -- gererate and linearize
ma, morphologically_analyse: ma String ma, morphologically_analyse: ma String
Runs morphological analysis on each word in String and displays Runs morphological analysis on each word in String and displays
@@ -194,6 +227,8 @@ ma, morphologically_analyse: ma String
-short show analyses in bracketed words, instead of separate lines -short show analyses in bracketed words, instead of separate lines
flags: flags:
-lang -lang
examples:
wf Bible.txt | ma -short | wf Bible.tagged -- analyse the Bible
-- elementary generation of Strings and Trees -- elementary generation of Strings and Trees
@@ -205,6 +240,8 @@ ps, put_string: ps String
flags: flags:
-filter filter the result through this string processor -filter filter the result through this string processor
-length cut the string after this number of characters -length cut the string after this number of characters
examples:
gr -cat=Letter | l | ps -filter=text -- random letter as text
pt, put_tree: pt Tree pt, put_tree: pt Tree
Returns its argument Tree, like a specialized Unix echo. Returns its argument Tree, like a specialized Unix echo.
@@ -213,6 +250,9 @@ pt, put_tree: pt Tree
flags: flags:
-transform transform the result by this term processor -transform transform the result by this term processor
-number generate this number of terms at most -number generate this number of terms at most
examples:
p "zero is even" | pt -transform=solve -- solve ?'s in parse result
* st, show_tree: st Tree * st, show_tree: st Tree
Prints the tree as a string. Unlike pt, this command cannot be Prints the tree as a string. Unlike pt, this command cannot be
@@ -230,14 +270,17 @@ es, editing_session: es
-f Fudget GUI (necessary for Unicode; only available in X Window System) -f Fudget GUI (necessary for Unicode; only available in X Window System)
ts, translation_session: ts ts, translation_session: ts
Translates input lines from any of the actual languages to any other one. Translates input lines from any of the actual languages to all other ones.
To exit, type a full stop (.) alone on a line. To exit, type a full stop (.) alone on a line.
N.B. Exit from a Fudget session is to the Unix shell, not to GF. N.B. Exit from a Fudget session is to the Unix shell, not to GF.
HINT: Set -parser and -lexer locally in each grammar. HINT: Set -parser and -lexer locally in each grammar.
options: options:
-f Fudget GUI (necessary for Unicode; only available in X Window System) -f Fudget GUI (necessary for Unicode; only available in X Windows)
-lang prepend translation results with language names
flags: flags:
-cat -cat the parser category
examples:
ts -cat=Numeral -lang -- translate numerals, show language names
tq, translation_quiz: tq Lang Lang tq, translation_quiz: tq Lang Lang
Random-generates translation exercises from Lang1 to Lang2, Random-generates translation exercises from Lang1 to Lang2,
@@ -246,12 +289,16 @@ tq, translation_quiz: tq Lang Lang
HINT: Set -parser and -lexer locally in each grammar. HINT: Set -parser and -lexer locally in each grammar.
flags: flags:
-cat -cat
examples:
tq -cat=NP TestResourceEng TestResourceSwe -- quiz for NPs
tl, translation_list: tl Lang Lang Int tl, translation_list: tl Lang Lang Int
Random-generates a list of Int translation exercises from Lang1 to Lang2. Random-generates a list of Int translation exercises from Lang1 to Lang2.
HINT: use wf to save the exercises in a file. HINT: use wf to save the exercises in a file.
flags: flags:
-cat -cat
examples:
tl -cat=NP TestResourceEng TestResourceSwe -- quiz list for NPs
mq, morphology_quiz: mq mq, morphology_quiz: mq
Random-generates morphological exercises, Random-generates morphological exercises,
@@ -262,6 +309,8 @@ mq, morphology_quiz: mq
flags: flags:
-cat -cat
-lang -lang
examples:
mq -cat=N -lang=TestResourceSwe -- quiz for Swedish nouns
ml, morphology_list: ml Int ml, morphology_list: ml Int
Random-generates a list of Int morphological exercises, Random-generates a list of Int morphological exercises,
@@ -270,12 +319,14 @@ ml, morphology_list: ml Int
flags: flags:
-cat -cat
-lang -lang
examples:
ml -cat=N -lang=TestResourceSwe -- quiz list for Swedish nouns
-- IO related commands -- IO related commands
rf, read_file: rf File rf, read_file: rf File
Returns the contents of File as a String; error is File does not exist. Returns the contents of File as a String; error if File does not exist.
wf, write_file: wf File String wf, write_file: wf File String
Writes String into File; File is created if it does not exist. Writes String into File; File is created if it does not exist.
@@ -307,18 +358,19 @@ af, append_file: af File
HINT: pipe with 'wf Foo.tex' to generate a new Latex file. HINT: pipe with 'wf Foo.tex' to generate a new Latex file.
sa, speak_aloud: sa String sa, speak_aloud: sa String
Uses the Festival speech generator to produce speech for String. Uses the Flite speech generator to produce speech for String.
The command cupports Festival's language flag, which is sent verbatim Works for American English spelling.
to Festival, e.g. -language=spanish. Omitting this flag gives the examples:
system-dependent default voice (often British English). h | sa -- listen to the list of commands
flags: gr -cat=S | l | sa -- generate a random sentence and speak it aloud
-language
h, help: h Command? h, help: h Command?
Displays the paragraph concerning the command from this help file. Displays the paragraph concerning the command from this help file.
Without the argument, shows the first lines of all paragraphs. Without the argument, shows the first lines of all paragraphs.
options options
-all show the whole help file -all show the whole help file
examples:
h print_grammar -- show all information on the pg command
q, quit: q q, quit: q
Exits GF. Exits GF.
@@ -326,36 +378,36 @@ q, quit: q
!, system_command: ! String !, system_command: ! String
Issues a system command. No value is returned to GF. Issues a system command. No value is returned to GF.
example:
! ls
-- Flags. The availability of flags is defined separately for each command. -- Flags. The availability of flags is defined separately for each command.
-cat: category in which parsing is performed. -cat, category in which parsing is performed.
The default is S. The default is S.
-depth: the search depth in e.g. random generation. -depth, the search depth in e.g. random generation.
The default depends on application. The default depends on application.
-filter: operation performed on a string. The default is identity. -filter, operation performed on a string. The default is identity.
-filter=identity no change -filter=identity no change
-filter=erase erase the text -filter=erase erase the text
-filter=take100 show the first 100 characters -filter=take100 show the first 100 characters
-filter=length show the length of the string -filter=length show the length of the string
-filter=text format as text (punctuation, capitalization) -filter=text format as text (punctuation, capitalization)
-filter=code format as code (spacing, indentation) -filter=code format as code (spacing, indentation)
-filter=latexfile embed in a LaTeX file
-lang: grammar used when executing a grammar-dependent command. -lang, grammar used when executing a grammar-dependent command.
The default is the last-imported grammar. The default is the last-imported grammar.
-language: voice used by Festival as its --language flag in the sa command. -language, voice used by Festival as its --language flag in the sa command.
The default is system-dependent. The default is system-dependent.
-length: the maximum number of characters shown of a string. -length, the maximum number of characters shown of a string.
The default is unlimited. The default is unlimited.
-lexer: tokenization transforming a string into lexical units for a parser. -lexer, tokenization transforming a string into lexical units for a parser.
The default is words. The default is words.
-lexer=words tokens are separated by spaces or newlines -lexer=words tokens are separated by spaces or newlines
-lexer=literals like words, but GF integer and string literals recognized -lexer=literals like words, but GF integer and string literals recognized
@@ -367,14 +419,14 @@ q, quit: q
-lexer=textlit like text, but treat unknown words as string literals -lexer=textlit like text, but treat unknown words as string literals
-lexer=codeC use a C-like lexer -lexer=codeC use a C-like lexer
-number: the maximum number of generated items in a list. -number, the maximum number of generated items in a list.
The default is unlimited. The default is unlimited.
-parser: Context-free parsing algorithm. The default is chart. -parser, Context-free parsing algorithm. The default is chart.
-parser=earley Earley algorithm -parser=earley Earley algorithm
-parser=chart bottom-up chart parser -parser=chart bottom-up chart parser
-printer: format in which the grammar is printed. The default is gfc. -printer, format in which the grammar is printed. The default is gfc.
-printer=gfc GFC grammar -printer=gfc GFC grammar
-printer=gf GF grammar -printer=gf GF grammar
-printer=old old GF grammar -printer=old old GF grammar
@@ -388,9 +440,9 @@ q, quit: q
*-printer=xml XML: DTD for the pg command, object for st *-printer=xml XML: DTD for the pg command, object for st
-printer=old old GF: file readable by GF 1.2 -printer=old old GF: file readable by GF 1.2
-startcat: like -cat, but used in grammars (to avoid clash with keyword cat) -startcat, like -cat, but used in grammars (to avoid clash with keyword cat)
-transform: transformation performed on a syntax tree. The default is identity. -transform, transformation performed on a syntax tree. The default is identity.
-transform=identity no change -transform=identity no change
-transform=compute compute by using definitions in the grammar -transform=compute compute by using definitions in the grammar
-transform=typecheck return the term only if it is type-correct -transform=typecheck return the term only if it is type-correct
@@ -398,7 +450,7 @@ q, quit: q
-transform=context solve metavariables by unique refinements as variables -transform=context solve metavariables by unique refinements as variables
-transform=delete replace the term by metavariable -transform=delete replace the term by metavariable
-unlexer: untokenization transforming linearization output into a string. -unlexer, untokenization transforming linearization output into a string.
The default is unwords. The default is unwords.
-unlexer=unwords space-separated token list (like unwords) -unlexer=unwords space-separated token list (like unwords)
-unlexer=text format as text: punctuation, capitals, paragraph <p> -unlexer=text format as text: punctuation, capitals, paragraph <p>

View File

@@ -48,6 +48,10 @@ txtHelpFile =
"\n -abs set the name used for abstract syntax (with -old option)" ++ "\n -abs set the name used for abstract syntax (with -old option)" ++
"\n -cnc set the name used for concrete syntax (with -old option)" ++ "\n -cnc set the name used for concrete syntax (with -old option)" ++
"\n -res set the name used for resource (with -old option)" ++ "\n -res set the name used for resource (with -old option)" ++
"\n -path use the (colon-separated) search path to find modules" ++
"\n examples:" ++
"\n i English.gf -- ordinary import of Concrete" ++
"\n i -retain german/ParadigmsGer.gf -- import of Resource to test" ++
"\n " ++ "\n " ++
"\n* rl, remove_language: rl Language" ++ "\n* rl, remove_language: rl Language" ++
"\n Takes away the language from the state." ++ "\n Takes away the language from the state." ++
@@ -55,9 +59,12 @@ txtHelpFile =
"\ne, empty: e" ++ "\ne, empty: e" ++
"\n Takes away all languages and resets all global flags." ++ "\n Takes away all languages and resets all global flags." ++
"\n" ++ "\n" ++
"\nsf, set_flags: sf Language? Flag*" ++ "\nsf, set_flags: sf Flag*" ++
"\n The values of the Flags are set for Language. If no language" ++ "\n The values of the Flags are set for Language. If no language" ++
"\n is specified, the flags are set globally." ++ "\n is specified, the flags are set globally." ++
"\n examples:" ++
"\n sf -nocpu -- stop showing CPU time" ++
"\n sf -lang=Swe -- make Swe the default concrete" ++
"\n" ++ "\n" ++
"\ns, strip: s" ++ "\ns, strip: s" ++
"\n Prune the state by removing source and resource modules." ++ "\n Prune the state by removing source and resource modules." ++
@@ -78,10 +85,14 @@ txtHelpFile =
"\n flags: " ++ "\n flags: " ++
"\n -printer" ++ "\n -printer" ++
"\n -lang" ++ "\n -lang" ++
"\n examples:" ++
"\n pg -printer=cf -- show the context-free skeleton" ++
"\n" ++ "\n" ++
"\npm, print_multigrammar: pm" ++ "\npm, print_multigrammar: pm" ++
"\n Prints the current multilingual grammar into a .gfcm file." ++ "\n Prints the current multilingual grammar in .gfcm form." ++
"\n (Automatically executes the strip command (s) before doing this.)" ++ "\n (Automatically executes the strip command (s) before doing this.)" ++
"\n examples:" ++
"\n pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm" ++
"\n" ++ "\n" ++
"\npo, print_options: po" ++ "\npo, print_options: po" ++
"\n Print what modules there are in the state. Also" ++ "\n Print what modules there are in the state. Also" ++
@@ -101,8 +112,8 @@ txtHelpFile =
"\nph, print_history; ph" ++ "\nph, print_history; ph" ++
"\n Prints the commands issued during the GF session." ++ "\n Prints the commands issued during the GF session." ++
"\n The result is readable by the eh command." ++ "\n The result is readable by the eh command." ++
"\n HINT: write \"ph | wf foo.hist\" to save the history." ++ "\n examples:" ++
"\n" ++ "\n ph | wf foo.hist\" -- save the history into a file" ++
"\n" ++ "\n" ++
"\n-- linearization, parsing, translation, and computation" ++ "\n-- linearization, parsing, translation, and computation" ++
"\n" ++ "\n" ++
@@ -119,10 +130,13 @@ txtHelpFile =
"\n -table show parameters" ++ "\n -table show parameters" ++
"\n -struct bracketed form" ++ "\n -struct bracketed form" ++
"\n -record record, i.e. explicit GF concrete syntax term" ++ "\n -record record, i.e. explicit GF concrete syntax term" ++
"\n -all show all forms and variants" ++
"\n flags:" ++ "\n flags:" ++
"\n -lang linearize in this grammar" ++ "\n -lang linearize in this grammar" ++
"\n -number give this number of forms at most" ++ "\n -number give this number of forms at most" ++
"\n -unlexer filter output through unlexer" ++ "\n -unlexer filter output through unlexer" ++
"\n examples:" ++
"\n l -lang=Swe -table -- show full inflection table in Swe" ++
"\n" ++ "\n" ++
"\np, parse: p String" ++ "\np, parse: p String" ++
"\n Shows all Trees returned for String by the actual" ++ "\n Shows all Trees returned for String by the actual" ++
@@ -133,18 +147,23 @@ txtHelpFile =
"\n -ign ignore unknown words when parsing" ++ "\n -ign ignore unknown words when parsing" ++
"\n -raw return context-free terms in raw form" ++ "\n -raw return context-free terms in raw form" ++
"\n -v verbose: give more information if parsing fails" ++ "\n -v verbose: give more information if parsing fails" ++
"\n -new use an experimental method (GF 2.0; sometimes very good)" ++
"\n flags:" ++ "\n flags:" ++
"\n -cat parse in this category" ++ "\n -cat parse in this category" ++
"\n -lang parse in this grammar" ++ "\n -lang parse in this grammar" ++
"\n -lexer filter input through this lexer" ++ "\n -lexer filter input through this lexer" ++
"\n -parser use this context-free parsing method" ++ "\n -parser use this context-free parsing method" ++
"\n -number return this many results at most" ++ "\n -number return this many results at most" ++
"\n examples:" ++
"\n p -cat=S -new \"jag är gammal\" -- print an S with the new method" ++
"\n" ++ "\n" ++
"\ntt, test_tokenizer: tt String" ++ "\ntt, test_tokenizer: tt String" ++
"\n Show the token list sent to the parser when String is parsed." ++ "\n Show the token list sent to the parser when String is parsed." ++
"\n HINT: can be useful when debugging the parser." ++ "\n HINT: can be useful when debugging the parser." ++
"\n flags: " ++ "\n flags: " ++
"\n -lexer use this lexer" ++ "\n -lexer use this lexer" ++
"\n examples:" ++
"\n tt -lexer=codelit \"2*(x + 3)\" -- a favourite lexer for program code" ++
"\n" ++ "\n" ++
"\ncc, compute_concrete: cc Term" ++ "\ncc, compute_concrete: cc Term" ++
"\n Compute a term by concrete syntax definitions. Uses the topmost" ++ "\n Compute a term by concrete syntax definitions. Uses the topmost" ++
@@ -157,6 +176,8 @@ txtHelpFile =
"\n and hence not a valid input to a Tree-demanding command." ++ "\n and hence not a valid input to a Tree-demanding command." ++
"\n flags:" ++ "\n flags:" ++
"\n -res use another module than the topmost one" ++ "\n -res use another module than the topmost one" ++
"\n examples:" ++
"\n cc -res=ParadigmsFin (nLukko \"hyppy\") -- inflect \"hyppy\" with nLukko" ++
"\n" ++ "\n" ++
"\nso, show_operations: so Type" ++ "\nso, show_operations: so Type" ++
"\n Show oper operations with the given value type. Uses the topmost " ++ "\n Show oper operations with the given value type. Uses the topmost " ++
@@ -168,6 +189,8 @@ txtHelpFile =
"\n topmost resource. In that case, use appropriate qualified name." ++ "\n topmost resource. In that case, use appropriate qualified name." ++
"\n flags:" ++ "\n flags:" ++
"\n -res use another module than the topmost one" ++ "\n -res use another module than the topmost one" ++
"\n examples:" ++
"\n so -res=ParadigmsFin ResourceFin.N -- show N-paradigms in ParadigmsFin" ++
"\n" ++ "\n" ++
"\nt, translate: t Lang Lang String" ++ "\nt, translate: t Lang Lang String" ++
"\n Parses String in Lang1 and linearizes the resulting Trees in Lang2." ++ "\n Parses String in Lang1 and linearizes the resulting Trees in Lang2." ++
@@ -175,6 +198,8 @@ txtHelpFile =
"\n -cat" ++ "\n -cat" ++
"\n -lexer" ++ "\n -lexer" ++
"\n -parser" ++ "\n -parser" ++
"\n examples:" ++
"\n t Eng Swe -cat=S \"every number is even or odd\"" ++
"\n" ++ "\n" ++
"\ngr, generate_random: gr Tree?" ++ "\ngr, generate_random: gr Tree?" ++
"\n Generates a random Tree of a given category. If a Tree" ++ "\n Generates a random Tree of a given category. If a Tree" ++
@@ -185,6 +210,10 @@ txtHelpFile =
"\n -lang use the abstract syntax of this grammar" ++ "\n -lang use the abstract syntax of this grammar" ++
"\n -number generate this number of trees (not impl. with Tree argument)" ++ "\n -number generate this number of trees (not impl. with Tree argument)" ++
"\n -depth use this number of search steps at most" ++ "\n -depth use this number of search steps at most" ++
"\n examples:" ++
"\n gr -cat=Query -- generate in category Query" ++
"\n gr (PredVP ? (NegVG ?)) -- generate a random tree of this form" ++
"\n gr -cat=S -tr | l -- gererate and linearize" ++
"\n" ++ "\n" ++
"\ngt, generate_trees: gt Tree?" ++ "\ngt, generate_trees: gt Tree?" ++
"\n Generates all trees up to a given depth. If the depth is large," ++ "\n Generates all trees up to a given depth. If the depth is large," ++
@@ -199,6 +228,10 @@ txtHelpFile =
"\n -cat generate in this category" ++ "\n -cat generate in this category" ++
"\n -lang use the abstract syntax of this grammar" ++ "\n -lang use the abstract syntax of this grammar" ++
"\n -number generate (at most) this number of trees" ++ "\n -number generate (at most) this number of trees" ++
"\n examples:" ++
"\n gt -depth=10 -cat=NP -- generate all NP's to depth 10 " ++
"\n gt (PredVP ? (NegVG ?)) -- generate all trees of this form" ++
"\n gt -cat=S -tr | l -- gererate and linearize" ++
"\n" ++ "\n" ++
"\nma, morphologically_analyse: ma String" ++ "\nma, morphologically_analyse: ma String" ++
"\n Runs morphological analysis on each word in String and displays" ++ "\n Runs morphological analysis on each word in String and displays" ++
@@ -207,6 +240,8 @@ txtHelpFile =
"\n -short show analyses in bracketed words, instead of separate lines" ++ "\n -short show analyses in bracketed words, instead of separate lines" ++
"\n flags:" ++ "\n flags:" ++
"\n -lang" ++ "\n -lang" ++
"\n examples:" ++
"\n wf Bible.txt | ma -short | wf Bible.tagged -- analyse the Bible" ++
"\n" ++ "\n" ++
"\n" ++ "\n" ++
"\n-- elementary generation of Strings and Trees" ++ "\n-- elementary generation of Strings and Trees" ++
@@ -218,6 +253,8 @@ txtHelpFile =
"\n flags:" ++ "\n flags:" ++
"\n -filter filter the result through this string processor " ++ "\n -filter filter the result through this string processor " ++
"\n -length cut the string after this number of characters" ++ "\n -length cut the string after this number of characters" ++
"\n examples:" ++
"\n gr -cat=Letter | l | ps -filter=text -- random letter as text" ++
"\n" ++ "\n" ++
"\npt, put_tree: pt Tree" ++ "\npt, put_tree: pt Tree" ++
"\n Returns its argument Tree, like a specialized Unix echo." ++ "\n Returns its argument Tree, like a specialized Unix echo." ++
@@ -226,6 +263,9 @@ txtHelpFile =
"\n flags:" ++ "\n flags:" ++
"\n -transform transform the result by this term processor" ++ "\n -transform transform the result by this term processor" ++
"\n -number generate this number of terms at most" ++ "\n -number generate this number of terms at most" ++
"\n examples:" ++
"\n p \"zero is even\" | pt -transform=solve -- solve ?'s in parse result" ++
"\n" ++
"\n" ++ "\n" ++
"\n* st, show_tree: st Tree" ++ "\n* st, show_tree: st Tree" ++
"\n Prints the tree as a string. Unlike pt, this command cannot be" ++ "\n Prints the tree as a string. Unlike pt, this command cannot be" ++
@@ -243,14 +283,17 @@ txtHelpFile =
"\n -f Fudget GUI (necessary for Unicode; only available in X Window System)" ++ "\n -f Fudget GUI (necessary for Unicode; only available in X Window System)" ++
"\n" ++ "\n" ++
"\nts, translation_session: ts" ++ "\nts, translation_session: ts" ++
"\n Translates input lines from any of the actual languages to any other one." ++ "\n Translates input lines from any of the actual languages to all other ones." ++
"\n To exit, type a full stop (.) alone on a line." ++ "\n To exit, type a full stop (.) alone on a line." ++
"\n N.B. Exit from a Fudget session is to the Unix shell, not to GF. " ++ "\n N.B. Exit from a Fudget session is to the Unix shell, not to GF. " ++
"\n HINT: Set -parser and -lexer locally in each grammar." ++ "\n HINT: Set -parser and -lexer locally in each grammar." ++
"\n options:" ++ "\n options:" ++
"\n -f Fudget GUI (necessary for Unicode; only available in X Window System)" ++ "\n -f Fudget GUI (necessary for Unicode; only available in X Windows)" ++
"\n -lang prepend translation results with language names" ++
"\n flags:" ++ "\n flags:" ++
"\n -cat" ++ "\n -cat the parser category" ++
"\n examples:" ++
"\n ts -cat=Numeral -lang -- translate numerals, show language names" ++
"\n" ++ "\n" ++
"\ntq, translation_quiz: tq Lang Lang" ++ "\ntq, translation_quiz: tq Lang Lang" ++
"\n Random-generates translation exercises from Lang1 to Lang2," ++ "\n Random-generates translation exercises from Lang1 to Lang2," ++
@@ -259,12 +302,16 @@ txtHelpFile =
"\n HINT: Set -parser and -lexer locally in each grammar." ++ "\n HINT: Set -parser and -lexer locally in each grammar." ++
"\n flags:" ++ "\n flags:" ++
"\n -cat" ++ "\n -cat" ++
"\n examples:" ++
"\n tq -cat=NP TestResourceEng TestResourceSwe -- quiz for NPs" ++
"\n" ++ "\n" ++
"\ntl, translation_list: tl Lang Lang Int" ++ "\ntl, translation_list: tl Lang Lang Int" ++
"\n Random-generates a list of Int translation exercises from Lang1 to Lang2." ++ "\n Random-generates a list of Int translation exercises from Lang1 to Lang2." ++
"\n HINT: use wf to save the exercises in a file." ++ "\n HINT: use wf to save the exercises in a file." ++
"\n flags:" ++ "\n flags:" ++
"\n -cat" ++ "\n -cat" ++
"\n examples:" ++
"\n tl -cat=NP TestResourceEng TestResourceSwe -- quiz list for NPs" ++
"\n" ++ "\n" ++
"\nmq, morphology_quiz: mq" ++ "\nmq, morphology_quiz: mq" ++
"\n Random-generates morphological exercises," ++ "\n Random-generates morphological exercises," ++
@@ -275,6 +322,8 @@ txtHelpFile =
"\n flags:" ++ "\n flags:" ++
"\n -cat" ++ "\n -cat" ++
"\n -lang" ++ "\n -lang" ++
"\n examples:" ++
"\n mq -cat=N -lang=TestResourceSwe -- quiz for Swedish nouns" ++
"\n" ++ "\n" ++
"\nml, morphology_list: ml Int" ++ "\nml, morphology_list: ml Int" ++
"\n Random-generates a list of Int morphological exercises," ++ "\n Random-generates a list of Int morphological exercises," ++
@@ -283,12 +332,14 @@ txtHelpFile =
"\n flags:" ++ "\n flags:" ++
"\n -cat" ++ "\n -cat" ++
"\n -lang" ++ "\n -lang" ++
"\n examples:" ++
"\n ml -cat=N -lang=TestResourceSwe -- quiz list for Swedish nouns" ++
"\n" ++ "\n" ++
"\n" ++ "\n" ++
"\n-- IO related commands" ++ "\n-- IO related commands" ++
"\n" ++ "\n" ++
"\nrf, read_file: rf File" ++ "\nrf, read_file: rf File" ++
"\n Returns the contents of File as a String; error is File does not exist." ++ "\n Returns the contents of File as a String; error if File does not exist." ++
"\n" ++ "\n" ++
"\nwf, write_file: wf File String" ++ "\nwf, write_file: wf File String" ++
"\n Writes String into File; File is created if it does not exist." ++ "\n Writes String into File; File is created if it does not exist." ++
@@ -320,18 +371,19 @@ txtHelpFile =
"\n HINT: pipe with 'wf Foo.tex' to generate a new Latex file." ++ "\n HINT: pipe with 'wf Foo.tex' to generate a new Latex file." ++
"\n" ++ "\n" ++
"\nsa, speak_aloud: sa String" ++ "\nsa, speak_aloud: sa String" ++
"\n Uses the Festival speech generator to produce speech for String." ++ "\n Uses the Flite speech generator to produce speech for String." ++
"\n The command cupports Festival's language flag, which is sent verbatim" ++ "\n Works for American English spelling. " ++
"\n to Festival, e.g. -language=spanish. Omitting this flag gives the " ++ "\n examples:" ++
"\n system-dependent default voice (often British English)." ++ "\n h | sa -- listen to the list of commands" ++
"\n flags:" ++ "\n gr -cat=S | l | sa -- generate a random sentence and speak it aloud" ++
"\n -language" ++
"\n" ++ "\n" ++
"\nh, help: h Command?" ++ "\nh, help: h Command?" ++
"\n Displays the paragraph concerning the command from this help file." ++ "\n Displays the paragraph concerning the command from this help file." ++
"\n Without the argument, shows the first lines of all paragraphs." ++ "\n Without the argument, shows the first lines of all paragraphs." ++
"\n options" ++ "\n options" ++
"\n -all show the whole help file" ++ "\n -all show the whole help file" ++
"\n examples:" ++
"\n h print_grammar -- show all information on the pg command" ++
"\n" ++ "\n" ++
"\nq, quit: q" ++ "\nq, quit: q" ++
"\n Exits GF." ++ "\n Exits GF." ++
@@ -339,36 +391,36 @@ txtHelpFile =
"\n" ++ "\n" ++
"\n!, system_command: ! String" ++ "\n!, system_command: ! String" ++
"\n Issues a system command. No value is returned to GF." ++ "\n Issues a system command. No value is returned to GF." ++
"\n" ++ "\n example:" ++
"\n ! ls" ++
"\n" ++ "\n" ++
"\n" ++ "\n" ++
"\n-- Flags. The availability of flags is defined separately for each command." ++ "\n-- Flags. The availability of flags is defined separately for each command." ++
"\n" ++ "\n" ++
"\n-cat: category in which parsing is performed." ++ "\n-cat, category in which parsing is performed." ++
"\n The default is S." ++ "\n The default is S." ++
"\n" ++ "\n" ++
"\n-depth: the search depth in e.g. random generation." ++ "\n-depth, the search depth in e.g. random generation." ++
"\n The default depends on application." ++ "\n The default depends on application." ++
"\n" ++ "\n" ++
"\n-filter: operation performed on a string. The default is identity." ++ "\n-filter, operation performed on a string. The default is identity." ++
"\n -filter=identity no change" ++ "\n -filter=identity no change" ++
"\n -filter=erase erase the text" ++ "\n -filter=erase erase the text" ++
"\n -filter=take100 show the first 100 characters" ++ "\n -filter=take100 show the first 100 characters" ++
"\n -filter=length show the length of the string" ++ "\n -filter=length show the length of the string" ++
"\n -filter=text format as text (punctuation, capitalization)" ++ "\n -filter=text format as text (punctuation, capitalization)" ++
"\n -filter=code format as code (spacing, indentation)" ++ "\n -filter=code format as code (spacing, indentation)" ++
"\n -filter=latexfile embed in a LaTeX file " ++
"\n" ++ "\n" ++
"\n-lang: grammar used when executing a grammar-dependent command." ++ "\n-lang, grammar used when executing a grammar-dependent command." ++
"\n The default is the last-imported grammar." ++ "\n The default is the last-imported grammar." ++
"\n" ++ "\n" ++
"\n-language: voice used by Festival as its --language flag in the sa command. " ++ "\n-language, voice used by Festival as its --language flag in the sa command. " ++
"\n The default is system-dependent. " ++ "\n The default is system-dependent. " ++
"\n" ++ "\n" ++
"\n-length: the maximum number of characters shown of a string. " ++ "\n-length, the maximum number of characters shown of a string. " ++
"\n The default is unlimited." ++ "\n The default is unlimited." ++
"\n" ++ "\n" ++
"\n-lexer: tokenization transforming a string into lexical units for a parser." ++ "\n-lexer, tokenization transforming a string into lexical units for a parser." ++
"\n The default is words." ++ "\n The default is words." ++
"\n -lexer=words tokens are separated by spaces or newlines" ++ "\n -lexer=words tokens are separated by spaces or newlines" ++
"\n -lexer=literals like words, but GF integer and string literals recognized" ++ "\n -lexer=literals like words, but GF integer and string literals recognized" ++
@@ -380,14 +432,14 @@ txtHelpFile =
"\n -lexer=textlit like text, but treat unknown words as string literals" ++ "\n -lexer=textlit like text, but treat unknown words as string literals" ++
"\n -lexer=codeC use a C-like lexer" ++ "\n -lexer=codeC use a C-like lexer" ++
"\n" ++ "\n" ++
"\n-number: the maximum number of generated items in a list. " ++ "\n-number, the maximum number of generated items in a list. " ++
"\n The default is unlimited." ++ "\n The default is unlimited." ++
"\n" ++ "\n" ++
"\n-parser: Context-free parsing algorithm. The default is chart." ++ "\n-parser, Context-free parsing algorithm. The default is chart." ++
"\n -parser=earley Earley algorithm" ++ "\n -parser=earley Earley algorithm" ++
"\n -parser=chart bottom-up chart parser" ++ "\n -parser=chart bottom-up chart parser" ++
"\n" ++ "\n" ++
"\n-printer: format in which the grammar is printed. The default is gfc." ++ "\n-printer, format in which the grammar is printed. The default is gfc." ++
"\n -printer=gfc GFC grammar" ++ "\n -printer=gfc GFC grammar" ++
"\n -printer=gf GF grammar" ++ "\n -printer=gf GF grammar" ++
"\n -printer=old old GF grammar" ++ "\n -printer=old old GF grammar" ++
@@ -401,9 +453,9 @@ txtHelpFile =
"\n *-printer=xml XML: DTD for the pg command, object for st" ++ "\n *-printer=xml XML: DTD for the pg command, object for st" ++
"\n -printer=old old GF: file readable by GF 1.2" ++ "\n -printer=old old GF: file readable by GF 1.2" ++
"\n" ++ "\n" ++
"\n-startcat: like -cat, but used in grammars (to avoid clash with keyword cat)" ++ "\n-startcat, like -cat, but used in grammars (to avoid clash with keyword cat)" ++
"\n" ++ "\n" ++
"\n-transform: transformation performed on a syntax tree. The default is identity." ++ "\n-transform, transformation performed on a syntax tree. The default is identity." ++
"\n -transform=identity no change" ++ "\n -transform=identity no change" ++
"\n -transform=compute compute by using definitions in the grammar" ++ "\n -transform=compute compute by using definitions in the grammar" ++
"\n -transform=typecheck return the term only if it is type-correct" ++ "\n -transform=typecheck return the term only if it is type-correct" ++
@@ -411,7 +463,7 @@ txtHelpFile =
"\n -transform=context solve metavariables by unique refinements as variables" ++ "\n -transform=context solve metavariables by unique refinements as variables" ++
"\n -transform=delete replace the term by metavariable" ++ "\n -transform=delete replace the term by metavariable" ++
"\n" ++ "\n" ++
"\n-unlexer: untokenization transforming linearization output into a string." ++ "\n-unlexer, untokenization transforming linearization output into a string." ++
"\n The default is unwords." ++ "\n The default is unwords." ++
"\n -unlexer=unwords space-separated token list (like unwords)" ++ "\n -unlexer=unwords space-separated token list (like unwords)" ++
"\n -unlexer=text format as text: punctuation, capitals, paragraph <p>" ++ "\n -unlexer=text format as text: punctuation, capitals, paragraph <p>" ++