overloaded api for all languages

This commit is contained in:
aarne
2006-12-22 10:42:06 +00:00
parent da339b2686
commit 4d6a1d7bad
32 changed files with 148 additions and 5 deletions

View File

@@ -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

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsDan = Combinators with (Grammar = GrammarDan) ;

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:../english:prelude
--# -path=.:alltenses:prelude
resource CombinatorsEng = Combinators with (Grammar = GrammarEng) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsFin = Combinators with (Grammar = GrammarFin) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsFre = Combinators with (Grammar = GrammarFre) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsGer = Combinators with (Grammar = GrammarGer) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsIta = Combinators with (Grammar = GrammarIta) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsNor = Combinators with (Grammar = GrammarNor) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsRus = Combinators with (Grammar = GrammarRus) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsSpa = Combinators with (Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource CombinatorsSwe = Combinators with (Grammar = GrammarSwe) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsDan = Constructors with (Grammar = GrammarDan) ;

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:../english:prelude
--# -path=.:alltenses:prelude
resource ConstructorsEng = Constructors with (Grammar = GrammarEng) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFin = Constructors with (Grammar = GrammarFin) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFre = Constructors with (Grammar = GrammarFre) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsGer = Constructors with (Grammar = GrammarGer) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsIta = Constructors with (Grammar = GrammarIta) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsNor = Constructors with (Grammar = GrammarNor) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsRus = Constructors with (Grammar = GrammarRus) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSpa = Constructors with (Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSwe = Constructors with (Grammar = GrammarSwe) ;

View 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 ()

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicDan = Symbolic with
(Symbol = SymbolDan),
(Grammar = GrammarDan) ;

View File

@@ -1,4 +1,4 @@
--# -path=.:../abstract:../common:../english:../mathematical:prelude
--# -path=.:present:mathematical:prelude
resource SymbolicEng = Symbolic with
(Symbol = SymbolEng),

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicFin = Symbolic with
(Symbol = SymbolFin),
(Grammar = GrammarFin) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicFre = Symbolic with
(Symbol = SymbolFre),
(Grammar = GrammarFre) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicGer = Symbolic with
(Symbol = SymbolGer),
(Grammar = GrammarGer) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicIta = Symbolic with
(Symbol = SymbolIta),
(Grammar = GrammarIta) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicNor = Symbolic with
(Symbol = SymbolNor),
(Grammar = GrammarNor) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicRus = Symbolic with
(Symbol = SymbolRus),
(Grammar = GrammarRus) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicSpa = Symbolic with
(Symbol = SymbolSpa),
(Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude
resource SymbolicSwe = Symbolic with
(Symbol = SymbolSwe),
(Grammar = GrammarSwe) ;