From 69a192308bcc171a6cae8e641de2a408331ac6a3 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 17 Apr 2015 12:59:03 +0000 Subject: [PATCH] PGF web service: add command c-linearizeAll to obtain all variants Implemented by calling the recently added function PGF2.linearizeAll. --- src/server/PGFService.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs index ec940bfde..5eed13851 100644 --- a/src/server/PGFService.hs +++ b/src/server/PGFService.hs @@ -130,6 +130,7 @@ cpgfMain qsem command (t,(pgf,pc)) = "c-parse" -> withQSem qsem $ out t=<< join (parse # input % start % limit % treeopts) "c-linearize" -> out t=<< lin # tree % to + "c-linearizeAll"-> out t=<< linAll # tree % to "c-translate" -> withQSem qsem $ out t=< out t=<< morpho # from1 % textInput @@ -190,6 +191,11 @@ cpgfMain qsem command (t,(pgf,pc)) = purge r@(_,t') = if diffUTCTime t t'<120 then Just r else Nothing -- remove unused parse results after 2 minutes -} + linAll tree to = showJSON (linAll' tree to) + linAll' tree (tos,unlex) = + [makeObj ["to".=to, + "texts".=map unlex (C.linearizeAll c tree)]|(to,c)<-tos] + lin tree to = showJSON (lin' tree to) lin' tree (tos,unlex) = [makeObj ["to".=to,"text".=unlex (C.linearize c tree)]|(to,c)<-tos]