mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-16 16:29:32 -06:00
merged Gf and Fg classes in generated Haskell
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
module Main where
|
||||
|
||||
import GF.Embed.EmbedAPI
|
||||
import GF.GFCC.API
|
||||
import TransferDef (transfer)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
gr <- file2grammar "math.gfcm"
|
||||
gr <- file2grammar "Math.gfcc"
|
||||
loop (translate transfer gr)
|
||||
|
||||
loop :: (String -> String) -> IO ()
|
||||
@@ -17,7 +17,7 @@ loop trans = do
|
||||
|
||||
translate :: (Tree -> Tree) -> MultiGrammar -> String -> String
|
||||
translate tr gr = unlines . map transLine . lines where
|
||||
transLine s = case parseAllLang gr (startCat gr) s of
|
||||
transLine s = case parseAllLang gr "Question" s of
|
||||
(lg,t:_):_ -> linearize gr lg (tr t)
|
||||
_ -> "NO PARSE"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user