Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lang tags to AaJson #627

Merged
merged 6 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install Ubuntu Prerequisites (libpcre)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install libpcre3-dev
sudo apt-get install libpcre3-dev liblzma-dev

- name: Install MacOS Prerequisites (libpcre)
if: startsWith(matrix.os, 'macOS')
Expand Down
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 @@
}
}
}
]
] }
]