Skip to content

Commit

Permalink
Add lang tags to AaJson
Browse files Browse the repository at this point in the history
  • Loading branch information
kharus committed Oct 14, 2024
1 parent 7e01c08 commit b3de41b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions lib/haskell/natural4/src/LS/XPile/AaJson.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ translate2AaJson nlgEnvs l4i = do
let rules = origrules l4i

qaHornsAllLangs :: [Either XPileLogW String] <-
for nlgEnvs \nlgEnv -> do
for nlgEnvs \nlgEnv@(NLGEnv {gfLang}) -> do
let nlgEnvStrLower = gfLang |> showLanguage |$> Char.toLower

hornByLang :: Either XPileLogW [(String, BoolStructLT)] <-
qaHornsByLang rules nlgEnv l4i

case hornByLang of
Left err -> xpError err
Right haveHorn -> xpReturn [__i|
#{encodePretty $ toAaJson <$> (DL.nub haveHorn)}
{ "#{nlgEnvStrLower}" : #{encodePretty $ toAaJson <$> (DL.nub haveHorn)} }
|]

let qaHornsStrings = rights qaHornsAllLangs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
[
{ "nl4chi" : [
{
"Person": {
"All": {
Expand Down Expand Up @@ -29,8 +29,8 @@
}
}
}
],
[
] },
{ "nl4eng" : [
{
"Person": {
"All": {
Expand Down Expand Up @@ -60,8 +60,8 @@
}
}
}
],
[
] },
{ "nl4may" : [
{
"Person": {
"All": {
Expand Down Expand Up @@ -91,5 +91,5 @@
}
}
}
]
] }
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
[
{ "nl4chi" : [
{
"Covered If …": {
"Not": {
Expand Down Expand Up @@ -206,8 +206,8 @@
}
}
}
],
[
] },
{ "nl4eng" : [
{
"Covered If …": {
"Not": {
Expand Down Expand Up @@ -414,8 +414,8 @@
}
}
}
],
[
] },
{ "nl4may" : [
{
"Covered If …": {
"Not": {
Expand Down Expand Up @@ -622,5 +622,5 @@
}
}
}
]
] }
]

0 comments on commit b3de41b

Please sign in to comment.