diff options
| author | hallgren <hallgren@chalmers.se> | 2015-04-17 12:59:03 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2015-04-17 12:59:03 +0000 |
| commit | 9e3afea129811274ebd45e075849c3ea2722084a (patch) | |
| tree | 86caccc94f29a40bb3aa9e79035f3a82180604e2 /src/server | |
| parent | 86e16d9e3d895d357c0cd5588caf738a5745559b (diff) | |
PGF web service: add command c-linearizeAll to obtain all variants
Implemented by calling the recently added function PGF2.linearizeAll.
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/PGFService.hs | 6 |
1 files changed, 6 insertions, 0 deletions
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=<<join(trans # input % to % start % limit%treeopts) "c-lookupmorpho"-> 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] |
