From 32508e37b37a0baad884e6aaa518071b62e1e6d8 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 2 Mar 2006 17:19:36 +0000 Subject: treebanks in shell state: i -treebank and lt --- src/GF/Shell/HelpFile.hs | 8 ++++++++ src/GF/Shell/PShell.hs | 1 + src/GF/Shell/ShellCommands.hs | 7 +++++-- 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/GF/Shell') diff --git a/src/GF/Shell/HelpFile.hs b/src/GF/Shell/HelpFile.hs index 2f21184f1..d89877a3d 100644 --- a/src/GF/Shell/HelpFile.hs +++ b/src/GF/Shell/HelpFile.hs @@ -66,6 +66,7 @@ txtHelpFile = "\n -o do emit code (default with new grammar format)" ++ "\n -ex preprocess .gfe files if needed" ++ "\n -prob read probabilities from top grammar file (format --# prob Fun Double)" ++ + "\n -treebank read a treebank file to memory (xml format)" ++ "\n flags:" ++ "\n -abs set the name used for abstract syntax (with -old option)" ++ "\n -cnc set the name used for concrete syntax (with -old option)" ++ @@ -238,11 +239,18 @@ txtHelpFile = "\n -c compare to existing xml-formatted treebank" ++ "\n -trees return the trees of the treebank" ++ "\n -xml wrap the treebank (or comparison results) with XML tags" ++ + "\n -mem write the treebank in memory instead of a file TODO" ++ "\n examples:" ++ "\n gr -cat=S -number=100 | tb -xml | wf tb.xml -- random treebank into file" ++ "\n rf tb.xml | tb -c -- compare-test treebank from file" ++ "\n rf old.xml | tb -trees | tb -xml -- create new treebank from old" ++ "\n" ++ + "\nlt, lookup_treebank: lt String" ++ + "\n Lookup a string in a treebank and return the resulting trees." ++ + "\n Use 'tb' to create a treebank and 'i -treebank' to read it in memory." ++ + "\n flag:" ++ + "\n -treebank use this treebank (instead of the latest introduced one) TODO" ++ + "\n" ++ "\ntt, test_tokenizer: tt String" ++ "\n Show the token list sent to the parser when String is parsed." ++ "\n HINT: can be useful when debugging the parser." ++ diff --git a/src/GF/Shell/PShell.hs b/src/GF/Shell/PShell.hs index 676e54c46..2c501ab9f 100644 --- a/src/GF/Shell/PShell.hs +++ b/src/GF/Shell/PShell.hs @@ -114,6 +114,7 @@ pCommand ws = case ws of "cc" : s -> aUnit $ CComputeConcrete $ unwords s "so" : s -> aUnit $ CShowOpers $ unwords s "tb" : [] -> aUnit CTreeBank + "lt" : s -> aString CLookupTreebank s "tq" : i:o:[] -> aUnit (CTranslationQuiz (language i) (language o)) "tl":i:o:[] -> aUnit (CTranslationList (language i) (language o)) diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs index 1351e8784..bf27016a5 100644 --- a/src/GF/Shell/ShellCommands.hs +++ b/src/GF/Shell/ShellCommands.hs @@ -57,6 +57,8 @@ data Command = | CComputeConcrete String | CShowOpers String + | CLookupTreebank + | CTranslationQuiz Language Language | CTranslationList Language Language | CMorphoQuiz @@ -169,8 +171,9 @@ optionsOfCommand co = case co of CSetFlag -> both "utf8 table struct record all multi" "cat lang lexer parser number depth rawtrees unlexer optimize path conversion printer" - CImport _ -> both "old v s src gfc retain nocf nocheckcirc cflexer noemit o make ex prob" - "abs cnc res path optimize conversion cat preproc probs noparse" + CImport _ -> + both "old v s src gfc retain nocf nocheckcirc cflexer noemit o make ex prob treebank" + "abs cnc res path optimize conversion cat preproc probs noparse" CRemoveLanguage _ -> none CEmptyState -> none CStripState -> none -- cgit v1.2.3