diff options
| author | odanoburu <bcclaro@gmail.com> | 2018-05-23 11:22:46 -0300 |
|---|---|---|
| committer | odanoburu <bcclaro@gmail.com> | 2018-05-23 11:22:46 -0300 |
| commit | c8b1cb715e48665f3550ae1ccb41a9e521f6557b (patch) | |
| tree | c9921a1064486db3478e42c37e3c453aa3042342 /src/tools/gftest/Main.hs | |
| parent | 1c7e99cdca020ccb1e55b067961813a7752eba3b (diff) | |
| parent | 10df5a7269721ab0807ec7a0fe4b75cd1bb16d87 (diff) | |
Merge remote-tracking branch 'upstream/master' into por
Diffstat (limited to 'src/tools/gftest/Main.hs')
| -rw-r--r-- | src/tools/gftest/Main.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tools/gftest/Main.hs b/src/tools/gftest/Main.hs index fcabb33c3..afcf17830 100644 --- a/src/tools/gftest/Main.hs +++ b/src/tools/gftest/Main.hs @@ -30,6 +30,7 @@ data GfTest , start_cat :: Maybe Cat , show_cats :: Bool , show_funs :: Bool + , funs_of_arity :: Maybe Int , show_coercions:: Bool , concr_string :: String @@ -57,7 +58,8 @@ gftest = GfTest &= help "Concrete syntax + optional translations" , tree = def &= A.typ "\"UseN tree_N\"" &= A.name "t" &= help "Test the given tree" - , function = def &= A.typ "UseN" &= help "Test the given function(s)" + , function = def &= A.typ "UseN" + &= A.name "f" &= help "Test the given function(s)" , category = def &= A.typ "NP" &= A.name "c" &= help "Test all functions with given goal category" , start_cat = def &= A.typ "Utt" @@ -65,6 +67,7 @@ gftest = GfTest , concr_string = def &= A.typ "the" &= help "Show all functions that include given string" , show_cats = def &= help "Show all available categories" , show_funs = def &= help "Show all available functions" + , funs_of_arity = def &= A.typ "2" &= help "Show all functions of arity 2" , show_coercions= def &= help "Show coercions in the grammar" , debug = def &= help "Show debug output" , equal_fields = def &= A.name "q" &= help "Show fields whose strings are always identical" @@ -184,6 +187,12 @@ main = do putStrLn "* Coercions in the grammar:" putStrLn $ unlines [ show cat++"--->"++show coe | (cat,coe) <- coercions gr ] + case funs_of_arity args of + Nothing -> return () + Just n -> do + putStrLn $ "* Functions in the grammar of arity " ++ show n ++ ":" + putStrLn $ unlines $ nub [ show s | s <- symbols gr, arity s == n ] + -- Show all functions that contain the given string -- (e.g. English "it" appears in DefArt, ImpersCl, it_Pron, …) case concr_string args of |
