mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
overloaded api for all languages
This commit is contained in:
@@ -15,9 +15,9 @@ GFCP=$(GFC) -preproc=./mkPresent
|
||||
#GFCP=$(GFC) -preproc=mkPresent
|
||||
|
||||
|
||||
.PHONY: show-path all test alltenses pretest langs present mathematical multimodal compiled treebank stat gfdoc clean
|
||||
.PHONY: show-path all test alltenses pretest langs present mathematical multimodal compiled treebank stat gfdoc clean api
|
||||
|
||||
all: show-path present alltenses mathematical multimodal compiled langs
|
||||
all: show-path present alltenses mathematical api multimodal compiled langs
|
||||
|
||||
show-path:
|
||||
@echo GF_LIB_PATH=$(GF_LIB_PATH)
|
||||
@@ -46,6 +46,11 @@ alltenses:
|
||||
langs:
|
||||
echo "s ;; pm | wf langs.gfcm" | $(GFCA) -path=alltenses:prelude ../alltenses/Lang???.gfc $(RTSS)
|
||||
|
||||
api:
|
||||
$(GFC) api/Constructors???.gf
|
||||
$(GFC) api/Combinators???.gf
|
||||
$(GFC) api/Symbolic???.gf
|
||||
cp -p api/*.gfc api/*.gfr ../api
|
||||
|
||||
present:
|
||||
# $(GFCP) arabic/LangAra.gf
|
||||
|
||||
3
lib/resource-1.0/api/CombinatorsDan.gf
Normal file
3
lib/resource-1.0/api/CombinatorsDan.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsDan = Combinators with (Grammar = GrammarDan) ;
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../abstract:../common:../english:prelude
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsEng = Combinators with (Grammar = GrammarEng) ;
|
||||
|
||||
3
lib/resource-1.0/api/CombinatorsFin.gf
Normal file
3
lib/resource-1.0/api/CombinatorsFin.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsFin = Combinators with (Grammar = GrammarFin) ;
|
||||
3
lib/resource-1.0/api/CombinatorsFre.gf
Normal file
3
lib/resource-1.0/api/CombinatorsFre.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsFre = Combinators with (Grammar = GrammarFre) ;
|
||||
3
lib/resource-1.0/api/CombinatorsGer.gf
Normal file
3
lib/resource-1.0/api/CombinatorsGer.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsGer = Combinators with (Grammar = GrammarGer) ;
|
||||
3
lib/resource-1.0/api/CombinatorsIta.gf
Normal file
3
lib/resource-1.0/api/CombinatorsIta.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsIta = Combinators with (Grammar = GrammarIta) ;
|
||||
3
lib/resource-1.0/api/CombinatorsNor.gf
Normal file
3
lib/resource-1.0/api/CombinatorsNor.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsNor = Combinators with (Grammar = GrammarNor) ;
|
||||
3
lib/resource-1.0/api/CombinatorsRus.gf
Normal file
3
lib/resource-1.0/api/CombinatorsRus.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsRus = Combinators with (Grammar = GrammarRus) ;
|
||||
3
lib/resource-1.0/api/CombinatorsSpa.gf
Normal file
3
lib/resource-1.0/api/CombinatorsSpa.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsSpa = Combinators with (Grammar = GrammarSpa) ;
|
||||
3
lib/resource-1.0/api/CombinatorsSwe.gf
Normal file
3
lib/resource-1.0/api/CombinatorsSwe.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsSwe = Combinators with (Grammar = GrammarSwe) ;
|
||||
3
lib/resource-1.0/api/ConstructorsDan.gf
Normal file
3
lib/resource-1.0/api/ConstructorsDan.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsDan = Constructors with (Grammar = GrammarDan) ;
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../abstract:../common:../english:prelude
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsEng = Constructors with (Grammar = GrammarEng) ;
|
||||
|
||||
3
lib/resource-1.0/api/ConstructorsFin.gf
Normal file
3
lib/resource-1.0/api/ConstructorsFin.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsFin = Constructors with (Grammar = GrammarFin) ;
|
||||
3
lib/resource-1.0/api/ConstructorsFre.gf
Normal file
3
lib/resource-1.0/api/ConstructorsFre.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsFre = Constructors with (Grammar = GrammarFre) ;
|
||||
3
lib/resource-1.0/api/ConstructorsGer.gf
Normal file
3
lib/resource-1.0/api/ConstructorsGer.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsGer = Constructors with (Grammar = GrammarGer) ;
|
||||
3
lib/resource-1.0/api/ConstructorsIta.gf
Normal file
3
lib/resource-1.0/api/ConstructorsIta.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsIta = Constructors with (Grammar = GrammarIta) ;
|
||||
3
lib/resource-1.0/api/ConstructorsNor.gf
Normal file
3
lib/resource-1.0/api/ConstructorsNor.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsNor = Constructors with (Grammar = GrammarNor) ;
|
||||
3
lib/resource-1.0/api/ConstructorsRus.gf
Normal file
3
lib/resource-1.0/api/ConstructorsRus.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsRus = Constructors with (Grammar = GrammarRus) ;
|
||||
3
lib/resource-1.0/api/ConstructorsSpa.gf
Normal file
3
lib/resource-1.0/api/ConstructorsSpa.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsSpa = Constructors with (Grammar = GrammarSpa) ;
|
||||
3
lib/resource-1.0/api/ConstructorsSwe.gf
Normal file
3
lib/resource-1.0/api/ConstructorsSwe.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsSwe = Constructors with (Grammar = GrammarSwe) ;
|
||||
39
lib/resource-1.0/api/Port.hs
Normal file
39
lib/resource-1.0/api/Port.hs
Normal file
@@ -0,0 +1,39 @@
|
||||
import System
|
||||
|
||||
main = mapM_ (\la -> mapM_ (\fi -> port "Eng" fi la) files) languages
|
||||
|
||||
languages = words "Dan Eng Fin Fre Ger Ita Nor Rus Spa Swe"
|
||||
langlong = words
|
||||
"danish english finnish french german italian norwegian russian spanish swedish"
|
||||
families = [
|
||||
("romance", ["french", "italian", "spanish"]),
|
||||
("scandinavian",["danish","norwegian","swedish"])
|
||||
]
|
||||
|
||||
longname lang =
|
||||
maybe (error ("no " ++ lang)) id $ lookup lang $ zip languages langlong
|
||||
|
||||
files = words "Combinators Constructors Symbolic"
|
||||
|
||||
port src file dst
|
||||
| src == dst = return ()
|
||||
| otherwise = do
|
||||
let fdst = file ++ dst ++ ".gf"
|
||||
system $ "cp " ++ file ++ src ++ ".gf " ++ fdst
|
||||
let longsrc = longname src
|
||||
let longdst = longname dst
|
||||
-- putStrLn $ "sed -i 's/" ++ longsrc ++ "/" ++ longdst ++ "/g' " ++ fdst
|
||||
-- system $ "sed -i 's/" ++ longsrc ++ "/" ++ longdst ++ "/g' " ++ fdst
|
||||
putStrLn $ "sed -i 's/" ++ src ++ "/" ++ dst ++ "/g' " ++ fdst
|
||||
system $ "sed -i 's/" ++ src ++ "/" ++ dst ++ "/g' " ++ fdst
|
||||
-- addFamily longdst fdst
|
||||
return ()
|
||||
|
||||
addFamily ldst fdst = maybe (return ()) add $ lookup ldst fams where
|
||||
fams = [(l,f) | (f,ls) <- families, l <- ls]
|
||||
add fam = do
|
||||
putStrLn $
|
||||
"sed -i 's/" ++ ldst ++ "/" ++ ldst ++ ":\\.\\.\\/" ++ fam ++ "/g' " ++ fdst
|
||||
system $
|
||||
"sed -i 's/" ++ ldst ++ "/" ++ ldst ++ ":\\.\\.\\/" ++ fam ++ "/g' " ++ fdst
|
||||
return ()
|
||||
5
lib/resource-1.0/api/SymbolicDan.gf
Normal file
5
lib/resource-1.0/api/SymbolicDan.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicDan = Symbolic with
|
||||
(Symbol = SymbolDan),
|
||||
(Grammar = GrammarDan) ;
|
||||
@@ -1,4 +1,4 @@
|
||||
--# -path=.:../abstract:../common:../english:../mathematical:prelude
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicEng = Symbolic with
|
||||
(Symbol = SymbolEng),
|
||||
|
||||
5
lib/resource-1.0/api/SymbolicFin.gf
Normal file
5
lib/resource-1.0/api/SymbolicFin.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicFin = Symbolic with
|
||||
(Symbol = SymbolFin),
|
||||
(Grammar = GrammarFin) ;
|
||||
5
lib/resource-1.0/api/SymbolicFre.gf
Normal file
5
lib/resource-1.0/api/SymbolicFre.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicFre = Symbolic with
|
||||
(Symbol = SymbolFre),
|
||||
(Grammar = GrammarFre) ;
|
||||
5
lib/resource-1.0/api/SymbolicGer.gf
Normal file
5
lib/resource-1.0/api/SymbolicGer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicGer = Symbolic with
|
||||
(Symbol = SymbolGer),
|
||||
(Grammar = GrammarGer) ;
|
||||
5
lib/resource-1.0/api/SymbolicIta.gf
Normal file
5
lib/resource-1.0/api/SymbolicIta.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicIta = Symbolic with
|
||||
(Symbol = SymbolIta),
|
||||
(Grammar = GrammarIta) ;
|
||||
5
lib/resource-1.0/api/SymbolicNor.gf
Normal file
5
lib/resource-1.0/api/SymbolicNor.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicNor = Symbolic with
|
||||
(Symbol = SymbolNor),
|
||||
(Grammar = GrammarNor) ;
|
||||
5
lib/resource-1.0/api/SymbolicRus.gf
Normal file
5
lib/resource-1.0/api/SymbolicRus.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicRus = Symbolic with
|
||||
(Symbol = SymbolRus),
|
||||
(Grammar = GrammarRus) ;
|
||||
5
lib/resource-1.0/api/SymbolicSpa.gf
Normal file
5
lib/resource-1.0/api/SymbolicSpa.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicSpa = Symbolic with
|
||||
(Symbol = SymbolSpa),
|
||||
(Grammar = GrammarSpa) ;
|
||||
5
lib/resource-1.0/api/SymbolicSwe.gf
Normal file
5
lib/resource-1.0/api/SymbolicSwe.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:mathematical:prelude
|
||||
|
||||
resource SymbolicSwe = Symbolic with
|
||||
(Symbol = SymbolSwe),
|
||||
(Grammar = GrammarSwe) ;
|
||||
Reference in New Issue
Block a user