mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-28 12:18:54 -06:00
SymbPN and SymbCN in resources
This commit is contained in:
@@ -168,6 +168,9 @@ fun
|
|||||||
UseFun : Fun -> CN ; -- "successor"
|
UseFun : Fun -> CN ; -- "successor"
|
||||||
UseInt : Int -> Num ; -- "32" --- assumes i > 1
|
UseInt : Int -> Num ; -- "32" --- assumes i > 1
|
||||||
|
|
||||||
|
SymbPN : String -> PN ; -- "x"
|
||||||
|
SymbCN : CN -> String -> CN ; -- "number x"
|
||||||
|
|
||||||
ModAdj : AP -> CN -> CN ; -- "red car"
|
ModAdj : AP -> CN -> CN ; -- "red car"
|
||||||
DetNP : Det -> CN -> NP ; -- "every car"
|
DetNP : Det -> CN -> NP ; -- "every car"
|
||||||
MassNP : CN -> NP ; -- "wine"
|
MassNP : CN -> NP ; -- "wine"
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ lin
|
|||||||
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
|
|
||||||
|
SymbPN i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
PosVG = predVerbGroup True ;
|
PosVG = predVerbGroup True ;
|
||||||
NegVG = predVerbGroup False ;
|
NegVG = predVerbGroup False ;
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ oper
|
|||||||
mkFunCN : CN -> Preposition -> Fun ;
|
mkFunCN : CN -> Preposition -> Fun ;
|
||||||
funOfCN : CN -> Fun ;
|
funOfCN : CN -> Fun ;
|
||||||
|
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
|
|
||||||
-- Non-comparison one-place adjectives just have one form.
|
-- Non-comparison one-place adjectives just have one form.
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ lin
|
|||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
UseInt i = {s = \\_ => i.s ; isNum = True} ; --- case endings sometimes needed
|
UseInt i = {s = \\_ => i.s ; isNum = True} ; --- case endings sometimes needed
|
||||||
|
|
||||||
|
SymbPN i = {s = \\_ => i.s} ; --- case endings often needed
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
CNthatS = nounThatSentence ;
|
CNthatS = nounThatSentence ;
|
||||||
|
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
|
|||||||
@@ -109,6 +109,11 @@ lin
|
|||||||
PosVG = predVerbGroup True ;
|
PosVG = predVerbGroup True ;
|
||||||
NegVG = predVerbGroup False ;
|
NegVG = predVerbGroup False ;
|
||||||
|
|
||||||
|
SymbPN i = {s = \\_ => i.s} ;
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
PredV = predVerb ;
|
PredV = predVerb ;
|
||||||
PredAP = predAdjective ;
|
PredAP = predAdjective ;
|
||||||
PredCN = predCommNoun ;
|
PredCN = predCommNoun ;
|
||||||
|
|||||||
@@ -103,6 +103,11 @@ lin
|
|||||||
UseInt i = {s = \\_ => i.s} ;
|
UseInt i = {s = \\_ => i.s} ;
|
||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
|
|
||||||
|
SymbPN i = {s = i.s ; g = Masc} ; --- cannot know gender
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\n => cn.s ! n ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
CNthatS = nounThatSentence ;
|
CNthatS = nounThatSentence ;
|
||||||
|
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
|
|||||||
@@ -132,6 +132,14 @@ lin
|
|||||||
UseInt i = useInt i.s;
|
UseInt i = useInt i.s;
|
||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
|
|
||||||
|
--- these two by AR 3/6/2004
|
||||||
|
SymbPN i = {s = \\_ => i.s ; g = Neut ; anim = Inanimate} ; ---
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
||||||
|
g = cn.g ;
|
||||||
|
anim = cn.anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
DetNP = detNounPhrase ;
|
DetNP = detNounPhrase ;
|
||||||
IndefOneNP = indefNounPhrase Sg ;
|
IndefOneNP = indefNounPhrase Sg ;
|
||||||
|
|||||||
@@ -103,6 +103,14 @@ lin
|
|||||||
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
|
|
||||||
|
SymbPN i = {s = \\_ => i.s ; g = Neutr ; x = NoMasc} ;
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||||
|
g = cn.g ;
|
||||||
|
x = cn.x ;
|
||||||
|
p = cn.p
|
||||||
|
} ;
|
||||||
|
|
||||||
CNthatS = nounThatSentence ;
|
CNthatS = nounThatSentence ;
|
||||||
|
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ getCanonModule file = do
|
|||||||
getCanonGrammar :: FilePath -> IOE CanonGrammar
|
getCanonGrammar :: FilePath -> IOE CanonGrammar
|
||||||
getCanonGrammar file = do
|
getCanonGrammar file = do
|
||||||
s <- ioeIO $ readFileIf file
|
s <- ioeIO $ readFileIf file
|
||||||
c <- ioeErr $ err2err $ pCanon $ myLexer s
|
c <- ioeErr {- $ err2err -} $ pCanon $ myLexer s
|
||||||
return $ canon2grammar c
|
return $ canon2grammar c
|
||||||
|
|||||||
@@ -87,15 +87,16 @@ compileModule opts1 st0 file = do
|
|||||||
let ps = if useFileOpt
|
let ps = if useFileOpt
|
||||||
then (map (prefixPathName fpath) ps0)
|
then (map (prefixPathName fpath) ps0)
|
||||||
else ps0
|
else ps0
|
||||||
ioeIO $ putStrLn $ "module search path:" +++ show ps ----
|
let ioeIOIf = if oElem beSilent opts then (const (return ())) else ioeIO
|
||||||
|
ioeIOIf $ putStrLn $ "module search path:" +++ show ps ----
|
||||||
let putp = putPointE opts
|
let putp = putPointE opts
|
||||||
let st = st0 --- if useFileOpt then emptyShellState else st0
|
let st = st0 --- if useFileOpt then emptyShellState else st0
|
||||||
let rfs = readFiles st
|
let rfs = readFiles st
|
||||||
let file' = if useFileOpt then justFileName file else file -- to find file itself
|
let file' = if useFileOpt then justFileName file else file -- to find file itself
|
||||||
files <- getAllFiles opts ps rfs file'
|
files <- getAllFiles opts ps rfs file'
|
||||||
ioeIO $ putStrLn $ "files to read:" +++ show files ----
|
ioeIOIf $ putStrLn $ "files to read:" +++ show files ----
|
||||||
let names = map justModuleName files
|
let names = map justModuleName files
|
||||||
ioeIO $ putStrLn $ "modules to include:" +++ show names ----
|
ioeIOIf $ putStrLn $ "modules to include:" +++ show names ----
|
||||||
let env0 = compileEnvShSt st names
|
let env0 = compileEnvShSt st names
|
||||||
(_,sgr,cgr) <- foldM (compileOne opts) env0 files
|
(_,sgr,cgr) <- foldM (compileOne opts) env0 files
|
||||||
t <- ioeIO getNowTime
|
t <- ioeIO getNowTime
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ getSourceModule :: FilePath -> IOE SourceModule
|
|||||||
getSourceModule file = do
|
getSourceModule file = do
|
||||||
string <- readFileIOE file
|
string <- readFileIOE file
|
||||||
let tokens = myLexer string
|
let tokens = myLexer string
|
||||||
mo1 <- ioeErr $ err2err $ pModDef tokens
|
mo1 <- ioeErr $ {- err2err $ -} pModDef tokens
|
||||||
ioeErr $ transModDef mo1
|
ioeErr $ transModDef mo1
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ parseOldGrammar :: FilePath -> IOE ([FilePath],[A.TopDef])
|
|||||||
parseOldGrammar file = do
|
parseOldGrammar file = do
|
||||||
putStrE $ "reading old file" +++ file
|
putStrE $ "reading old file" +++ file
|
||||||
s <- ioeIO $ readFileIf file
|
s <- ioeIO $ readFileIf file
|
||||||
A.OldGr incl topdefs <- ioeErr $ err2err $ pOldGrammar $ oldLexer $ fixNewlines s
|
A.OldGr incl topdefs <- ioeErr $ {- err2err $ -} pOldGrammar $ oldLexer $ fixNewlines s
|
||||||
includes <- ioeErr $ transInclude incl
|
includes <- ioeErr $ transInclude incl
|
||||||
return (includes, topdefs)
|
return (includes, topdefs)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import Operations
|
|||||||
|
|
||||||
pTerm :: String -> Err Term
|
pTerm :: String -> Err Term
|
||||||
pTerm s = do
|
pTerm s = do
|
||||||
e <- err2err $ pExp $ myLexer s
|
e <- {- err2err $ -} pExp $ myLexer s
|
||||||
transExp e
|
transExp e
|
||||||
|
|
||||||
pTrm :: String -> Term
|
pTrm :: String -> Term
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module Today where today = "Fri May 28 15:17:28 CEST 2004"
|
module Today where today = "Thu Jun 3 19:06:03 CEST 2004"
|
||||||
|
|||||||
Reference in New Issue
Block a user