1
0
forked from GitHub/gf-rgl

Update language config with "All" column; fix those marked for notpresent

Also fix bug in boolBit
This commit is contained in:
John J. Camilleri
2018-08-06 21:55:58 +02:00
parent bad78999dc
commit cfb6bf0301
3 changed files with 53 additions and 51 deletions

12
Make.hs
View File

@@ -191,7 +191,7 @@ rglCommands =
summary f langs = unwords (map (drop (length sourceDir + 1) . f) langs) summary f langs = unwords (map (drop (length sourceDir + 1) . f) langs)
-- summary f _ = f (LangInfo "*" "*" Nothing Nothing False False False False) -- summary f _ = f (LangInfo "*" "*" Nothing Nothing False False False False)
l mode args = (lang,optml mode (const True) args) l mode args = (lang,optml mode langAll args)
s mode args = (symbol,optml mode langAPI args) s mode args = (symbol,optml mode langAPI args)
c mode args = (compat,optml AllTenses langCompatibility args) c mode args = (compat,optml AllTenses langCompatibility args)
t mode args = (try,optml mode langAPI args) t mode args = (try,optml mode langAPI args)
@@ -310,6 +310,7 @@ data LangInfo = LangInfo
, langFunctor :: Maybe String -- ^ functor (not used) , langFunctor :: Maybe String -- ^ functor (not used)
, langUnlexer :: Maybe String -- ^ decoding for postprocessing linearizations , langUnlexer :: Maybe String -- ^ decoding for postprocessing linearizations
, langPresent :: Bool , langPresent :: Bool
, langAll :: Bool
, langAPI :: Bool , langAPI :: Bool
, langSymbolic :: Bool , langSymbolic :: Bool
, langCompatibility :: Bool , langCompatibility :: Bool
@@ -323,7 +324,7 @@ loadLangs = do
where where
conffile = "languages.csv" conffile = "languages.csv"
maybeBit bits n = if length bits >= (n+1) && length (bits !! n) > 0 then Just (bits !! n) else Nothing maybeBit bits n = if length bits >= (n+1) && length (bits !! n) > 0 then Just (bits !! n) else Nothing
boolBit bits n def = if length bits >= (n+1) && length (bits !! n) > 0 then (bits !! n == if def then "n" else "y") else def boolBit bits n def = if length bits >= (n+1) && length (bits !! n) > 0 then (if def then bits !! n /= "n" else bits !! n == "y") else def
mkLangInfo s = mkLangInfo s =
let bits = separateBy ',' s in let bits = separateBy ',' s in
if length bits < 2 if length bits < 2
@@ -334,9 +335,10 @@ loadLangs = do
, langFunctor = maybeBit bits 2 , langFunctor = maybeBit bits 2
, langUnlexer = maybeBit bits 3 , langUnlexer = maybeBit bits 3
, langPresent = boolBit bits 4 False , langPresent = boolBit bits 4 False
, langAPI = boolBit bits 5 True , langAll = boolBit bits 5 True
, langSymbolic = boolBit bits 6 True , langAPI = boolBit bits 6 True
, langCompatibility = boolBit bits 7 False , langSymbolic = boolBit bits 7 True
, langCompatibility = boolBit bits 8 False
} }
-- | Separate a string on a character -- | Separate a string on a character

View File

@@ -35,6 +35,7 @@ Description of columns:
- Functor: (not used) - Functor: (not used)
- Unlexer - Unlexer
- Present: languages that have notpresent marked - Present: languages that have notpresent marked
- All: languages for which to compile All
- API: languages for which to compile Try - API: languages for which to compile Try
- Symbolic: languages for which to compile Symbolic - Symbolic: languages for which to compile Symbolic
- Compatibility: languages for which Compatibility exists - Compatibility: languages for which Compatibility exists

View File

