mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.1
|
||||
with:
|
||||
repo: 'GrammaticalFramework/gf-core'
|
||||
version: 'tags/${{ env.GF_VERSION }}'
|
||||
version: 'tags/release-${{ env.GF_VERSION }}'
|
||||
file: 'gf-${{ env.GF_VERSION }}-ubuntu-24.04.deb'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ data LangInfo = LangInfo
|
||||
, langSymbolic :: Bool
|
||||
, langCompatibility :: Bool
|
||||
, langSynopsis :: Bool -- ^ include in RGL synopsis
|
||||
, langMorphodict :: Bool
|
||||
} deriving (Show,Eq)
|
||||
|
||||
-- | Load language information from default config file
|
||||
@@ -55,6 +56,7 @@ loadLangsFrom configFile = do
|
||||
, langSymbolic = boolBit bits 8 True
|
||||
, langCompatibility = boolBit bits 9 False
|
||||
, langSynopsis = boolBit bits 10 False
|
||||
, langMorphodict = boolBit bits 11 False
|
||||
}
|
||||
|
||||
-- | Separate a string on a character
|
||||
|
||||
2
Makefile
2
Makefile
@@ -19,6 +19,7 @@ default: build copy
|
||||
build: src/*/*.gf
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) build
|
||||
$(RUNGHC) build morphodict
|
||||
else
|
||||
./Setup.sh
|
||||
endif
|
||||
@@ -26,6 +27,7 @@ endif
|
||||
copy:
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) copy
|
||||
$(RUNGHC) copy morphodict
|
||||
endif
|
||||
|
||||
install: build copy
|
||||
|
||||
24
Setup.hs
24
Setup.hs
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE CPP, LambdaCase #-}
|
||||
|
||||
-- | Main build script for RGL
|
||||
|
||||
@@ -150,11 +150,12 @@ getRGLBuildSubDir mode =
|
||||
case mode of
|
||||
Present -> "present"
|
||||
AllTenses -> "alltenses"
|
||||
MorphoDict -> "morphodict"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Build modes
|
||||
|
||||
data Mode = Present | AllTenses
|
||||
data Mode = Present | AllTenses | MorphoDict
|
||||
deriving (Show,Eq)
|
||||
|
||||
all_modes :: [String]
|
||||
@@ -187,6 +188,7 @@ rglCommands =
|
||||
, RGLCommand "lang" False $ gfcp [l,s]
|
||||
, RGLCommand "api" False $ gfcp [t,sc]
|
||||
, RGLCommand "compat" False $ gfcp [c]
|
||||
, RGLCommand "morphodict" False $ gfcp [m]
|
||||
|
||||
-- Special command, invoked when command ends in .gf
|
||||
, RGLCommand "modules" False $ \modes args bi -> do
|
||||
@@ -223,14 +225,20 @@ rglCommands =
|
||||
s mode args = (symbol,optml mode langTry args)
|
||||
c mode args = (compat,optml AllTenses langCompatibility args)
|
||||
t mode args = (try,optml mode langTry args)
|
||||
m mode args = (morphodict,optml mode langMorphodict args)
|
||||
sc mode args = (symbolic,optml mode langSymbolic args)
|
||||
|
||||
optml :: Mode -> (LangInfo -> Bool) -> [String] -> ([LangInfo] -> [LangInfo])
|
||||
optml mode pred args =
|
||||
\langsAll ->
|
||||
let langsDefault = filter (if mode == Present then langPresent else const True) (filter pred langsAll)
|
||||
let langsDefault = filter (mode2langinfo mode) (filter pred langsAll)
|
||||
in getOptLangs langsAll langsDefault args
|
||||
|
||||
mode2langinfo = \case
|
||||
Present -> langPresent
|
||||
MorphoDict -> langMorphodict
|
||||
_ -> const True
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Getting module paths/names
|
||||
|
||||
@@ -260,6 +268,9 @@ syntax l = sourceDir </> "api" </> ("Syntax" ++ langCode l ++ ".gf")
|
||||
symbolic :: LangInfo -> FilePath
|
||||
symbolic l = sourceDir </> "api" </> ("Symbolic" ++ langCode l ++ ".gf")
|
||||
|
||||
morphodict :: LangInfo -> FilePath
|
||||
morphodict l = sourceDir </> "morphodict" </> ("MorphoDict" ++ langCode l ++ ".gf")
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Argument helpers
|
||||
|
||||
@@ -302,8 +313,9 @@ getOptMode args =
|
||||
else explicit_modes
|
||||
where
|
||||
explicit_modes =
|
||||
[Present|have "present"]++
|
||||
[AllTenses|have "alltenses"]
|
||||
[Present | have "present"] ++
|
||||
[AllTenses | have "alltenses"] ++
|
||||
[MorphoDict | have "morphodict"]
|
||||
have mode = mode `elem` args
|
||||
|
||||
-- | List of languages overriding the default definitions
|
||||
@@ -367,7 +379,7 @@ gfcn bi mode summary files = do
|
||||
let dir = getRGLBuildDir bi mode
|
||||
preproc = case mode of
|
||||
Present -> "--preproc=mkPresent"
|
||||
AllTenses -> ""
|
||||
_ -> ""
|
||||
createDirectoryIfMissing True dir
|
||||
if length files > 0
|
||||
then do
|
||||
|
||||
13
Setup.sh
13
Setup.sh
@@ -59,6 +59,7 @@ gfc="${gf} --batch --quiet --gf-lib-path=${dist}"
|
||||
mkdir -p "${dist}/prelude"
|
||||
mkdir -p "${dist}/present"
|
||||
mkdir -p "${dist}/alltenses"
|
||||
mkdir -p "${dist}/morphodict"
|
||||
|
||||
# Build: prelude
|
||||
echo "Building [prelude]"
|
||||
@@ -68,6 +69,7 @@ ${gfc} --gfo-dir="${dist}"/prelude "${src}"/prelude/*.gf
|
||||
# Gather all language modules for building
|
||||
modules_present=
|
||||
modules_alltenses=
|
||||
modules_morphodict=
|
||||
for lang in $langs; do
|
||||
for mod in $modules_langs $modules_api; do
|
||||
if [ $mod == "Compatibility" ] && [[ "$langs_compat" != *"$lang"* ]]; then continue; fi
|
||||
@@ -80,8 +82,12 @@ for lang in $langs; do
|
||||
modules_alltenses="${modules_alltenses} ${file}"
|
||||
done
|
||||
done
|
||||
file="${src}/morphodict/MorphoDict${lang}.gf"
|
||||
if [ ! -f "$file" ]; then continue; fi
|
||||
modules_morphodict="${modules_morphodict} ${file}"
|
||||
done
|
||||
|
||||
|
||||
# Build: present
|
||||
echo "Building [present]"
|
||||
if [ $verbose = true ]; then echo $modules_present; fi
|
||||
@@ -96,6 +102,13 @@ for module in $modules_alltenses; do
|
||||
${gfc} --no-pmcfg --gfo-dir="${dist}"/alltenses "${module}"
|
||||
done
|
||||
|
||||
# Build: morphodict
|
||||
echo "Building [morphodict]"
|
||||
if [ $verbose = true ]; then echo $modules_morphodict; fi
|
||||
for module in $modules_morphodict; do
|
||||
${gfc} --no-pmcfg --gfo-dir="${dist}"/morphodict "${module}"
|
||||
done
|
||||
|
||||
# Copy
|
||||
if [ $dest == $dist ]; then exit 0; fi
|
||||
echo "Copying to ${dest}"
|
||||
|
||||
116
languages.csv
116
languages.csv
@@ -1,58 +1,58 @@
|
||||
Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis
|
||||
Afr,Afrikaans,afrikaans,,,,,,n,,y
|
||||
Amh,Amharic,amharic,,,,,n,n,,n
|
||||
Ara,Arabic,arabic,,,,,,y,,y
|
||||
Bul,Bulgarian,bulgarian,,,y,,,,,y
|
||||
Cat,Catalan,catalan,Romance,,y,,,,y,y
|
||||
Cgg,Rukiga,rukiga,,,y,y,n,n,y,y
|
||||
Chi,Chinese (simplified),chinese,,,,,,,,y
|
||||
Cze,Czech,czech,,,,,,n,,y
|
||||
Dan,Danish,danish,Scand,,y,,,,,y
|
||||
Dut,Dutch,dutch,,,y,,,,,y
|
||||
Eng,English,english,,,y,,,,y,y
|
||||
Est,Estonian,estonian,,,,,,,,y
|
||||
Eus,Basque,basque,,,,,,,,y
|
||||
Fin,Finnish,finnish,,,y,,,,y,y
|
||||
Fre,French,french,Romance,,y,,,,y,y
|
||||
Ger,German,german,,,y,,,,,y
|
||||
Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n
|
||||
Gre,Greek,greek,,,,,,,,y
|
||||
Heb,Hebrew,hebrew,,,,,n,n,,n
|
||||
Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y
|
||||
Hrv,Croatian,croatian,,,,,,y,,n
|
||||
Hun,Hungarian,hungarian,,,n,y,y,y,n,n
|
||||
Ice,Icelandic,icelandic,,,,,,n,,y
|
||||
Ina,Interlingua,interlingua,,,y,,n,n,,n
|
||||
Ita,Italian,italian,Romance,,y,,,,y,y
|
||||
Jpn,Japanese,japanese,,,,,,,,y
|
||||
Kaz,Kazakh,kazakh,,,,y,n,n,n,y
|
||||
Kor,Korean,korean,,,n,y,y,y,n,n
|
||||
Lat,Latin,latin,,,,,y,y,n,y
|
||||
Lav,Latvian,latvian,,,,,,,y,y
|
||||
Mkd,Macedonian,macedonian,,,,y,n,n,n,y
|
||||
May,Malay,malay,,,y,,,,n,y
|
||||
Mlt,Maltese,maltese,,,,,,,,y
|
||||
Mon,Mongolian,mongolian,,,,,,n,,y
|
||||
Nep,Nepali,nepali,,,,,,n,,y
|
||||
Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y
|
||||
Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y
|
||||
Pes,Persian,persian,,,,,,,,y
|
||||
Pnb,Punjabi,punjabi,,,y,,,,,y
|
||||
Pol,Polish,polish,,,,,,,,y
|
||||
Por,Portuguese,portuguese,Romance,,y,,,,y,y
|
||||
Ron,Romanian,romanian,,,y,,,,,y
|
||||
Rus,Russian,russian,,,y,,,,,y
|
||||
Slo,Slovak,slovak,,,,,,n,,y
|
||||
Slv,Slovenian,slovenian,,,,,n,n,,n
|
||||
Snd,Sindhi,sindhi,,,,,,,,y
|
||||
Spa,Spanish,spanish,Romance,,y,,,,y,y
|
||||
Sqi,Albanian,albanian,,,,y,n,n,n,y
|
||||
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n
|
||||
Swe,Swedish,swedish,Scand,,y,,,,y,y
|
||||
Tam,Tamil,tamil,n,n,n,n,n,n,n,n
|
||||
Tel,Telugu,telugu,,,y,n,n,n,,n
|
||||
Tha,Thai,thai,,to_thai,,,,,,y
|
||||
Tur,Turkish,turkish,,,y,,,n,,n
|
||||
Urd,Urdu,urdu,Hindustani,,,,,,,y
|
||||
Som,Somali,somali,,,,,n,n,,n
|
||||
Zul,Zulu,zulu,,,,,n,n,,n
|
||||
Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis,MorphoDict
|
||||
Afr,Afrikaans,afrikaans,,,,,,n,,y,n
|
||||
Amh,Amharic,amharic,,,,,n,n,,n,n
|
||||
Ara,Arabic,arabic,,,,,,y,,y,y
|
||||
Bul,Bulgarian,bulgarian,,,y,,,,,y,n
|
||||
Cat,Catalan,catalan,Romance,,y,,,,y,y,n
|
||||
Cgg,Rukiga,rukiga,,,y,y,n,n,y,y,n
|
||||
Chi,Chinese (simplified),chinese,,,,,,,,y,y
|
||||
Cze,Czech,czech,,,,,,n,,y,n
|
||||
Dan,Danish,danish,Scand,,y,,,,,y,n
|
||||
Dut,Dutch,dutch,,,y,,,,,y,n
|
||||
Eng,English,english,,,y,,,,y,y,y
|
||||
Est,Estonian,estonian,,,,,,,,y,n
|
||||
Eus,Basque,basque,,,,,,,,y,n
|
||||
Fin,Finnish,finnish,,,y,,,,y,y,y
|
||||
Fre,French,french,Romance,,y,,,,y,y,y
|
||||
Ger,German,german,,,y,,,,,y,y
|
||||
Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n,n
|
||||
Gre,Greek,greek,,,,,,,,y,n
|
||||
Heb,Hebrew,hebrew,,,,,n,n,,n,n
|
||||
Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y,n
|
||||
Hrv,Croatian,croatian,,,,,,y,,n,n
|
||||
Hun,Hungarian,hungarian,,,n,y,y,y,n,n,n
|
||||
Ice,Icelandic,icelandic,,,,,,n,,y,n
|
||||
Ina,Interlingua,interlingua,,,y,,n,n,,n,n
|
||||
Ita,Italian,italian,Romance,,y,,,,y,y,y
|
||||
Jpn,Japanese,japanese,,,,,,,,y,n
|
||||
Kaz,Kazakh,kazakh,,,,y,n,n,n,y,n
|
||||
Kor,Korean,korean,,,n,y,y,y,n,n,n
|
||||
Lat,Latin,latin,,,,,y,y,n,y,n
|
||||
Lav,Latvian,latvian,,,,,,,y,y,n
|
||||
Mkd,Macedonian,macedonian,,,,y,n,n,n,y,n
|
||||
May,Malay,malay,,,y,,,,n,y,n
|
||||
Mlt,Maltese,maltese,,,,,,,,y,n
|
||||
Mon,Mongolian,mongolian,,,,,,n,,y,n
|
||||
Nep,Nepali,nepali,,,,,,n,,y,n
|
||||
Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y,n
|
||||
Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y,n
|
||||
Pes,Persian,persian,,,,,,,,y,n
|
||||
Pnb,Punjabi,punjabi,,,y,,,,,y,n
|
||||
Pol,Polish,polish,,,,,,,,y,n
|
||||
Por,Portuguese,portuguese,Romance,,y,,,,y,y,y
|
||||
Ron,Romanian,romanian,,,y,,,,,y,n
|
||||
Rus,Russian,russian,,,y,,,,,y,n
|
||||
Slo,Slovak,slovak,,,,,,n,,y,n
|
||||
Slv,Slovenian,slovenian,,,,,n,n,,n,n
|
||||
Snd,Sindhi,sindhi,,,,,,,,y,n
|
||||
Spa,Spanish,spanish,Romance,,y,,,,y,y,y
|
||||
Sqi,Albanian,albanian,,,,y,n,n,n,y,n
|
||||
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n,n
|
||||
Swe,Swedish,swedish,Scand,,y,,,,y,y,y
|
||||
Tam,Tamil,tamil,n,n,n,n,n,n,n,n,n
|
||||
Tel,Telugu,telugu,,,y,n,n,n,,n,n
|
||||
Tha,Thai,thai,,to_thai,,,,,,y,n
|
||||
Tur,Turkish,turkish,,,y,,,n,,n,n
|
||||
Urd,Urdu,urdu,Hindustani,,,,,,,y,n
|
||||
Som,Somali,somali,,,,,n,n,,n,n
|
||||
Zul,Zulu,zulu,,,,,n,n,,n,n
|
||||
|
||||
|
Reference in New Issue
Block a user