[00:09:33] *** Joins: Eidel_ (~eidel@c83-249-247-253.bredband.comhem.se) [00:12:48] *** Quits: Eidel (~eidel@c83-249-247-253.bredband.comhem.se) (Ping timeout: 250 seconds) [00:34:44] *** Quits: inariksit (~inari@177.72.2.81.in-addr.arpa) (Quit: inariksit) [01:15:47] *** Joins: Eidel (~eidel@c83-249-247-253.bredband.comhem.se) [01:19:03] *** Quits: Eidel_ (~eidel@c83-249-247-253.bredband.comhem.se) (Ping timeout: 240 seconds) [03:55:32] *** Quits: spectie (~fran@unaffiliated/spectie) (Ping timeout: 250 seconds) [04:00:37] *** Joins: spectie (~fran@unaffiliated/spectie) [04:32:05] *** Joins: Eidel_ (~eidel@c83-249-247-253.bredband.comhem.se) [04:35:15] *** Quits: Eidel (~eidel@c83-249-247-253.bredband.comhem.se) (Ping timeout: 255 seconds) [05:37:23] How do I write a Tree for PGF.linearize from the categories and functions from my abstract and concrete syntax modules? [05:38:48] Roundtripping from parse works: [05:38:57] *Tests> let p = parse gr ((head . languages) gr) (startCat gr) "Dee laughs" [05:38:59] *Tests> linearize gr lang (head p) [05:39:01] "Dee laughs" [05:40:16] But, p is [EApp (EFun Ut) (EApp (EFun PosS) (EApp (EApp (EFun Sentence) (EApp (EFun Entity) (EFun dee))) (EApp (EFun Happening) (EFun laugh))))] [05:43:47] Which looks nothing like my abstract syntax functions (prefaced with G by gf --make --output-format=haskell) [05:46:16] Dickson> p "Dee laughs" [05:46:19] Ut (PosS (Sentence (Entity dee) (Happening laugh))) [06:11:01] .. [06:12:00] showExpr and readExpr look like they will do it. [06:20:08] *Tests> let exp = readExpr "Ut (PosS (Sentence (Entity dee) (Happening laugh)))" *Tests> exp [06:20:10] Just (EApp (EFun Ut) (EApp (EFun PosS) (EApp (EApp (EFun Sentence) (EApp (EFun Entity) (EFun dee))) (EApp (EFun Happening) (EFun laugh))))) [06:20:12] *Tests> showExpr [] $ unmaybe exp "Ut (PosS (Sentence (Entity dee) (Happening laugh)))" [06:20:14] *Tests> linearize gr en (unmaybe exp) "Dee laughs"y [06:20:45] Yay! [07:15:35] Wait. That's not going to do it. I need a string, and I only have all those G-prefaced functions. [08:24:46] *** Joins: myoriel (~Myoriel@aftr-88-217-180-48.dynamic.mnet-online.de) [09:21:00] *** Quits: myoriel (~Myoriel@aftr-88-217-180-48.dynamic.mnet-online.de) (Ping timeout: 255 seconds) [09:40:49] The answer is: showCId (fst (unmaybe (unApp (gf Gdee)))) [09:41:30] Which gives: "dee" [09:45:09] *Tests> let exp = readExpr ( "Ut (PosS (Sentence (Entity " ++ ( showCId (fst (unmaybe (unApp (gf Gdee)))) ) ++ ") (Happening laugh)))" ) [09:45:12] *Tests> linearize gr en (unmaybe exp) [09:45:14] "Dee laughs" [09:46:52] And, [09:46:57] *Tests> let exp = readExpr ( "Ut (PosS (Sentence (Entity " ++ ( showCId (fst (unmaybe (unApp (gf Guncle_alf)))) ) ++ ") (Happening laugh)))" ) [09:47:00] *Tests> linearize gr en (unmaybe exp) [09:47:02] "Uncle Alf laughs" [09:53:14] So, I can use the functions in my abstract syntax modules to generate new sentences in my haskell program. [10:32:57] *** Quits: jmvanel (~jmvanel@213.0.88.79.rev.sfr.net) (Quit: Quitte) [10:54:27] *** Joins: Eidel (~eidel@c83-249-247-253.bredband.comhem.se) [10:57:42] *** Quits: Eidel_ (~eidel@c83-249-247-253.bredband.comhem.se) (Ping timeout: 250 seconds) [11:03:39] *** Joins: inariksit (~inari@177.72.2.81.in-addr.arpa) [11:11:00] drbean, [11:11:09] are you working on an interactive detective book? [11:20:26] *** Joins: jmvanel (~jmvanel@did75-16-88-162-137-140.fbx.proxad.net) [11:52:40] *** Joins: Eidel_ (~eidel@c83-249-247-253.bredband.comhem.se) [11:55:37] *** Quits: Eidel (~eidel@c83-249-247-253.bredband.comhem.se) (Ping timeout: 256 seconds) [15:25:21] NO, just a simple question-answering app. [15:28:57] I need to get back the strings for evaluation on the basis of the model. The model uses strings to represent the data. [15:37:43] what kind of questions involves "happening laugh" ? :D [15:38:02] simple questions [15:38:03] i mean [18:50:27] *** Joins: myoriel (~Myoriel@aftr-88-217-180-48.dynamic.mnet-online.de) [19:53:03] *** Quits: jmvanel (~jmvanel@did75-16-88-162-137-140.fbx.proxad.net) (Quit: Quitte) [21:33:40] *** Joins: jmvanel (~jmvanel@213.0.88.79.rev.sfr.net) [23:08:40] *** Quits: myoriel (~Myoriel@aftr-88-217-180-48.dynamic.mnet-online.de) (Ping timeout: 255 seconds) [23:23:13] *** Quits: inariksit (~inari@177.72.2.81.in-addr.arpa) (Quit: inariksit) [23:52:22] *** Joins: myoriel (~Myoriel@aftr-88-217-180-48.dynamic.mnet-online.de)