@@ -1,46 +1,45 @@
Code,Directory,Functor,Unlexer,Present,API,Symbolic,Compatibility Code,Directory,Functor,Unlexer,Present,All,API,Symbolic,Compatibility
Afr,afrikaans,,,y,,n, Afr,afrikaans,,,,,,n,
Amh,amharic,,,,n,n, Amh,amharic,,,,,n,n,
Ara,arabic,,,,n,n, Ara,arabic,,,,,n,n,
Eus,basque,,,,,, Eus,basque,,,,,,,
Bul,bulgarian,,,y,,,y Bul,bulgarian,,,y,,,,
Cat,catalan,Romance,,y,,,y Cat,catalan,Romance,,y,,,,y
Chi,chinese,,,y,,, Chi,chinese,,,,,,,
Dan,danish,Scand,,y,,, Dan,danish,Scand,,y,,,,
Dut,dutch,,,y,,, Dut,dutch,,,y,,,,
Eng,english,,,y,,,y Eng,english,,,y,,,,y
Est,estonian,,,y,,, Est,estonian,,,,,,,
Fin,finnish,,,y,,,y Fin,finnish,,,y,,,,y
Fre,french,Romance,,y,,,y Fre,french,Romance,,y,,,,y
Grc,ancient_greek,,,y,n,n, Grc,ancient_greek,,,y,,n,n,
Gre,greek,,,y,,, Gre,greek,,,,,,,
Heb,hebrew,,,,n,n, Heb,hebrew,,,,,n,n,
Hin,hindi,Hindustani,to_devanagari,y,,, Hin,hindi,Hindustani,to_devanagari,y,,,,
Hun,hungarian,,,y,,, Hun,hungarian,,,y,n,n,n,
Ger,german,,,,,, Ger,german,,,,,,,
Ice,icelandic,,,y,,n, Ice,icelandic,,,,,,n,
Ina,interlingua,,,y,n,n, Ina,interlingua,,,y,,n,n,
Ita,italian,Romance,,y,,,y Ita,italian,Romance,,y,,,,y
Jpn,japanese,,,y,,, Jpn,japanese,,,,,,,
Lat,latin,,,y,n,n, Lat,latin,,,y,,n,n,
Lav,latvian,,,,,,y Lav,latvian,,,,,,,y
Mlt,maltese,,,,,, Mlt,maltese,,,,,,,
Mon,mongolian,,,y,,n, Mon,mongolian,,,,,,n,
Nep,nepali,,,y,,n, Nep,nepali,,,,,,n,
Nor,norwegian,Scand,,y,,, Nor,norwegian,Scand,,y,,,,
Nno,nynorsk,,,y,,, Nno,nynorsk,,,y,,,,
Pes,persian,,,y,,, Pes,persian,,,,,,,
Pol,polish,,,,,, Pol,polish,,,,,,,
Por,portuguese,Romance,,y,,,y Por,portuguese,Romance,,y,,,,y
Pnb,punjabi,,,y,,, Pnb,punjabi,,,y,,,,
Ron,romanian,,,y,,, Ron,romanian,,,y,,,,
Rus,russian,,,y,,, Rus,russian,,,y,,,,
Snd,sindhi,,,y,,, Snd,sindhi,,,,,,,
Spa,spanish,Romance,,y,,,y Spa,spanish,Romance,,y,,,,y
Swa,swahili,,,,,,y Swa,swahili,,,,n,n,n,y
Swe,swedish,Scand,,y,,,y Swe,swedish,Scand,,y,,,,y
Tel,telugu,,,y,,, Tel,telugu,,,y,n,n,n,
Tha,thai,,to_thai,y,,, Tha,thai,,to_thai,,,,,
Tur,turkish,,,,n,n, Tur,turkish,,,,,n,n,
Urd,urdu,Hindustani,,y,,, Urd,urdu,Hindustani,,,,,,
Vot,votic,,,,,,
1 Code Directory Functor Unlexer Present All API Symbolic Compatibility
2 Afr afrikaans y n
3 Amh amharic n n
4 Ara arabic n n
5 Eus basque
6 Bul bulgarian y y
7 Cat catalan Romance y y
8 Chi chinese y
9 Dan danish Scand y
10 Dut dutch y
11 Eng english y y
12 Est estonian y
13 Fin finnish y y
14 Fre french Romance y y
15 Grc ancient_greek y n n
16 Gre greek y
17 Heb hebrew n n
18 Hin hindi Hindustani to_devanagari y
19 Hun hungarian y n n n
20 Ger german
21 Ice icelandic y n
22 Ina interlingua y n n
23 Ita italian Romance y y
24 Jpn japanese y
25 Lat latin y n n
26 Lav latvian y
27 Mlt maltese
28 Mon mongolian y n
29 Nep nepali y n
30 Nor norwegian Scand y
31 Nno nynorsk y
32 Pes persian y
33 Pol polish
34 Por portuguese Romance y y
35 Pnb punjabi y
36 Ron romanian y
37 Rus russian y
38 Snd sindhi y
39 Spa spanish Romance y y
40 Swa swahili n n n y
41 Swe swedish Scand y y
42 Tel telugu y n n n
43 Tha thai to_thai y
44 Tur turkish n n
45 Urd urdu Hindustani y
Vot votic