resource lib name changed
BIN
lib/resource/doc/10lang-large.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
lib/resource/doc/10lang-small.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
107
lib/resource/doc/German.dot
Normal file
@@ -0,0 +1,107 @@
|
||||
digraph {
|
||||
|
||||
size = "12,12" ;
|
||||
|
||||
LangGer [style = "dashed", shape = "box", URL = "LangGer.gf"];
|
||||
LangGer -> NounGer [style = "solid"];
|
||||
LangGer -> VerbGer [style = "solid"];
|
||||
LangGer -> ConjunctionGer [style = "solid"];
|
||||
LangGer -> StructuralGer [style = "solid"];
|
||||
LangGer -> LexiconGer [style = "solid"];
|
||||
LangGer -> Lang [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
|
||||
Lang -> Noun [style = "solid"];
|
||||
Lang -> Verb [style = "solid"];
|
||||
Lang -> Conjunction [style = "solid"];
|
||||
Lang -> Structural [style = "solid"];
|
||||
Lang -> Lexicon [style = "solid"];
|
||||
|
||||
NounGer [style = "dashed", shape = "box", URL = "NounGer.gf"];
|
||||
NounGer -> CatGer [style = "solid"];
|
||||
NounGer -> ResGer [style = "dotted"];
|
||||
NounGer -> Prelude [style = "dotted"];
|
||||
NounGer -> Noun [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
|
||||
Noun -> Cat [style = "solid"];
|
||||
|
||||
VerbGer [style = "dashed", shape = "box", URL = "VerbGer.gf"];
|
||||
VerbGer -> CatGer [style = "solid"];
|
||||
VerbGer -> Prelude [style = "dotted"];
|
||||
VerbGer -> ResGer [style = "dotted"];
|
||||
VerbGer -> Verb [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
|
||||
Verb -> Cat [style = "solid"];
|
||||
|
||||
ConjunctionGer [style = "dashed", shape = "box", URL = "ConjunctionGer.gf"];
|
||||
ConjunctionGer -> CatGer [style = "solid"];
|
||||
ConjunctionGer -> ResGer [style = "dotted"];
|
||||
ConjunctionGer -> Coordination [style = "dotted"];
|
||||
ConjunctionGer -> Prelude [style = "dotted"];
|
||||
ConjunctionGer -> Conjunction [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
|
||||
Conjunction -> Cat [style = "solid"];
|
||||
|
||||
Coordination [style = "dashed", shape = "ellipse", URL = "Coordination.gf"];
|
||||
Coordination -> Prelude [style = "dotted"];
|
||||
|
||||
StructuralGer [style = "dashed", shape = "box", URL = "StructuralGer.gf"];
|
||||
StructuralGer -> CatGer [style = "solid"];
|
||||
StructuralGer -> MorphoGer [style = "dotted"];
|
||||
StructuralGer -> Prelude [style = "dotted"];
|
||||
StructuralGer -> Structural [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
|
||||
Structural -> Cat [style = "solid"];
|
||||
|
||||
LexiconGer [style = "dashed", shape = "box", URL = "LexiconGer.gf"];
|
||||
LexiconGer -> CatGer [style = "solid"];
|
||||
LexiconGer -> Prelude [style = "dotted"];
|
||||
LexiconGer -> ParadigmsGer [style = "dotted"];
|
||||
LexiconGer -> Lexicon [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
|
||||
Lexicon -> Cat [style = "solid"];
|
||||
|
||||
ParadigmsGer [style = "dashed", shape = "ellipse", URL = "ParadigmsGer.gf"];
|
||||
ParadigmsGer -> Predef [style = "dotted"];
|
||||
ParadigmsGer -> Prelude [style = "dotted"];
|
||||
ParadigmsGer -> MorphoGer [style = "dotted"];
|
||||
ParadigmsGer -> CatGer [style = "dotted"];
|
||||
|
||||
CatGer [style = "dashed", shape = "box", URL = "CatGer.gf"];
|
||||
CatGer -> CommonX [style = "solid"];
|
||||
CatGer -> ResGer [style = "dotted"];
|
||||
CatGer -> Prelude [style = "dotted"];
|
||||
CatGer -> Cat [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
|
||||
Cat -> Common [style = "solid"];
|
||||
|
||||
CommonX [style = "dashed", shape = "box", URL = "CommonX.gf"];
|
||||
CommonX -> ParamX [style = "dotted"];
|
||||
CommonX -> Common [arrowhead = "empty", style = "dashed"];
|
||||
|
||||
Common [style = "solid", shape = "ellipse", URL = "Common.gf"];
|
||||
|
||||
MorphoGer [style = "dashed", shape = "ellipse", URL = "MorphoGer.gf"];
|
||||
MorphoGer -> ResGer [style = "solid"];
|
||||
MorphoGer -> Prelude [style = "dotted"];
|
||||
MorphoGer -> Predef [style = "dotted"];
|
||||
|
||||
ResGer [style = "dashed", shape = "ellipse", URL = "ResGer.gf"];
|
||||
ResGer -> ParamX [style = "solid"];
|
||||
ResGer -> Prelude [style = "dotted"];
|
||||
|
||||
ParamX [style = "dashed", shape = "ellipse", URL = "ParamX.gf"];
|
||||
ParamX -> Prelude [style = "dotted"];
|
||||
|
||||
Prelude [style = "dashed", shape = "ellipse", URL = "Prelude.gf"];
|
||||
Prelude -> Predef [style = "dotted"];
|
||||
|
||||
Predef [style = "dashed", shape = "ellipse", URL = "Predef.gf"];
|
||||
|
||||
}
|
||||
BIN
lib/resource/doc/German.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
75
lib/resource/doc/Grammar.dot
Normal file
@@ -0,0 +1,75 @@
|
||||
digraph {
|
||||
|
||||
size = "12,8" ;
|
||||
|
||||
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
|
||||
|
||||
Lang -> Grammar [style = "solid"];
|
||||
Lang -> Lexicon [style = "solid"];
|
||||
|
||||
Grammar [style = "solid", shape = "ellipse", URL = "Lang.gf"];
|
||||
|
||||
|
||||
Grammar -> Noun [style = "solid"];
|
||||
Grammar -> Verb [style = "solid"];
|
||||
Grammar -> Adjective [style = "solid"];
|
||||
Grammar -> Adverb [style = "solid"];
|
||||
Grammar -> Numeral [style = "solid"];
|
||||
Grammar -> Sentence [style = "solid"];
|
||||
Grammar -> Question [style = "solid"];
|
||||
Grammar -> Relative [style = "solid"];
|
||||
Grammar -> Conjunction [style = "solid"];
|
||||
Grammar -> Phrase [style = "solid"];
|
||||
Grammar -> Text [style = "solid"];
|
||||
Grammar -> Idiom [style = "solid"];
|
||||
Grammar -> Structural [style = "solid"];
|
||||
|
||||
|
||||
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
|
||||
Noun -> Cat [style = "solid"];
|
||||
|
||||
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
|
||||
Verb -> Cat [style = "solid"];
|
||||
|
||||
Adjective [style = "solid", shape = "ellipse", URL = "Adjective.gf"];
|
||||
Adjective -> Cat [style = "solid"];
|
||||
|
||||
Adverb [style = "solid", shape = "ellipse", URL = "Adverb.gf"];
|
||||
Adverb -> Cat [style = "solid"];
|
||||
|
||||
Numeral [style = "solid", shape = "ellipse", URL = "Numeral.gf"];
|
||||
Numeral -> Cat [style = "solid"];
|
||||
|
||||
Sentence [style = "solid", shape = "ellipse", URL = "Sentence.gf"];
|
||||
Sentence -> Cat [style = "solid"];
|
||||
|
||||
Question [style = "solid", shape = "ellipse", URL = "Question.gf"];
|
||||
Question -> Cat [style = "solid"];
|
||||
|
||||
Relative [style = "solid", shape = "ellipse", URL = "Relative.gf"];
|
||||
Relative -> Cat [style = "solid"];
|
||||
|
||||
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
|
||||
Conjunction -> Cat [style = "solid"];
|
||||
|
||||
Phrase [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Phrase -> Cat [style = "solid"];
|
||||
|
||||
Text [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Text -> Cat [style = "solid"];
|
||||
|
||||
Idiom [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Idiom -> Cat [style = "solid"];
|
||||
|
||||
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
|
||||
Structural -> Cat [style = "solid"];
|
||||
|
||||
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
|
||||
Lexicon -> Cat [style = "solid"];
|
||||
|
||||
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
|
||||
Cat -> Common [style = "solid"];
|
||||
|
||||
Common [style = "solid", shape = "ellipse", URL = "Tense.gf"];
|
||||
|
||||
}
|
||||
BIN
lib/resource/doc/Grammar.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
68
lib/resource/doc/Lang.dot
Normal file
@@ -0,0 +1,68 @@
|
||||
digraph {
|
||||
|
||||
size = "12,8" ;
|
||||
|
||||
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
|
||||
Lang -> Noun [style = "solid"];
|
||||
Lang -> Verb [style = "solid"];
|
||||
Lang -> Adjective [style = "solid"];
|
||||
Lang -> Adverb [style = "solid"];
|
||||
Lang -> Numeral [style = "solid"];
|
||||
Lang -> Sentence [style = "solid"];
|
||||
Lang -> Question [style = "solid"];
|
||||
Lang -> Relative [style = "solid"];
|
||||
Lang -> Conjunction [style = "solid"];
|
||||
Lang -> Phrase [style = "solid"];
|
||||
Lang -> Text [style = "solid"];
|
||||
Lang -> Idiom [style = "solid"];
|
||||
Lang -> Structural [style = "solid"];
|
||||
Lang -> Lexicon [style = "solid"];
|
||||
|
||||
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
|
||||
Noun -> Cat [style = "solid"];
|
||||
|
||||
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
|
||||
Verb -> Cat [style = "solid"];
|
||||
|
||||
Adjective [style = "solid", shape = "ellipse", URL = "Adjective.gf"];
|
||||
Adjective -> Cat [style = "solid"];
|
||||
|
||||
Adverb [style = "solid", shape = "ellipse", URL = "Adverb.gf"];
|
||||
Adverb -> Cat [style = "solid"];
|
||||
|
||||
Numeral [style = "solid", shape = "ellipse", URL = "Numeral.gf"];
|
||||
Numeral -> Cat [style = "solid"];
|
||||
|
||||
Sentence [style = "solid", shape = "ellipse", URL = "Sentence.gf"];
|
||||
Sentence -> Cat [style = "solid"];
|
||||
|
||||
Question [style = "solid", shape = "ellipse", URL = "Question.gf"];
|
||||
Question -> Cat [style = "solid"];
|
||||
|
||||
Relative [style = "solid", shape = "ellipse", URL = "Relative.gf"];
|
||||
Relative -> Cat [style = "solid"];
|
||||
|
||||
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
|
||||
Conjunction -> Cat [style = "solid"];
|
||||
|
||||
Phrase [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Phrase -> Cat [style = "solid"];
|
||||
|
||||
Text [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Text -> Cat [style = "solid"];
|
||||
|
||||
Idiom [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Idiom -> Cat [style = "solid"];
|
||||
|
||||
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
|
||||
Structural -> Cat [style = "solid"];
|
||||
|
||||
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
|
||||
Lexicon -> Cat [style = "solid"];
|
||||
|
||||
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
|
||||
Cat -> Common [style = "solid"];
|
||||
|
||||
Common [style = "solid", shape = "ellipse", URL = "Tense.gf"];
|
||||
|
||||
}
|
||||
BIN
lib/resource/doc/Lang.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
17
lib/resource/doc/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
all: index synopsis
|
||||
|
||||
index:
|
||||
txt2tags -thtml index.txt
|
||||
synopsis:
|
||||
runghc MkSynopsis.hs
|
||||
|
||||
categories-imagemap.html: categories.dot
|
||||
dot -Tcmapx $^ > $@
|
||||
|
||||
clt:
|
||||
txt2tags clt2006.txt
|
||||
htmls clt2006.html
|
||||
gslt:
|
||||
txt2tags gslt-sem-2006.txt
|
||||
htmls gslt-sem-2006.html
|
||||
|
||||
238
lib/resource/doc/MkSynopsis.hs
Normal file
@@ -0,0 +1,238 @@
|
||||
import System
|
||||
import Char
|
||||
import List
|
||||
|
||||
type Cats = [(String,String,String)]
|
||||
type Rules = [(String,String,String)]
|
||||
|
||||
main = do
|
||||
xx <- getArgs
|
||||
let isLatex = case xx of
|
||||
"-tex":_ -> True
|
||||
_ -> False
|
||||
cs1 <- getCats commonAPI
|
||||
cs2 <- getCats catAPI
|
||||
let cs = sortCats (cs1 ++ cs2)
|
||||
writeFile synopsis "GF Resource Grammar Library: Synopsis"
|
||||
append "Aarne Ranta"
|
||||
space
|
||||
append "%!postproc(html): '(SRC=\"categories.png\")' '\\1 USEMAP=\"#categories\"'"
|
||||
append "%!postproc(html): '#LParadigms' '<a name=\"RParadigms\"></a>'"
|
||||
append "%!postproc(tex): '#LParadigms' ''"
|
||||
delimit $ addToolTips cs
|
||||
include "synopsis-intro.txt"
|
||||
title "Categories"
|
||||
space
|
||||
link "Source 1:" commonAPI
|
||||
space
|
||||
link "Source 2:" catAPI
|
||||
space
|
||||
append "==A hierarchic view==\n"
|
||||
include "categories-intro.txt"
|
||||
append "==Explanations==\n"
|
||||
delimit $ mkCatTable isLatex cs
|
||||
space
|
||||
title "Syntax Rules and Structural Words"
|
||||
space
|
||||
link "Source 1:" syntaxAPI
|
||||
space
|
||||
link "Source 2:" structuralAPI
|
||||
space
|
||||
rs <- getRules syntaxAPI
|
||||
rs2 <- getRules structuralAPI
|
||||
delimit $ mkSplitTables True isLatex cs $ rs ++ rs2
|
||||
space
|
||||
-- title "Structural Words"
|
||||
-- space
|
||||
-- link "Source:" structuralAPI
|
||||
-- space
|
||||
-- rs <- rulesTable False isLatex cs structuralAPI
|
||||
-- delimit rs
|
||||
space
|
||||
title "Lexical Paradigms"
|
||||
mapM_ (putParadigms isLatex cs) paradigmFiles
|
||||
space
|
||||
include "synopsis-browse.txt"
|
||||
space
|
||||
title "An Example of Usage"
|
||||
space
|
||||
include "synopsis-example.txt"
|
||||
space
|
||||
let format = if isLatex then "tex" else "html"
|
||||
system $ "txt2tags -t" ++ format ++ " --toc " ++ synopsis
|
||||
if isLatex then (system $ "pdflatex synopsis.tex") >> return () else return ()
|
||||
|
||||
addToolTips :: Cats -> [String]
|
||||
addToolTips = map f
|
||||
where f (n,e,_) = "%!postproc(html): '(?i)(HREF=\"#" ++ n ++ "\")( TITLE=\"[^\"]*\")?' '\\1 TITLE=\"" ++ e' ++ "\"'"
|
||||
where e' = n ++ if null e then "" else " - " ++ e
|
||||
|
||||
getCats :: FilePath -> IO Cats
|
||||
getCats file = do
|
||||
ss <- readFile file >>= return . lines
|
||||
return $ getrs [] ss
|
||||
where
|
||||
getrs rs ss = case ss of
|
||||
('-':'-':'.':_):_ -> reverse rs
|
||||
[] -> reverse rs
|
||||
('-':'-':_):ss2 -> getrs rs ss2
|
||||
s:ss2 -> case words s of
|
||||
cat:";":"--":exp -> getrs ((cat,unwords expl, unwords (tail ex)):rs) ss2 where
|
||||
(expl,ex) = span (/="e.g.") exp
|
||||
_ -> getrs rs ss2
|
||||
|
||||
rulesTable :: Bool -> Bool -> Cats -> FilePath -> IO [String]
|
||||
rulesTable hasEx isLatex cs file = do
|
||||
rs <- getRules file
|
||||
return $ mkTable hasEx isLatex cs rs
|
||||
|
||||
|
||||
getRules :: FilePath -> IO Rules
|
||||
getRules file = do
|
||||
ss <- readFile file >>= return . lines
|
||||
return $ getrs [] ss
|
||||
where
|
||||
getrs rs ss = case ss of
|
||||
('-':'-':'.':_):_ -> reverse rs
|
||||
[] -> reverse rs
|
||||
('-':'-':_):ss2 -> getrs rs ss2
|
||||
s:ss2 -> case words s of
|
||||
_:_:"overload":_ -> getrs rs ss2
|
||||
_:":":_ -> getrs (rule s:rs) ss2
|
||||
_ -> getrs rs ss2
|
||||
rule s = (name, typ, ex)
|
||||
where
|
||||
ws = words s
|
||||
name = head ws
|
||||
(t,e) = span (/="--") (tail ws)
|
||||
typ = unwords $ filtype (drop 1 t)
|
||||
filtype = filter (/=";")
|
||||
ex = if null e then "" else unwords $ unnumber $ drop 1 e
|
||||
unnumber e = case e of
|
||||
n:ws | last n == '.' && not (null (init n)) && all isDigit (init n) -> ws
|
||||
_ -> e
|
||||
|
||||
putParadigms :: Bool -> Cats -> (String, FilePath) -> IO ()
|
||||
putParadigms isLatex cs (lang,file) = do
|
||||
stitle ("Paradigms for " ++ lang)
|
||||
append "#LParadigms"
|
||||
space
|
||||
link "source" file
|
||||
space
|
||||
rs <- rulesTable False isLatex cs file
|
||||
space
|
||||
delimit rs
|
||||
space
|
||||
|
||||
inChunks :: Int -> ([a] -> [String]) -> [a] -> [String]
|
||||
inChunks i f = concat . intersperse ["\n\n"] . map f . chunks i where
|
||||
chunks _ [] = []
|
||||
chunks i xs = x : chunks i y where (x,y) = splitAt i xs
|
||||
|
||||
-- Makes one table per result category.
|
||||
-- Adds a subsection header for each table.
|
||||
mkSplitTables :: Bool -> Bool -> Cats -> Rules -> [String]
|
||||
mkSplitTables hasEx isLatex cs = concatMap t . addLexicalCats cs . sortRules
|
||||
where t (c, xs) = [subtitle c expl] ++ tableOrLink
|
||||
where
|
||||
expl = case [e | (n,e,_) <- cs, n == c] of
|
||||
[] -> ""
|
||||
e:_ -> e
|
||||
tableOrLink = if null xs then parad else mkTable hasEx isLatex cs xs
|
||||
parad = [
|
||||
"Lexical category, constructors given in",
|
||||
"[lexical paradigms #RParadigms]."
|
||||
]
|
||||
|
||||
mkTable :: Bool -> Bool -> Cats -> Rules -> [String]
|
||||
mkTable hasEx isLatex cs = inChunks chsize (\rs -> header : map (unwords . row) rs)
|
||||
where
|
||||
chsize = if isLatex then 40 else 1000
|
||||
header = if hasEx then "|| Function | Type | Example ||"
|
||||
else "|| Function | Type ||"
|
||||
row (name,typ,ex)
|
||||
= if hasEx then ["|", name', "|", typ', "|", ex', "|"]
|
||||
else ["|", name', "|", typ', "|"]
|
||||
where
|
||||
name' = ttf name
|
||||
typ' = showTyp cs typ
|
||||
ex' = if null ex then "-" else itf ex
|
||||
|
||||
mkCatTable :: Bool -> Cats -> [String]
|
||||
mkCatTable isLatex cs = inChunks chsize (\rs -> header ++ map mk1 rs) cs
|
||||
where
|
||||
header = ["|| Category | Explanation | Example ||"]
|
||||
chsize = if isLatex then 40 else 1000
|
||||
mk1 (name,expl,ex) = unwords ["|", showCat cs name, "|", expl, "|", typo ex, "|"]
|
||||
typo ex = if take 1 ex == "\"" then itf (init (tail ex)) else ex
|
||||
|
||||
synopsis = "synopsis.txt"
|
||||
commonAPI = "../abstract/Common.gf"
|
||||
catAPI = "../abstract/Cat.gf"
|
||||
syntaxAPI = "../api/Constructors.gf"
|
||||
structuralAPI = "../abstract/Structural.gf"
|
||||
paradigmFiles = [
|
||||
("Danish", "../danish/ParadigmsDan.gf"),
|
||||
("English", "../english/ParadigmsEng.gf"),
|
||||
("Finnish", "../finnish/ParadigmsFin.gf"),
|
||||
("French", "../french/ParadigmsFre.gf"),
|
||||
("German", "../german/ParadigmsGer.gf"),
|
||||
("Italian", "../italian/ParadigmsIta.gf"),
|
||||
("Norwegian", "../norwegian/ParadigmsNor.gf"),
|
||||
("Russian", "../russian/ParadigmsRus.gf"),
|
||||
("Spanish", "../spanish/ParadigmsSpa.gf"),
|
||||
("Swedish", "../swedish/ParadigmsSwe.gf")
|
||||
]
|
||||
|
||||
append s = appendFile synopsis ('\n':s)
|
||||
title s = append $ "=" ++ s ++ "="
|
||||
stitle s = append $ "==" ++ s ++ "=="
|
||||
include s = append $ "%!include: " ++ s
|
||||
space = append "\n"
|
||||
delimit ss = mapM_ append ss
|
||||
link s f = append $ s ++ " [``" ++ fa ++ "`` " ++ f ++ "]" where
|
||||
fa = "http://www.cs.chalmers.se/~aarne/GF/lib/resource" ++ dropWhile (=='.') f
|
||||
|
||||
ttf s = "``" ++ s ++ "``"
|
||||
itf s = "//" ++ s ++ "//"
|
||||
|
||||
-----------------
|
||||
|
||||
-- sort category synopsis by category, retain one table
|
||||
sortCats :: Cats -> Cats
|
||||
sortCats = sortBy compareCat
|
||||
where compareCat (n1,_,_) (n2,_,_) = compare n1 n2
|
||||
|
||||
-- sort function synopsis by category, into separate tables
|
||||
sortRules :: Rules -> [Rules]
|
||||
sortRules = groupBy sameCat . sortBy compareRules
|
||||
where sameCat r1 r2 = resultCat r1 == resultCat r2
|
||||
compareRules r1@(n1,_,_) r2@(n2,_,_)
|
||||
= compare (resultCat r1,n1) (resultCat r2,n2)
|
||||
|
||||
addLexicalCats :: Cats -> [Rules] -> [(String,Rules)]
|
||||
addLexicalCats cs rss =
|
||||
map head $ groupBy fstEq $ sortBy (\x y -> compare (fst x) (fst y)) $
|
||||
[ (resultCat r, rs) | rs@(r:_) <- rss] ++ [(n,[]) | (n,_,_) <- cs]
|
||||
where fstEq p1 p2 = fst p1 == fst p2
|
||||
|
||||
resultCat :: (String,String,String) -> String
|
||||
resultCat (_,t,_) = last (words t)
|
||||
|
||||
|
||||
subtitle cat expl = "==" ++ cat ++ e ++ "==" ++ "[" ++ cat ++ "]"
|
||||
where e = if null expl then "" else " - " ++ expl
|
||||
|
||||
showCat :: Cats -> String -> String
|
||||
showCat cs cat = "[" ++ cat ++ " #" ++ cat ++ "]"
|
||||
|
||||
showTyp :: Cats -> String -> String
|
||||
showTyp cs = unwords . map f . words
|
||||
where f s | head s == '(' && last s == ')' && isCat c
|
||||
= "(" ++ showCat cs c ++ ")"
|
||||
| isCat s = showCat cs s
|
||||
| otherwise = ttf s
|
||||
where c = init (tail s)
|
||||
isCat cat = cat `notElem` ["Str","Int"]
|
||||
&& all (\c -> isAlphaNum c || c == '\'') cat
|
||||
&& isUpper (head cat)
|
||||
877
lib/resource/doc/Resource-HOWTO.html
Normal file
@@ -0,0 +1,877 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE>Resource grammar writing HOWTO</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1>Resource grammar writing HOWTO</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Fri Jun 23 00:13:11 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">The resource grammar API</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc2">Phrase category modules</A>
|
||||
<LI><A HREF="#toc3">Infrastructure modules</A>
|
||||
<LI><A HREF="#toc4">Lexical modules</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc5">Language-dependent syntax modules</A>
|
||||
<LI><A HREF="#toc6">The core of the syntax</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc7">Another reduced API</A>
|
||||
<LI><A HREF="#toc8">The present-tense fragment</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc9">Phases of the work</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc10">Putting up a directory</A>
|
||||
<LI><A HREF="#toc11">Direction of work</A>
|
||||
<LI><A HREF="#toc12">The develop-test cycle</A>
|
||||
<LI><A HREF="#toc13">Resource modules used</A>
|
||||
<LI><A HREF="#toc14">Morphology and lexicon</A>
|
||||
<LI><A HREF="#toc15">Lock fields</A>
|
||||
<LI><A HREF="#toc16">Lexicon construction</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc17">Inside grammar modules</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc18">The category system</A>
|
||||
<LI><A HREF="#toc19">Phrase category modules</A>
|
||||
<LI><A HREF="#toc20">Resource modules</A>
|
||||
<LI><A HREF="#toc21">Lexicon</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc22">Lexicon extension</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc23">The irregularity lexicon</A>
|
||||
<LI><A HREF="#toc24">Lexicon extraction from a word list</A>
|
||||
<LI><A HREF="#toc25">Lexicon extraction from raw text data</A>
|
||||
<LI><A HREF="#toc26">Extending the resource grammar API</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc27">Writing an instance of parametrized resource grammar implementation</A>
|
||||
<LI><A HREF="#toc28">Parametrizing a resource grammar implementation</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
The purpose of this document is to tell how to implement the GF
|
||||
resource grammar API for a new language. We will <I>not</I> cover how
|
||||
to use the resource grammar, nor how to change the API. But we
|
||||
will give some hints how to extend the API.
|
||||
</P>
|
||||
<P>
|
||||
A manual for using the resource grammar is found in
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/GF/doc/resource.pdf"><CODE>http://www.cs.chalmers.se/~aarne/GF/doc/resource.pdf</CODE></A>.
|
||||
</P>
|
||||
<P>
|
||||
A tutorial on GF, also introducing the idea of resource grammars, is found in
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="../../../doc/tutorial/gf-tutorial2.html"><CODE>http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html</CODE></A>.
|
||||
</P>
|
||||
<P>
|
||||
This document concerns the API v. 1.0. You can find the current code in
|
||||
</P>
|
||||
<P>
|
||||
<A HREF=".."><CODE>http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/</CODE></A>
|
||||
</P>
|
||||
<P>
|
||||
See the <A HREF="../README"><CODE>README</CODE></A> for
|
||||
details on how this differs from previous versions.
|
||||
</P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>The resource grammar API</H2>
|
||||
<P>
|
||||
The API is divided into a bunch of <CODE>abstract</CODE> modules.
|
||||
The following figure gives the dependencies of these modules.
|
||||
</P>
|
||||
<P>
|
||||
<IMG ALIGN="left" SRC="Grammar.png" BORDER="0" ALT="">
|
||||
</P>
|
||||
<P>
|
||||
Thus the API consists of a grammar and a lexicon, which is
|
||||
provided for test purposes.
|
||||
</P>
|
||||
<P>
|
||||
The module structure is rather flat: most modules are direct
|
||||
parents of <CODE>Grammar</CODE>. The idea
|
||||
is that you can concentrate on one linguistic aspect at a time, or
|
||||
also distribute the work among several authors. The module <CODE>Cat</CODE>
|
||||
defines the "glue" that ties the aspects together - a type system
|
||||
to which all the other modules conform, so that e.g. <CODE>NP</CODE> means
|
||||
the same thing in those modules that use <CODE>NP</CODE>s and those that
|
||||
constructs them.
|
||||
</P>
|
||||
<A NAME="toc2"></A>
|
||||
<H3>Phrase category modules</H3>
|
||||
<P>
|
||||
The direct parents of the top will be called <B>phrase category modules</B>,
|
||||
since each of them concentrates on a particular phrase category (nouns, verbs,
|
||||
adjectives, sentences,...). A phrase category module tells
|
||||
<I>how to construct phrases in that category</I>. You will find out that
|
||||
all functions in any of these modules have the same value type (or maybe
|
||||
one of a small number of different types). Thus we have
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Noun</CODE>: construction of nouns and noun phrases
|
||||
<LI><CODE>Adjective</CODE>: construction of adjectival phrases
|
||||
<LI><CODE>Verb</CODE>: construction of verb phrases
|
||||
<LI><CODE>Adverb</CODE>: construction of adverbial phrases
|
||||
<LI><CODE>Numeral</CODE>: construction of cardinal and ordinal numerals
|
||||
<LI><CODE>Sentence</CODE>: construction of sentences and imperatives
|
||||
<LI><CODE>Question</CODE>: construction of questions
|
||||
<LI><CODE>Relative</CODE>: construction of relative clauses
|
||||
<LI><CODE>Conjunction</CODE>: coordination of phrases
|
||||
<LI><CODE>Phrase</CODE>: construction of the major units of text and speech
|
||||
<LI><CODE>Text</CODE>: construction of texts as sequences of phrases
|
||||
<LI><CODE>Idiom</CODE>: idiomatic phrases such as existentials
|
||||
</UL>
|
||||
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Infrastructure modules</H3>
|
||||
<P>
|
||||
Expressions of each phrase category are constructed in the corresponding
|
||||
phrase category module. But their <I>use</I> takes mostly place in other modules.
|
||||
For instance, noun phrases, which are constructed in <CODE>Noun</CODE>, are
|
||||
used as arguments of functions of almost all other phrase category modules.
|
||||
How can we build all these modules independently of each other?
|
||||
</P>
|
||||
<P>
|
||||
As usual in typeful programming, the <I>only</I> thing you need to know
|
||||
about an object you use is its type. When writing a linearization rule
|
||||
for a GF abstract syntax function, the only thing you need to know is
|
||||
the linearization types of its value and argument categories. To achieve
|
||||
the division of the resource grammar to several parallel phrase category modules,
|
||||
what we need is an underlying definition of the linearization types. This
|
||||
definition is given as the implementation of
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Cat</CODE>: syntactic categories of the resource grammar
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Any resource grammar implementation has first to agree on how to implement
|
||||
<CODE>Cat</CODE>. Luckily enough, even this can be done incrementally: you
|
||||
can skip the <CODE>lincat</CODE> definition of a category and use the default
|
||||
<CODE>{s : Str}</CODE> until you need to change it to something else. In
|
||||
English, for instance, many categories do have this linearization type.
|
||||
</P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Lexical modules</H3>
|
||||
<P>
|
||||
What is lexical and what is syntactic is not as clearcut in GF as in
|
||||
some other grammar formalisms. Logically, lexical means atom, i.e. a
|
||||
<CODE>fun</CODE> with no arguments. Linguistically, one may add to this
|
||||
that the <CODE>lin</CODE> consists of only one token (or of a table whose values
|
||||
are single tokens). Even in the restricted lexicon included in the resource
|
||||
API, the latter rule is sometimes violated in some languages. For instance,
|
||||
<CODE>Structural.both7and_DConj</CODE> is an atom, but its linearization is
|
||||
two words e.g. <I>both - and</I>.
|
||||
</P>
|
||||
<P>
|
||||
Another characterization of lexical is that lexical units can be added
|
||||
almost <I>ad libitum</I>, and they cannot be defined in terms of already
|
||||
given rules. The lexical modules of the resource API are thus more like
|
||||
samples than complete lists. There are two such modules:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Structural</CODE>: structural words (determiners, conjunctions,...)
|
||||
<LI><CODE>Lexicon</CODE>: basic everyday content words (nouns, verbs,...)
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The module <CODE>Structural</CODE> aims for completeness, and is likely to
|
||||
be extended in future releases of the resource. The module <CODE>Lexicon</CODE>
|
||||
gives a "random" list of words, which enable interesting testing of syntax,
|
||||
and also a check list for morphology, since those words are likely to include
|
||||
most morphological patterns of the language.
|
||||
</P>
|
||||
<P>
|
||||
In the case of <CODE>Lexicon</CODE> it may come out clearer than anywhere else
|
||||
in the API that it is impossible to give exact translation equivalents in
|
||||
different languages on the level of a resource grammar. In other words,
|
||||
application grammars are likely to use the resource in different ways for
|
||||
different languages.
|
||||
</P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Language-dependent syntax modules</H2>
|
||||
<P>
|
||||
In addition to the common API, there is room for language-dependent extensions
|
||||
of the resource. The top level of each languages looks as follows (with English as example):
|
||||
</P>
|
||||
<PRE>
|
||||
abstract English = Grammar, ExtraEngAbs, DictEngAbs
|
||||
</PRE>
|
||||
<P>
|
||||
where <CODE>ExtraEngAbs</CODE> is a collection of syntactic structures specific to English,
|
||||
and <CODE>DictEngAbs</CODE> is an English dictionary
|
||||
(at the moment, it consists of <CODE>IrregEngAbs</CODE>,
|
||||
the irregular verbs of English). Each of these language-specific grammars has
|
||||
the potential to grow into a full-scale grammar of the language. These grammar
|
||||
can also be used as libraries, but the possibility of using functors is lost.
|
||||
</P>
|
||||
<P>
|
||||
To give a better overview of language-specific structures,
|
||||
modules like <CODE>ExtraEngAbs</CODE>
|
||||
are built from a language-independent module <CODE>ExtraAbs</CODE>
|
||||
by restricted inheritance:
|
||||
</P>
|
||||
<PRE>
|
||||
abstract ExtraEngAbs = Extra [f,g,...]
|
||||
</PRE>
|
||||
<P>
|
||||
Thus any category and function in <CODE>Extra</CODE> may be shared by a subset of all
|
||||
languages. One can see this set-up as a matrix, which tells
|
||||
what <CODE>Extra</CODE> structures
|
||||
are implemented in what languages. For the common API in <CODE>Grammar</CODE>, the matrix
|
||||
is filled with 1's (everything is implemented in every language).
|
||||
</P>
|
||||
<P>
|
||||
In a minimal resource grammar implementation, the language-dependent
|
||||
extensions are just empty modules, but it is good to provide them for
|
||||
the sake of uniformity.
|
||||
</P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>The core of the syntax</H2>
|
||||
<P>
|
||||
Among all categories and functions, a handful are
|
||||
most important and distinct ones, of which the others are can be
|
||||
seen as variations. The categories are
|
||||
</P>
|
||||
<PRE>
|
||||
Cl ; VP ; V2 ; NP ; CN ; Det ; AP ;
|
||||
</PRE>
|
||||
<P>
|
||||
The functions are
|
||||
</P>
|
||||
<PRE>
|
||||
PredVP : NP -> VP -> Cl ; -- predication
|
||||
ComplV2 : V2 -> NP -> VP ; -- complementization
|
||||
DetCN : Det -> CN -> NP ; -- determination
|
||||
ModCN : AP -> CN -> CN ; -- modification
|
||||
</PRE>
|
||||
<P>
|
||||
This <A HREF="latin.gf">toy Latin grammar</A> shows in a nutshell how these
|
||||
rules relate the categories to each other. It is intended to be a
|
||||
first approximation when designing the parameter system of a new
|
||||
language.
|
||||
</P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Another reduced API</H3>
|
||||
<P>
|
||||
If you want to experiment with a small subset of the resource API first,
|
||||
try out the module
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/resource/Syntax.gf">Syntax</A>
|
||||
explained in the
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html">GF Tutorial</A>.
|
||||
</P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>The present-tense fragment</H3>
|
||||
<P>
|
||||
Some lines in the resource library are suffixed with the comment
|
||||
```--# notpresent
|
||||
which is used by a preprocessor to exclude those lines from
|
||||
a reduced version of the full resource. This present-tense-only
|
||||
version is useful for applications in most technical text, since
|
||||
they reduce the grammar size and compilation time. It can also
|
||||
be useful to exclude those lines in a first version of resource
|
||||
implementation. To compile a grammar with present-tense-only, use
|
||||
</P>
|
||||
<PRE>
|
||||
i -preproc=GF/lib/resource-1.0/mkPresent LangGer.gf
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Phases of the work</H2>
|
||||
<A NAME="toc10"></A>
|
||||
<H3>Putting up a directory</H3>
|
||||
<P>
|
||||
Unless you are writing an instance of a parametrized implementation
|
||||
(Romance or Scandinavian), which will be covered later, the
|
||||
simplest way is to follow roughly the following procedure. Assume you
|
||||
are building a grammar for the German language. Here are the first steps,
|
||||
which we actually followed ourselves when building the German implementation
|
||||
of resource v. 1.0.
|
||||
</P>
|
||||
<OL>
|
||||
<LI>Create a sister directory for <CODE>GF/lib/resource/english</CODE>, named
|
||||
<CODE>german</CODE>.
|
||||
<PRE>
|
||||
cd GF/lib/resource/
|
||||
mkdir german
|
||||
cd german
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Check out the [ISO 639 3-letter language code
|
||||
<A HREF="http://www.w3.org/WAI/ER/IG/ert/iso639.htm">http://www.w3.org/WAI/ER/IG/ert/iso639.htm</A>]
|
||||
for German: both <CODE>Ger</CODE> and <CODE>Deu</CODE> are given, and we pick <CODE>Ger</CODE>.
|
||||
<P></P>
|
||||
<LI>Copy the <CODE>*Eng.gf</CODE> files from <CODE>english</CODE> <CODE>german</CODE>,
|
||||
and rename them:
|
||||
<PRE>
|
||||
cp ../english/*Eng.gf .
|
||||
rename 's/Eng/Ger/' *Eng.gf
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Change the <CODE>Eng</CODE> module references to <CODE>Ger</CODE> references
|
||||
in all files:
|
||||
<PRE>
|
||||
sed -i 's/English/German/g' *Ger.gf
|
||||
sed -i 's/Eng/Ger/g' *Ger.gf
|
||||
</PRE>
|
||||
The first line prevents changing the word <CODE>English</CODE>, which appears
|
||||
here and there in comments, to <CODE>Gerlish</CODE>.
|
||||
<P></P>
|
||||
<LI>This may of course change unwanted occurrences of the
|
||||
string <CODE>Eng</CODE> - verify this by
|
||||
<PRE>
|
||||
grep Ger *.gf
|
||||
</PRE>
|
||||
But you will have to make lots of manual changes in all files anyway!
|
||||
<P></P>
|
||||
<LI>Comment out the contents of these files:
|
||||
<PRE>
|
||||
sed -i 's/^/--/' *Ger.gf
|
||||
</PRE>
|
||||
This will give you a set of templates out of which the grammar
|
||||
will grow as you uncomment and modify the files rule by rule.
|
||||
<P></P>
|
||||
<LI>In all <CODE>.gf</CODE> files, uncomment the module headers and brackets,
|
||||
leaving the module bodies commented. Unfortunately, there is no
|
||||
simple way to do this automatically (or to avoid commenting these
|
||||
lines in the previous step) - but uncommenting the first
|
||||
and the last lines will actually do the job for many of the files.
|
||||
<P></P>
|
||||
<LI>Uncomment the contents of the main grammar file:
|
||||
<PRE>
|
||||
sed -i 's/^--//' LangGer.gf
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Now you can open the grammar <CODE>LangGer</CODE> in GF:
|
||||
<PRE>
|
||||
gf LangGer.gf
|
||||
</PRE>
|
||||
You will get lots of warnings on missing rules, but the grammar will compile.
|
||||
<P></P>
|
||||
<LI>At all following steps you will now have a valid, but incomplete
|
||||
GF grammar. The GF command
|
||||
<PRE>
|
||||
pg -printer=missing
|
||||
</PRE>
|
||||
tells you what exactly is missing.
|
||||
</OL>
|
||||
|
||||
<P>
|
||||
Here is the module structure of <CODE>LangGer</CODE>. It has been simplified by leaving out
|
||||
the majority of the phrase category modules. Each of them has the same dependencies
|
||||
as e.g. <CODE>VerbGer</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
<IMG ALIGN="middle" SRC="German.png" BORDER="0" ALT="">
|
||||
</P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Direction of work</H3>
|
||||
<P>
|
||||
The real work starts now. There are many ways to proceed, the main ones being
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Top-down: start from the module <CODE>Phrase</CODE> and go down to <CODE>Sentence</CODE>, then
|
||||
<CODE>Verb</CODE>, <CODE>Noun</CODE>, and in the end <CODE>Lexicon</CODE>. In this way, you are all the time
|
||||
building complete phrases, and add them with more content as you proceed.
|
||||
<B>This approach is not recommended</B>. It is impossible to test the rules if
|
||||
you have no words to apply the constructions to.
|
||||
<P></P>
|
||||
<LI>Bottom-up: set as your first goal to implement <CODE>Lexicon</CODE>. To this end, you
|
||||
need to write <CODE>ParadigmsGer</CODE>, which in turn needs parts of
|
||||
<CODE>MorphoGer</CODE> and <CODE>ResGer</CODE>.
|
||||
<B>This approach is not recommended</B>. You can get stuck to details of
|
||||
morphology such as irregular words, and you don't have enough grasp about
|
||||
the type system to decide what forms to cover in morphology.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The practical working direction is thus a saw-like motion between the morphological
|
||||
and top-level modules. Here is a possible course of the work that gives enough
|
||||
test data and enough general view at any point:
|
||||
</P>
|
||||
<OL>
|
||||
<LI>Define <CODE>Cat.N</CODE> and the required parameter types in <CODE>ResGer</CODE>. As we define
|
||||
<PRE>
|
||||
lincat N = {s : Number => Case => Str ; g : Gender} ;
|
||||
</PRE>
|
||||
we need the parameter types <CODE>Number</CODE>, <CODE>Case</CODE>, and <CODE>Gender</CODE>. The definition
|
||||
of <CODE>Number</CODE> in <A HREF="../common/ParamX.gf"><CODE>common/ParamX</CODE></A> works for German, so we
|
||||
use it and just define <CODE>Case</CODE> and <CODE>Gender</CODE> in <CODE>ResGer</CODE>.
|
||||
<P></P>
|
||||
<LI>Define <CODE>regN</CODE> in <CODE>ParadigmsGer</CODE>. In this way you can
|
||||
already implement a huge amount of nouns correctly in <CODE>LexiconGer</CODE>. Actually
|
||||
just adding <CODE>mkN</CODE> should suffice for every noun - but,
|
||||
since it is tedious to use, you
|
||||
might proceed to the next step before returning to morphology and defining the
|
||||
real work horse <CODE>reg2N</CODE>.
|
||||
<P></P>
|
||||
<LI>While doing this, you may want to test the resource independently. Do this by
|
||||
<PRE>
|
||||
i -retain ParadigmsGer
|
||||
cc regN "Kirche"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Proceed to determiners and pronouns in
|
||||
<CODE>NounGer</CODE> (<CODE>DetCN UsePron DetSg SgQuant NoNum NoOrd DefArt IndefArt UseN</CODE>)and
|
||||
<CODE>StructuralGer</CODE> (<CODE>i_Pron every_Det</CODE>). You also need some categories and
|
||||
parameter types. At this point, it is maybe not possible to find out the final
|
||||
linearization types of <CODE>CN</CODE>, <CODE>NP</CODE>, and <CODE>Det</CODE>, but at least you should
|
||||
be able to correctly inflect noun phrases such as <I>every airplane</I>:
|
||||
<PRE>
|
||||
i LangGer.gf
|
||||
l -table DetCN every_Det (UseN airplane_N)
|
||||
|
||||
Nom: jeder Flugzeug
|
||||
Acc: jeden Flugzeug
|
||||
Dat: jedem Flugzeug
|
||||
Gen: jedes Flugzeugs
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Proceed to verbs: define <CODE>CatGer.V</CODE>, <CODE>ResGer.VForm</CODE>, and
|
||||
<CODE>ParadigmsGer.regV</CODE>. You may choose to exclude <CODE>notpresent</CODE>
|
||||
cases at this point. But anyway, you will be able to inflect a good
|
||||
number of verbs in <CODE>Lexicon</CODE>, such as
|
||||
<CODE>live_V</CODE> (<CODE>regV "leven"</CODE>).
|
||||
<P></P>
|
||||
<LI>Now you can soon form your first sentences: define <CODE>VP</CODE> and
|
||||
<CODE>Cl</CODE> in <CODE>CatGer</CODE>, <CODE>VerbGer.UseV</CODE>, and <CODE>SentenceGer.PredVP</CODE>.
|
||||
Even if you have excluded the tenses, you will be able to produce
|
||||
<PRE>
|
||||
i -preproc=mkPresent LangGer.gf
|
||||
> l -table PredVP (UsePron i_Pron) (UseV live_V)
|
||||
|
||||
Pres Simul Pos Main: ich lebe
|
||||
Pres Simul Pos Inv: lebe ich
|
||||
Pres Simul Pos Sub: ich lebe
|
||||
Pres Simul Neg Main: ich lebe nicht
|
||||
Pres Simul Neg Inv: lebe ich nicht
|
||||
Pres Simul Neg Sub: ich nicht lebe
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Transitive verbs (<CODE>CatGer.V2 ParadigmsGer.dirV2 VerbGer.ComplV2</CODE>)
|
||||
are a natural next step, so that you can
|
||||
produce <CODE>ich liebe dich</CODE>.
|
||||
<P></P>
|
||||
<LI>Adjectives (<CODE>CatGer.A ParadigmsGer.regA NounGer.AdjCN AdjectiveGer.PositA</CODE>)
|
||||
will force you to think about strong and weak declensions, so that you can
|
||||
correctly inflect <I>my new car, this new car</I>.
|
||||
<P></P>
|
||||
<LI>Once you have implemented the set
|
||||
(``Noun.DetCN Noun.AdjCN Verb.UseV Verb.ComplV2 Sentence.PredVP),
|
||||
you have overcome most of difficulties. You know roughly what parameters
|
||||
and dependences there are in your language, and you can now produce very
|
||||
much in the order you please.
|
||||
</OL>
|
||||
|
||||
<A NAME="toc12"></A>
|
||||
<H3>The develop-test cycle</H3>
|
||||
<P>
|
||||
The following develop-test cycle will
|
||||
be applied most of the time, both in the first steps described above
|
||||
and in later steps where you are more on your own.
|
||||
</P>
|
||||
<OL>
|
||||
<LI>Select a phrase category module, e.g. <CODE>NounGer</CODE>, and uncomment some
|
||||
linearization rules (for instance, <CODE>DefSg</CODE>, which is
|
||||
not too complicated).
|
||||
<P></P>
|
||||
<LI>Write down some German examples of this rule, for instance translations
|
||||
of "the dog", "the house", "the big house", etc. Write these in all their
|
||||
different forms (two numbers and four cases).
|
||||
<P></P>
|
||||
<LI>Think about the categories involved (<CODE>CN, NP, N</CODE>) and the
|
||||
variations they have. Encode this in the lincats of <CODE>CatGer</CODE>.
|
||||
You may have to define some new parameter types in <CODE>ResGer</CODE>.
|
||||
<P></P>
|
||||
<LI>To be able to test the construction,
|
||||
define some words you need to instantiate it
|
||||
in <CODE>LexiconGer</CODE>. You will also need some regular inflection patterns
|
||||
in<CODE>ParadigmsGer</CODE>.
|
||||
<P></P>
|
||||
<LI>Test by parsing, linearization,
|
||||
and random generation. In particular, linearization to a table should
|
||||
be used so that you see all forms produced:
|
||||
<PRE>
|
||||
gr -cat=NP -number=20 -tr | l -table
|
||||
</PRE>
|
||||
<P></P>
|
||||
<LI>Spare some tree-linearization pairs for later regression testing. Use the
|
||||
<CODE>tree_bank</CODE> command,
|
||||
<PRE>
|
||||
gr -cat=NP -number=20 | tb -xml | wf NP.tb
|
||||
</PRE>
|
||||
You can later compared your modified grammar to this treebank by
|
||||
<PRE>
|
||||
rf NP.tb | tb -c
|
||||
</PRE>
|
||||
</OL>
|
||||
|
||||
<P>
|
||||
You are likely to run this cycle a few times for each linearization rule
|
||||
you implement, and some hundreds of times altogether. There are 66 <CODE>cat</CODE>s and
|
||||
458 <CODE>funs</CODE> in <CODE>Lang</CODE> at the moment; 149 of the <CODE>funs</CODE> are outside the two
|
||||
lexicon modules).
|
||||
</P>
|
||||
<P>
|
||||
Here is a <A HREF="../german/log.txt">live log</A> of the actual process of
|
||||
building the German implementation of resource API v. 1.0.
|
||||
It is the basis of the more detailed explanations, which will
|
||||
follow soon. (You will found out that these explanations involve
|
||||
a rational reconstruction of the live process! Among other things, the
|
||||
API was changed during the actual process to make it more intuitive.)
|
||||
</P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Resource modules used</H3>
|
||||
<P>
|
||||
These modules will be written by you.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>ResGer</CODE>: parameter types and auxiliary operations
|
||||
(a resource for the resource grammar!)
|
||||
<LI><CODE>ParadigmsGer</CODE>: complete inflection engine and most important regular paradigms
|
||||
<LI><CODE>MorphoGer</CODE>: auxiliaries for <CODE>ParadigmsGer</CODE> and <CODE>StructuralGer</CODE>. This need
|
||||
not be separate from <CODE>ResGer</CODE>.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
These modules are language-independent and provided by the existing resource
|
||||
package.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>ParamX</CODE>: parameter types used in many languages
|
||||
<LI><CODE>CommonX</CODE>: implementation of language-uniform categories
|
||||
such as $Text$ and $Phr$, as well as of
|
||||
the logical tense, anteriority, and polarity parameters
|
||||
<LI><CODE>Coordination</CODE>: operations to deal with lists and coordination
|
||||
<LI><CODE>Prelude</CODE>: general-purpose operations on strings, records,
|
||||
truth values, etc.
|
||||
<LI><CODE>Predefined</CODE>: general-purpose operations with hard-coded definitions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
An important decision is what rules to implement in terms of operations in
|
||||
<CODE>ResGer</CODE>. A golden rule of functional programming says that, whenever
|
||||
you find yourself programming by copy and paste, you should write a function
|
||||
instead. This indicates that an operation should be created if it is to be
|
||||
used at least twice. At the same time, a sound principle of vicinity says that
|
||||
it should not require too much browsing to understand what a rule does.
|
||||
From these two principles, we have derived the following practice:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>If an operation is needed <I>in two different modules</I>,
|
||||
it should be created in <CODE>ResGer</CODE>. An example is <CODE>mkClause</CODE>,
|
||||
used in <CODE>Sentence</CODE>, <CODE>Question</CODE>, and <CODE>Relative</CODE>-
|
||||
<LI>If an operation is needed <I>twice in the same module</I>, but never
|
||||
outside, it should be created in the same module. Many examples are
|
||||
found in <CODE>Numerals</CODE>.
|
||||
<LI>If an operation is only needed once, it should not be created (but rather
|
||||
inlined). Most functions in phrase category modules are implemented in this
|
||||
way.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
This discipline is very different from the one followed in earlier
|
||||
versions of the library (up to 0.9). We then valued the principle of
|
||||
abstraction more than vicinity, creating layers of abstraction for
|
||||
almost everything. This led in practice to the duplication of almost
|
||||
all code on the <CODE>lin</CODE> and <CODE>oper</CODE> levels, and made the code
|
||||
hard to understand and maintain.
|
||||
</P>
|
||||
<A NAME="toc14"></A>
|
||||
<H3>Morphology and lexicon</H3>
|
||||
<P>
|
||||
The paradigms needed to implement
|
||||
<CODE>LexiconGer</CODE> are defined in
|
||||
<CODE>ParadigmsGer</CODE>.
|
||||
This module provides high-level ways to define the linearization of
|
||||
lexical items, of categories <CODE>N, A, V</CODE> and their complement-taking
|
||||
variants.
|
||||
</P>
|
||||
<P>
|
||||
For ease of use, the <CODE>Paradigms</CODE> modules follow a certain
|
||||
naming convention. Thus they for each lexical category, such as <CODE>N</CODE>,
|
||||
the functions
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>mkN</CODE>, for worst-case construction of <CODE>N</CODE>. Its type signature
|
||||
has the form
|
||||
<PRE>
|
||||
mkN : Str -> ... -> Str -> P -> ... -> Q -> N
|
||||
</PRE>
|
||||
with as many string and parameter arguments as can ever be needed to
|
||||
construct an <CODE>N</CODE>.
|
||||
<LI><CODE>regN</CODE>, for the most common cases, with just one string argument:
|
||||
<PRE>
|
||||
regN : Str -> N
|
||||
</PRE>
|
||||
<LI>A language-dependent (small) set of functions to handle mild irregularities
|
||||
and common exceptions.
|
||||
<P></P>
|
||||
For the complement-taking variants, such as <CODE>V2</CODE>, we provide
|
||||
<P></P>
|
||||
<LI><CODE>mkV2</CODE>, which takes a <CODE>V</CODE> and all necessary arguments, such
|
||||
as case and preposition:
|
||||
<PRE>
|
||||
mkV2 : V -> Case -> Str -> V2 ;
|
||||
</PRE>
|
||||
<LI>A language-dependent (small) set of functions to handle common special cases,
|
||||
such as direct transitive verbs:
|
||||
<PRE>
|
||||
dirV2 : V -> V2 ;
|
||||
-- dirV2 v = mkV2 v accusative []
|
||||
</PRE>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The golden rule for the design of paradigms is that
|
||||
</P>
|
||||
<UL>
|
||||
<LI>The user will only need function applications with constants and strings,
|
||||
never any records or tables.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The discipline of data abstraction moreover requires that the user of the resource
|
||||
is not given access to parameter constructors, but only to constants that denote
|
||||
them. This gives the resource grammarian the freedom to change the underlying
|
||||
data representation if needed. It means that the <CODE>ParadigmsGer</CODE> module has
|
||||
to define constants for those parameter types and constructors that
|
||||
the application grammarian may need to use, e.g.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Case : Type ;
|
||||
nominative, accusative, genitive, dative : Case ;
|
||||
</PRE>
|
||||
<P>
|
||||
These constants are defined in terms of parameter types and constructors
|
||||
in <CODE>ResGer</CODE> and <CODE>MorphoGer</CODE>, which modules are not
|
||||
visible to the application grammarian.
|
||||
</P>
|
||||
<A NAME="toc15"></A>
|
||||
<H3>Lock fields</H3>
|
||||
<P>
|
||||
An important difference between <CODE>MorphoGer</CODE> and
|
||||
<CODE>ParadigmsGer</CODE> is that the former uses "raw" record types
|
||||
for word classes, whereas the latter used category symbols defined in
|
||||
<CODE>CatGer</CODE>. When these category symbols are used to denote
|
||||
record types in a resource modules, such as <CODE>ParadigmsGer</CODE>,
|
||||
a <B>lock field</B> is added to the record, so that categories
|
||||
with the same implementation are not confused with each other.
|
||||
(This is inspired by the <CODE>newtype</CODE> discipline in Haskell.)
|
||||
For instance, the lincats of adverbs and conjunctions are the same
|
||||
in <CODE>CommonX</CODE> (and therefore in <CODE>CatGer</CODE>, which inherits it):
|
||||
</P>
|
||||
<PRE>
|
||||
lincat Adv = {s : Str} ;
|
||||
lincat Conj = {s : Str} ;
|
||||
</PRE>
|
||||
<P>
|
||||
But when these category symbols are used to denote their linearization
|
||||
types in resource module, these definitions are translated to
|
||||
</P>
|
||||
<PRE>
|
||||
oper Adv : Type = {s : Str ; lock_Adv : {}} ;
|
||||
oper Conj : Type = {s : Str} ; lock_Conj : {}} ;
|
||||
</PRE>
|
||||
<P>
|
||||
In this way, the user of a resource grammar cannot confuse adverbs with
|
||||
conjunctions. In other words, the lock fields force the type checker
|
||||
to function as grammaticality checker.
|
||||
</P>
|
||||
<P>
|
||||
When the resource grammar is <CODE>open</CODE>ed in an application grammar, the
|
||||
lock fields are never seen (except possibly in type error messages),
|
||||
and the application grammarian should never write them herself. If she
|
||||
has to do this, it is a sign that the resource grammar is incomplete, and
|
||||
the proper way to proceed is to fix the resource grammar.
|
||||
</P>
|
||||
<P>
|
||||
The resource grammarian has to provide the dummy lock field values
|
||||
in her hidden definitions of constants in <CODE>Paradigms</CODE>. For instance,
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
-- mkAdv s = {s = s ; lock_Adv = <>} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc16"></A>
|
||||
<H3>Lexicon construction</H3>
|
||||
<P>
|
||||
The lexicon belonging to <CODE>LangGer</CODE> consists of two modules:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>StructuralGer</CODE>, structural words, built by directly using
|
||||
<CODE>MorphoGer</CODE>.
|
||||
<LI><CODE>BasicGer</CODE>, content words, built by using <CODE>ParadigmsGer</CODE>.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The reason why <CODE>MorphoGer</CODE> has to be used in <CODE>StructuralGer</CODE>
|
||||
is that <CODE>ParadigmsGer</CODE> does not contain constructors for closed
|
||||
word classes such as pronouns and determiners. The reason why we
|
||||
recommend <CODE>ParadigmsGer</CODE> for building <CODE>LexiconGer</CODE> is that
|
||||
the coverage of the paradigms gets thereby tested and that the
|
||||
use of the paradigms in <CODE>LexiconGer</CODE> gives a good set of examples for
|
||||
those who want to build new lexica.
|
||||
</P>
|
||||
<A NAME="toc17"></A>
|
||||
<H2>Inside grammar modules</H2>
|
||||
<P>
|
||||
Detailed implementation tricks
|
||||
are found in the comments of each module.
|
||||
</P>
|
||||
<A NAME="toc18"></A>
|
||||
<H3>The category system</H3>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Common.html">Common</A>, <A HREF="../common/CommonX.gf">CommonX</A>
|
||||
<LI><A HREF="gfdoc/Cat.html">Cat</A>, <A HREF="gfdoc/CatGer.gf">CatGer</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="toc19"></A>
|
||||
<H3>Phrase category modules</H3>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Noun.html">Noun</A>, <A HREF="../german/NounGer.gf">NounGer</A>
|
||||
<LI><A HREF="gfdoc/Adjective.html">Adjective</A>, <A HREF="../german/AdjectiveGer.gf">AdjectiveGer</A>
|
||||
<LI><A HREF="gfdoc/Verb.html">Verb</A>, <A HREF="../german/VerbGer.gf">VerbGer</A>
|
||||
<LI><A HREF="gfdoc/Adverb.html">Adverb</A>, <A HREF="../german/AdverbGer.gf">AdverbGer</A>
|
||||
<LI><A HREF="gfdoc/Numeral.html">Numeral</A>, <A HREF="../german/NumeralGer.gf">NumeralGer</A>
|
||||
<LI><A HREF="gfdoc/Sentence.html">Sentence</A>, <A HREF="../german/SentenceGer.gf">SentenceGer</A>
|
||||
<LI><A HREF="gfdoc/Question.html">Question</A>, <A HREF="../german/QuestionGer.gf">QuestionGer</A>
|
||||
<LI><A HREF="gfdoc/Relative.html">Relative</A>, <A HREF="../german/RelativeGer.gf">RelativeGer</A>
|
||||
<LI><A HREF="gfdoc/Conjunction.html">Conjunction</A>, <A HREF="../german/ConjunctionGer.gf">ConjunctionGer</A>
|
||||
<LI><A HREF="gfdoc/Phrase.html">Phrase</A>, <A HREF="../german/PhraseGer.gf">PhraseGer</A>
|
||||
<LI><A HREF="gfdoc/Text.html">Text</A>, <A HREF="../common/TextX.gf">TextX</A>
|
||||
<LI><A HREF="gfdoc/Idiom.html">Idiom</A>, <A HREF="../german/IdiomGer.gf">IdiomGer</A>
|
||||
<LI><A HREF="gfdoc/Lang.html">Lang</A>, <A HREF="../german/LangGer.gf">LangGer</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="toc20"></A>
|
||||
<H3>Resource modules</H3>
|
||||
<UL>
|
||||
<LI><A HREF="../german/ResGer.gf">ResGer</A>
|
||||
<LI><A HREF="../german/MorphoGer.gf">MorphoGer</A>
|
||||
<LI><A HREF="gfdoc/ParadigmsGer.html">ParadigmsGer</A>, <A HREF="../german/ParadigmsGer.gf">ParadigmsGer.gf</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="toc21"></A>
|
||||
<H3>Lexicon</H3>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Structural.html">Structural</A>, <A HREF="../german/StructuralGer.gf">StructuralGer</A>
|
||||
<LI><A HREF="gfdoc/Lexicon.html">Lexicon</A>, <A HREF="../german/LexiconGer.gf">LexiconGer</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="toc22"></A>
|
||||
<H2>Lexicon extension</H2>
|
||||
<A NAME="toc23"></A>
|
||||
<H3>The irregularity lexicon</H3>
|
||||
<P>
|
||||
It may be handy to provide a separate module of irregular
|
||||
verbs and other words which are difficult for a lexicographer
|
||||
to handle. There are usually a limited number of such words - a
|
||||
few hundred perhaps. Building such a lexicon separately also
|
||||
makes it less important to cover <I>everything</I> by the
|
||||
worst-case paradigms (<CODE>mkV</CODE> etc).
|
||||
</P>
|
||||
<A NAME="toc24"></A>
|
||||
<H3>Lexicon extraction from a word list</H3>
|
||||
<P>
|
||||
You can often find resources such as lists of
|
||||
irregular verbs on the internet. For instance, the
|
||||
<A HREF="http://www.iee.et.tu-dresden.de/~wernerr/grammar/verben_dt.html">Irregular German Verbs</A>
|
||||
page gives a list of verbs in the
|
||||
traditional tabular format, which begins as follows:
|
||||
</P>
|
||||
<PRE>
|
||||
backen (du bäckst, er bäckt) backte [buk] gebacken
|
||||
befehlen (du befiehlst, er befiehlt; befiehl!) befahl (beföhle; befähle) befohlen
|
||||
beginnen begann (begönne; begänne) begonnen
|
||||
beißen biß gebissen
|
||||
</PRE>
|
||||
<P>
|
||||
All you have to do is to write a suitable verb paradigm
|
||||
</P>
|
||||
<PRE>
|
||||
irregV : (x1,_,_,_,_,x6 : Str) -> V ;
|
||||
</PRE>
|
||||
<P>
|
||||
and a Perl or Python or Haskell script that transforms
|
||||
the table to
|
||||
</P>
|
||||
<PRE>
|
||||
backen_V = irregV "backen" "bäckt" "back" "backte" "backte" "gebacken" ;
|
||||
befehlen_V = irregV "befehlen" "befiehlt" "befiehl" "befahl" "beföhle" "befohlen" ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
When using ready-made word lists, you should think about
|
||||
coyright issues. Ideally, all resource grammar material should
|
||||
be provided under GNU General Public License.
|
||||
</P>
|
||||
<A NAME="toc25"></A>
|
||||
<H3>Lexicon extraction from raw text data</H3>
|
||||
<P>
|
||||
This is a cheap technique to build a lexicon of thousands
|
||||
of words, if text data is available in digital format.
|
||||
See the <A HREF="http://www.cs.chalmers.se/~markus/FM/">Functional Morphology</A>
|
||||
homepage for details.
|
||||
</P>
|
||||
<A NAME="toc26"></A>
|
||||
<H3>Extending the resource grammar API</H3>
|
||||
<P>
|
||||
Sooner or later it will happen that the resource grammar API
|
||||
does not suffice for all applications. A common reason is
|
||||
that it does not include idiomatic expressions in a given language.
|
||||
The solution then is in the first place to build language-specific
|
||||
extension modules. This chapter will deal with this issue (to be completed).
|
||||
</P>
|
||||
<A NAME="toc27"></A>
|
||||
<H2>Writing an instance of parametrized resource grammar implementation</H2>
|
||||
<P>
|
||||
Above we have looked at how a resource implementation is built by
|
||||
the copy and paste method (from English to German), that is, formally
|
||||
speaking, from scratch. A more elegant solution available for
|
||||
families of languages such as Romance and Scandinavian is to
|
||||
use parametrized modules. The advantages are
|
||||
</P>
|
||||
<UL>
|
||||
<LI>theoretical: linguistic generalizations and insights
|
||||
<LI>practical: maintainability improves with fewer components
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
In this chapter, we will look at an example: adding Italian to
|
||||
the Romance family (to be completed). Here is a set of
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/geocal2006.pdf">slides</A>
|
||||
on the topic.
|
||||
</P>
|
||||
<A NAME="toc28"></A>
|
||||
<H2>Parametrizing a resource grammar implementation</H2>
|
||||
<P>
|
||||
This is the most demanding form of resource grammar writing.
|
||||
We do <I>not</I> recommend the method of parametrizing from the
|
||||
beginning: it is easier to have one language first implemented
|
||||
in the conventional way and then add another language of the
|
||||
same family by aprametrization. This means that the copy and
|
||||
paste method is still used, but at this time the differences
|
||||
are put into an <CODE>interface</CODE> module.
|
||||
</P>
|
||||
<P>
|
||||
This chapter will work out an example of how an Estonian grammar
|
||||
is constructed from the Finnish grammar through parametrization.
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -\-toc -thtml Resource-HOWTO.txt -->
|
||||
</BODY></HTML>
|
||||
787
lib/resource/doc/Resource-HOWTO.txt
Normal file
@@ -0,0 +1,787 @@
|
||||
Resource grammar writing HOWTO
|
||||
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
|
||||
Last update: %%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags --toc -thtml Resource-HOWTO.txt
|
||||
|
||||
%!target:html
|
||||
|
||||
**History**
|
||||
|
||||
October 2007: updated for API 1.2.
|
||||
|
||||
January 2006: first version.
|
||||
|
||||
|
||||
The purpose of this document is to tell how to implement the GF
|
||||
resource grammar API for a new language. We will //not// cover how
|
||||
to use the resource grammar, nor how to change the API. But we
|
||||
will give some hints how to extend the API.
|
||||
|
||||
A manual for using the resource grammar is found in
|
||||
|
||||
[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/synopsis.html`` http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/synopsis.html].
|
||||
|
||||
A tutorial on GF, also introducing the idea of resource grammars, is found in
|
||||
|
||||
[``http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html`` ../../../doc/tutorial/gf-tutorial2.html].
|
||||
|
||||
This document concerns the API v. 1.0. You can find the current code in
|
||||
|
||||
[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/`` ..]
|
||||
|
||||
|
||||
|
||||
|
||||
==The resource grammar structure==
|
||||
|
||||
The library is divided into a bunch of modules, whose dependencies
|
||||
are given in the following figure.
|
||||
|
||||
[Syntax.png]
|
||||
|
||||
- solid contours: module used by end users
|
||||
- dashed contours: internal module
|
||||
- ellipse: abstract/concrete pair of modules
|
||||
- rectangle: resource or instance
|
||||
- diamond: interface
|
||||
|
||||
|
||||
The solid ellipses show the API as visible to the user of the library. The
|
||||
dashed ellipses form the main of the implementation, on which the resource
|
||||
grammar programmer has to work with. With the exception of the ``Paradigms``
|
||||
module, the visible API modules can be produced mechanically.
|
||||
|
||||
[Grammar.png]
|
||||
|
||||
Thus the API consists of a grammar and a lexicon, which is
|
||||
provided for test purposes.
|
||||
|
||||
The module structure is rather flat: most modules are direct
|
||||
parents of ``Grammar``. The idea
|
||||
is that you can concentrate on one linguistic aspect at a time, or
|
||||
also distribute the work among several authors. The module ``Cat``
|
||||
defines the "glue" that ties the aspects together - a type system
|
||||
to which all the other modules conform, so that e.g. ``NP`` means
|
||||
the same thing in those modules that use ``NP``s and those that
|
||||
constructs them.
|
||||
|
||||
|
||||
|
||||
===Phrase category modules===
|
||||
|
||||
The direct parents of the top will be called **phrase category modules**,
|
||||
since each of them concentrates on a particular phrase category (nouns, verbs,
|
||||
adjectives, sentences,...). A phrase category module tells
|
||||
//how to construct phrases in that category//. You will find out that
|
||||
all functions in any of these modules have the same value type (or maybe
|
||||
one of a small number of different types). Thus we have
|
||||
|
||||
|
||||
- ``Noun``: construction of nouns and noun phrases
|
||||
- ``Adjective``: construction of adjectival phrases
|
||||
- ``Verb``: construction of verb phrases
|
||||
- ``Adverb``: construction of adverbial phrases
|
||||
- ``Numeral``: construction of cardinal and ordinal numerals
|
||||
- ``Sentence``: construction of sentences and imperatives
|
||||
- ``Question``: construction of questions
|
||||
- ``Relative``: construction of relative clauses
|
||||
- ``Conjunction``: coordination of phrases
|
||||
- ``Phrase``: construction of the major units of text and speech
|
||||
- ``Text``: construction of texts as sequences of phrases
|
||||
- ``Idiom``: idiomatic phrases such as existentials
|
||||
|
||||
|
||||
|
||||
|
||||
===Infrastructure modules===
|
||||
|
||||
Expressions of each phrase category are constructed in the corresponding
|
||||
phrase category module. But their //use// takes mostly place in other modules.
|
||||
For instance, noun phrases, which are constructed in ``Noun``, are
|
||||
used as arguments of functions of almost all other phrase category modules.
|
||||
How can we build all these modules independently of each other?
|
||||
|
||||
As usual in typeful programming, the //only// thing you need to know
|
||||
about an object you use is its type. When writing a linearization rule
|
||||
for a GF abstract syntax function, the only thing you need to know is
|
||||
the linearization types of its value and argument categories. To achieve
|
||||
the division of the resource grammar to several parallel phrase category modules,
|
||||
what we need is an underlying definition of the linearization types. This
|
||||
definition is given as the implementation of
|
||||
|
||||
- ``Cat``: syntactic categories of the resource grammar
|
||||
|
||||
|
||||
Any resource grammar implementation has first to agree on how to implement
|
||||
``Cat``. Luckily enough, even this can be done incrementally: you
|
||||
can skip the ``lincat`` definition of a category and use the default
|
||||
``{s : Str}`` until you need to change it to something else. In
|
||||
English, for instance, many categories do have this linearization type.
|
||||
|
||||
|
||||
|
||||
===Lexical modules===
|
||||
|
||||
What is lexical and what is syntactic is not as clearcut in GF as in
|
||||
some other grammar formalisms. Logically, lexical means atom, i.e. a
|
||||
``fun`` with no arguments. Linguistically, one may add to this
|
||||
that the ``lin`` consists of only one token (or of a table whose values
|
||||
are single tokens). Even in the restricted lexicon included in the resource
|
||||
API, the latter rule is sometimes violated in some languages. For instance,
|
||||
``Structural.both7and_DConj`` is an atom, but its linearization is
|
||||
two words e.g. //both - and//.
|
||||
|
||||
Another characterization of lexical is that lexical units can be added
|
||||
almost //ad libitum//, and they cannot be defined in terms of already
|
||||
given rules. The lexical modules of the resource API are thus more like
|
||||
samples than complete lists. There are two such modules:
|
||||
|
||||
- ``Structural``: structural words (determiners, conjunctions,...)
|
||||
- ``Lexicon``: basic everyday content words (nouns, verbs,...)
|
||||
|
||||
|
||||
The module ``Structural`` aims for completeness, and is likely to
|
||||
be extended in future releases of the resource. The module ``Lexicon``
|
||||
gives a "random" list of words, which enable interesting testing of syntax,
|
||||
and also a check list for morphology, since those words are likely to include
|
||||
most morphological patterns of the language.
|
||||
|
||||
In the case of ``Lexicon`` it may come out clearer than anywhere else
|
||||
in the API that it is impossible to give exact translation equivalents in
|
||||
different languages on the level of a resource grammar. In other words,
|
||||
application grammars are likely to use the resource in different ways for
|
||||
different languages.
|
||||
|
||||
|
||||
==Language-dependent syntax modules==
|
||||
|
||||
In addition to the common API, there is room for language-dependent extensions
|
||||
of the resource. The top level of each languages looks as follows (with English as example):
|
||||
```
|
||||
abstract English = Grammar, ExtraEngAbs, DictEngAbs
|
||||
```
|
||||
where ``ExtraEngAbs`` is a collection of syntactic structures specific to English,
|
||||
and ``DictEngAbs`` is an English dictionary
|
||||
(at the moment, it consists of ``IrregEngAbs``,
|
||||
the irregular verbs of English). Each of these language-specific grammars has
|
||||
the potential to grow into a full-scale grammar of the language. These grammar
|
||||
can also be used as libraries, but the possibility of using functors is lost.
|
||||
|
||||
To give a better overview of language-specific structures,
|
||||
modules like ``ExtraEngAbs``
|
||||
are built from a language-independent module ``ExtraAbs``
|
||||
by restricted inheritance:
|
||||
```
|
||||
abstract ExtraEngAbs = Extra [f,g,...]
|
||||
```
|
||||
Thus any category and function in ``Extra`` may be shared by a subset of all
|
||||
languages. One can see this set-up as a matrix, which tells
|
||||
what ``Extra`` structures
|
||||
are implemented in what languages. For the common API in ``Grammar``, the matrix
|
||||
is filled with 1's (everything is implemented in every language).
|
||||
|
||||
In a minimal resource grammar implementation, the language-dependent
|
||||
extensions are just empty modules, but it is good to provide them for
|
||||
the sake of uniformity.
|
||||
|
||||
|
||||
==The core of the syntax==
|
||||
|
||||
Among all categories and functions, a handful are
|
||||
most important and distinct ones, of which the others are can be
|
||||
seen as variations. The categories are
|
||||
```
|
||||
Cl ; VP ; V2 ; NP ; CN ; Det ; AP ;
|
||||
```
|
||||
The functions are
|
||||
```
|
||||
PredVP : NP -> VP -> Cl ; -- predication
|
||||
ComplV2 : V2 -> NP -> VP ; -- complementization
|
||||
DetCN : Det -> CN -> NP ; -- determination
|
||||
ModCN : AP -> CN -> CN ; -- modification
|
||||
```
|
||||
This [toy Latin grammar latin.gf] shows in a nutshell how these
|
||||
rules relate the categories to each other. It is intended to be a
|
||||
first approximation when designing the parameter system of a new
|
||||
language.
|
||||
|
||||
|
||||
===Another reduced API===
|
||||
|
||||
If you want to experiment with a small subset of the resource API first,
|
||||
try out the module
|
||||
[Syntax http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/resource/Syntax.gf]
|
||||
explained in the
|
||||
[GF Tutorial http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html].
|
||||
|
||||
|
||||
===The present-tense fragment===
|
||||
|
||||
Some lines in the resource library are suffixed with the comment
|
||||
```--# notpresent
|
||||
which is used by a preprocessor to exclude those lines from
|
||||
a reduced version of the full resource. This present-tense-only
|
||||
version is useful for applications in most technical text, since
|
||||
they reduce the grammar size and compilation time. It can also
|
||||
be useful to exclude those lines in a first version of resource
|
||||
implementation. To compile a grammar with present-tense-only, use
|
||||
```
|
||||
i -preproc=GF/lib/resource-1.0/mkPresent LangGer.gf
|
||||
```
|
||||
|
||||
|
||||
|
||||
==Phases of the work==
|
||||
|
||||
===Putting up a directory===
|
||||
|
||||
Unless you are writing an instance of a parametrized implementation
|
||||
(Romance or Scandinavian), which will be covered later, the
|
||||
simplest way is to follow roughly the following procedure. Assume you
|
||||
are building a grammar for the German language. Here are the first steps,
|
||||
which we actually followed ourselves when building the German implementation
|
||||
of resource v. 1.0.
|
||||
|
||||
+ Create a sister directory for ``GF/lib/resource/english``, named
|
||||
``german``.
|
||||
```
|
||||
cd GF/lib/resource/
|
||||
mkdir german
|
||||
cd german
|
||||
```
|
||||
|
||||
+ Check out the [ISO 639 3-letter language code
|
||||
http://www.w3.org/WAI/ER/IG/ert/iso639.htm]
|
||||
for German: both ``Ger`` and ``Deu`` are given, and we pick ``Ger``.
|
||||
|
||||
+ Copy the ``*Eng.gf`` files from ``english`` ``german``,
|
||||
and rename them:
|
||||
```
|
||||
cp ../english/*Eng.gf .
|
||||
rename 's/Eng/Ger/' *Eng.gf
|
||||
```
|
||||
|
||||
+ Change the ``Eng`` module references to ``Ger`` references
|
||||
in all files:
|
||||
```
|
||||
sed -i 's/English/German/g' *Ger.gf
|
||||
sed -i 's/Eng/Ger/g' *Ger.gf
|
||||
```
|
||||
The first line prevents changing the word ``English``, which appears
|
||||
here and there in comments, to ``Gerlish``.
|
||||
|
||||
+ This may of course change unwanted occurrences of the
|
||||
string ``Eng`` - verify this by
|
||||
```
|
||||
grep Ger *.gf
|
||||
```
|
||||
But you will have to make lots of manual changes in all files anyway!
|
||||
|
||||
+ Comment out the contents of these files:
|
||||
```
|
||||
sed -i 's/^/--/' *Ger.gf
|
||||
```
|
||||
This will give you a set of templates out of which the grammar
|
||||
will grow as you uncomment and modify the files rule by rule.
|
||||
|
||||
+ In all ``.gf`` files, uncomment the module headers and brackets,
|
||||
leaving the module bodies commented. Unfortunately, there is no
|
||||
simple way to do this automatically (or to avoid commenting these
|
||||
lines in the previous step) - but uncommenting the first
|
||||
and the last lines will actually do the job for many of the files.
|
||||
|
||||
+ Uncomment the contents of the main grammar file:
|
||||
```
|
||||
sed -i 's/^--//' LangGer.gf
|
||||
```
|
||||
|
||||
+ Now you can open the grammar ``LangGer`` in GF:
|
||||
```
|
||||
gf LangGer.gf
|
||||
```
|
||||
You will get lots of warnings on missing rules, but the grammar will compile.
|
||||
|
||||
+ At all following steps you will now have a valid, but incomplete
|
||||
GF grammar. The GF command
|
||||
```
|
||||
pg -printer=missing
|
||||
```
|
||||
tells you what exactly is missing.
|
||||
|
||||
|
||||
Here is the module structure of ``LangGer``. It has been simplified by leaving out
|
||||
the majority of the phrase category modules. Each of them has the same dependencies
|
||||
as e.g. ``VerbGer``.
|
||||
|
||||
[German.png]
|
||||
|
||||
|
||||
===Direction of work===
|
||||
|
||||
The real work starts now. There are many ways to proceed, the main ones being
|
||||
- Top-down: start from the module ``Phrase`` and go down to ``Sentence``, then
|
||||
``Verb``, ``Noun``, and in the end ``Lexicon``. In this way, you are all the time
|
||||
building complete phrases, and add them with more content as you proceed.
|
||||
**This approach is not recommended**. It is impossible to test the rules if
|
||||
you have no words to apply the constructions to.
|
||||
|
||||
- Bottom-up: set as your first goal to implement ``Lexicon``. To this end, you
|
||||
need to write ``ParadigmsGer``, which in turn needs parts of
|
||||
``MorphoGer`` and ``ResGer``.
|
||||
**This approach is not recommended**. You can get stuck to details of
|
||||
morphology such as irregular words, and you don't have enough grasp about
|
||||
the type system to decide what forms to cover in morphology.
|
||||
|
||||
|
||||
The practical working direction is thus a saw-like motion between the morphological
|
||||
and top-level modules. Here is a possible course of the work that gives enough
|
||||
test data and enough general view at any point:
|
||||
+ Define ``Cat.N`` and the required parameter types in ``ResGer``. As we define
|
||||
```
|
||||
lincat N = {s : Number => Case => Str ; g : Gender} ;
|
||||
```
|
||||
we need the parameter types ``Number``, ``Case``, and ``Gender``. The definition
|
||||
of ``Number`` in [``common/ParamX`` ../common/ParamX.gf] works for German, so we
|
||||
use it and just define ``Case`` and ``Gender`` in ``ResGer``.
|
||||
|
||||
+ Define ``regN`` in ``ParadigmsGer``. In this way you can
|
||||
already implement a huge amount of nouns correctly in ``LexiconGer``. Actually
|
||||
just adding ``mkN`` should suffice for every noun - but,
|
||||
since it is tedious to use, you
|
||||
might proceed to the next step before returning to morphology and defining the
|
||||
real work horse ``reg2N``.
|
||||
|
||||
+ While doing this, you may want to test the resource independently. Do this by
|
||||
```
|
||||
i -retain ParadigmsGer
|
||||
cc regN "Kirche"
|
||||
```
|
||||
|
||||
+ Proceed to determiners and pronouns in
|
||||
``NounGer`` (``DetCN UsePron DetSg SgQuant NoNum NoOrd DefArt IndefArt UseN``)and
|
||||
``StructuralGer`` (``i_Pron every_Det``). You also need some categories and
|
||||
parameter types. At this point, it is maybe not possible to find out the final
|
||||
linearization types of ``CN``, ``NP``, and ``Det``, but at least you should
|
||||
be able to correctly inflect noun phrases such as //every airplane//:
|
||||
```
|
||||
i LangGer.gf
|
||||
l -table DetCN every_Det (UseN airplane_N)
|
||||
|
||||
Nom: jeder Flugzeug
|
||||
Acc: jeden Flugzeug
|
||||
Dat: jedem Flugzeug
|
||||
Gen: jedes Flugzeugs
|
||||
```
|
||||
|
||||
+ Proceed to verbs: define ``CatGer.V``, ``ResGer.VForm``, and
|
||||
``ParadigmsGer.regV``. You may choose to exclude ``notpresent``
|
||||
cases at this point. But anyway, you will be able to inflect a good
|
||||
number of verbs in ``Lexicon``, such as
|
||||
``live_V`` (``regV "leven"``).
|
||||
|
||||
+ Now you can soon form your first sentences: define ``VP`` and
|
||||
``Cl`` in ``CatGer``, ``VerbGer.UseV``, and ``SentenceGer.PredVP``.
|
||||
Even if you have excluded the tenses, you will be able to produce
|
||||
```
|
||||
i -preproc=mkPresent LangGer.gf
|
||||
> l -table PredVP (UsePron i_Pron) (UseV live_V)
|
||||
|
||||
Pres Simul Pos Main: ich lebe
|
||||
Pres Simul Pos Inv: lebe ich
|
||||
Pres Simul Pos Sub: ich lebe
|
||||
Pres Simul Neg Main: ich lebe nicht
|
||||
Pres Simul Neg Inv: lebe ich nicht
|
||||
Pres Simul Neg Sub: ich nicht lebe
|
||||
```
|
||||
|
||||
+ Transitive verbs (``CatGer.V2 ParadigmsGer.dirV2 VerbGer.ComplV2``)
|
||||
are a natural next step, so that you can
|
||||
produce ``ich liebe dich``.
|
||||
|
||||
+ Adjectives (``CatGer.A ParadigmsGer.regA NounGer.AdjCN AdjectiveGer.PositA``)
|
||||
will force you to think about strong and weak declensions, so that you can
|
||||
correctly inflect //my new car, this new car//.
|
||||
|
||||
+ Once you have implemented the set
|
||||
(``Noun.DetCN Noun.AdjCN Verb.UseV Verb.ComplV2 Sentence.PredVP),
|
||||
you have overcome most of difficulties. You know roughly what parameters
|
||||
and dependences there are in your language, and you can now produce very
|
||||
much in the order you please.
|
||||
|
||||
|
||||
|
||||
===The develop-test cycle===
|
||||
|
||||
The following develop-test cycle will
|
||||
be applied most of the time, both in the first steps described above
|
||||
and in later steps where you are more on your own.
|
||||
|
||||
+ Select a phrase category module, e.g. ``NounGer``, and uncomment some
|
||||
linearization rules (for instance, ``DefSg``, which is
|
||||
not too complicated).
|
||||
|
||||
+ Write down some German examples of this rule, for instance translations
|
||||
of "the dog", "the house", "the big house", etc. Write these in all their
|
||||
different forms (two numbers and four cases).
|
||||
|
||||
+ Think about the categories involved (``CN, NP, N``) and the
|
||||
variations they have. Encode this in the lincats of ``CatGer``.
|
||||
You may have to define some new parameter types in ``ResGer``.
|
||||
|
||||
+ To be able to test the construction,
|
||||
define some words you need to instantiate it
|
||||
in ``LexiconGer``. You will also need some regular inflection patterns
|
||||
in``ParadigmsGer``.
|
||||
|
||||
+ Test by parsing, linearization,
|
||||
and random generation. In particular, linearization to a table should
|
||||
be used so that you see all forms produced:
|
||||
```
|
||||
gr -cat=NP -number=20 -tr | l -table
|
||||
```
|
||||
|
||||
+ Spare some tree-linearization pairs for later regression testing. Use the
|
||||
``tree_bank`` command,
|
||||
```
|
||||
gr -cat=NP -number=20 | tb -xml | wf NP.tb
|
||||
```
|
||||
You can later compared your modified grammar to this treebank by
|
||||
```
|
||||
rf NP.tb | tb -c
|
||||
```
|
||||
|
||||
|
||||
|
||||
You are likely to run this cycle a few times for each linearization rule
|
||||
you implement, and some hundreds of times altogether. There are 66 ``cat``s and
|
||||
458 ``funs`` in ``Lang`` at the moment; 149 of the ``funs`` are outside the two
|
||||
lexicon modules).
|
||||
|
||||
Here is a [live log ../german/log.txt] of the actual process of
|
||||
building the German implementation of resource API v. 1.0.
|
||||
It is the basis of the more detailed explanations, which will
|
||||
follow soon. (You will found out that these explanations involve
|
||||
a rational reconstruction of the live process! Among other things, the
|
||||
API was changed during the actual process to make it more intuitive.)
|
||||
|
||||
|
||||
===Resource modules used===
|
||||
|
||||
These modules will be written by you.
|
||||
|
||||
- ``ResGer``: parameter types and auxiliary operations
|
||||
(a resource for the resource grammar!)
|
||||
- ``ParadigmsGer``: complete inflection engine and most important regular paradigms
|
||||
- ``MorphoGer``: auxiliaries for ``ParadigmsGer`` and ``StructuralGer``. This need
|
||||
not be separate from ``ResGer``.
|
||||
|
||||
|
||||
These modules are language-independent and provided by the existing resource
|
||||
package.
|
||||
|
||||
- ``ParamX``: parameter types used in many languages
|
||||
- ``CommonX``: implementation of language-uniform categories
|
||||
such as $Text$ and $Phr$, as well as of
|
||||
the logical tense, anteriority, and polarity parameters
|
||||
- ``Coordination``: operations to deal with lists and coordination
|
||||
- ``Prelude``: general-purpose operations on strings, records,
|
||||
truth values, etc.
|
||||
- ``Predefined``: general-purpose operations with hard-coded definitions
|
||||
|
||||
|
||||
An important decision is what rules to implement in terms of operations in
|
||||
``ResGer``. A golden rule of functional programming says that, whenever
|
||||
you find yourself programming by copy and paste, you should write a function
|
||||
instead. This indicates that an operation should be created if it is to be
|
||||
used at least twice. At the same time, a sound principle of vicinity says that
|
||||
it should not require too much browsing to understand what a rule does.
|
||||
From these two principles, we have derived the following practice:
|
||||
- If an operation is needed //in two different modules//,
|
||||
it should be created in ``ResGer``. An example is ``mkClause``,
|
||||
used in ``Sentence``, ``Question``, and ``Relative``-
|
||||
- If an operation is needed //twice in the same module//, but never
|
||||
outside, it should be created in the same module. Many examples are
|
||||
found in ``Numerals``.
|
||||
- If an operation is only needed once, it should not be created (but rather
|
||||
inlined). Most functions in phrase category modules are implemented in this
|
||||
way.
|
||||
|
||||
|
||||
This discipline is very different from the one followed in earlier
|
||||
versions of the library (up to 0.9). We then valued the principle of
|
||||
abstraction more than vicinity, creating layers of abstraction for
|
||||
almost everything. This led in practice to the duplication of almost
|
||||
all code on the ``lin`` and ``oper`` levels, and made the code
|
||||
hard to understand and maintain.
|
||||
|
||||
|
||||
|
||||
===Morphology and lexicon===
|
||||
|
||||
The paradigms needed to implement
|
||||
``LexiconGer`` are defined in
|
||||
``ParadigmsGer``.
|
||||
This module provides high-level ways to define the linearization of
|
||||
lexical items, of categories ``N, A, V`` and their complement-taking
|
||||
variants.
|
||||
|
||||
|
||||
|
||||
For ease of use, the ``Paradigms`` modules follow a certain
|
||||
naming convention. Thus they for each lexical category, such as ``N``,
|
||||
the functions
|
||||
|
||||
- ``mkN``, for worst-case construction of ``N``. Its type signature
|
||||
has the form
|
||||
```
|
||||
mkN : Str -> ... -> Str -> P -> ... -> Q -> N
|
||||
```
|
||||
with as many string and parameter arguments as can ever be needed to
|
||||
construct an ``N``.
|
||||
- ``regN``, for the most common cases, with just one string argument:
|
||||
```
|
||||
regN : Str -> N
|
||||
```
|
||||
- A language-dependent (small) set of functions to handle mild irregularities
|
||||
and common exceptions.
|
||||
|
||||
For the complement-taking variants, such as ``V2``, we provide
|
||||
|
||||
- ``mkV2``, which takes a ``V`` and all necessary arguments, such
|
||||
as case and preposition:
|
||||
```
|
||||
mkV2 : V -> Case -> Str -> V2 ;
|
||||
```
|
||||
- A language-dependent (small) set of functions to handle common special cases,
|
||||
such as direct transitive verbs:
|
||||
```
|
||||
dirV2 : V -> V2 ;
|
||||
-- dirV2 v = mkV2 v accusative []
|
||||
```
|
||||
|
||||
|
||||
The golden rule for the design of paradigms is that
|
||||
|
||||
- The user will only need function applications with constants and strings,
|
||||
never any records or tables.
|
||||
|
||||
|
||||
The discipline of data abstraction moreover requires that the user of the resource
|
||||
is not given access to parameter constructors, but only to constants that denote
|
||||
them. This gives the resource grammarian the freedom to change the underlying
|
||||
data representation if needed. It means that the ``ParadigmsGer`` module has
|
||||
to define constants for those parameter types and constructors that
|
||||
the application grammarian may need to use, e.g.
|
||||
```
|
||||
oper
|
||||
Case : Type ;
|
||||
nominative, accusative, genitive, dative : Case ;
|
||||
```
|
||||
These constants are defined in terms of parameter types and constructors
|
||||
in ``ResGer`` and ``MorphoGer``, which modules are not
|
||||
visible to the application grammarian.
|
||||
|
||||
|
||||
===Lock fields===
|
||||
|
||||
An important difference between ``MorphoGer`` and
|
||||
``ParadigmsGer`` is that the former uses "raw" record types
|
||||
for word classes, whereas the latter used category symbols defined in
|
||||
``CatGer``. When these category symbols are used to denote
|
||||
record types in a resource modules, such as ``ParadigmsGer``,
|
||||
a **lock field** is added to the record, so that categories
|
||||
with the same implementation are not confused with each other.
|
||||
(This is inspired by the ``newtype`` discipline in Haskell.)
|
||||
For instance, the lincats of adverbs and conjunctions are the same
|
||||
in ``CommonX`` (and therefore in ``CatGer``, which inherits it):
|
||||
```
|
||||
lincat Adv = {s : Str} ;
|
||||
lincat Conj = {s : Str} ;
|
||||
```
|
||||
But when these category symbols are used to denote their linearization
|
||||
types in resource module, these definitions are translated to
|
||||
```
|
||||
oper Adv : Type = {s : Str ; lock_Adv : {}} ;
|
||||
oper Conj : Type = {s : Str} ; lock_Conj : {}} ;
|
||||
```
|
||||
In this way, the user of a resource grammar cannot confuse adverbs with
|
||||
conjunctions. In other words, the lock fields force the type checker
|
||||
to function as grammaticality checker.
|
||||
|
||||
When the resource grammar is ``open``ed in an application grammar, the
|
||||
lock fields are never seen (except possibly in type error messages),
|
||||
and the application grammarian should never write them herself. If she
|
||||
has to do this, it is a sign that the resource grammar is incomplete, and
|
||||
the proper way to proceed is to fix the resource grammar.
|
||||
|
||||
The resource grammarian has to provide the dummy lock field values
|
||||
in her hidden definitions of constants in ``Paradigms``. For instance,
|
||||
```
|
||||
mkAdv : Str -> Adv ;
|
||||
-- mkAdv s = {s = s ; lock_Adv = <>} ;
|
||||
```
|
||||
|
||||
|
||||
===Lexicon construction===
|
||||
|
||||
The lexicon belonging to ``LangGer`` consists of two modules:
|
||||
|
||||
- ``StructuralGer``, structural words, built by directly using
|
||||
``MorphoGer``.
|
||||
- ``BasicGer``, content words, built by using ``ParadigmsGer``.
|
||||
|
||||
|
||||
The reason why ``MorphoGer`` has to be used in ``StructuralGer``
|
||||
is that ``ParadigmsGer`` does not contain constructors for closed
|
||||
word classes such as pronouns and determiners. The reason why we
|
||||
recommend ``ParadigmsGer`` for building ``LexiconGer`` is that
|
||||
the coverage of the paradigms gets thereby tested and that the
|
||||
use of the paradigms in ``LexiconGer`` gives a good set of examples for
|
||||
those who want to build new lexica.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
==Inside grammar modules==
|
||||
|
||||
Detailed implementation tricks
|
||||
are found in the comments of each module.
|
||||
|
||||
|
||||
===The category system===
|
||||
|
||||
- [Common gfdoc/Common.html], [CommonX ../common/CommonX.gf]
|
||||
- [Cat gfdoc/Cat.html], [CatGer gfdoc/CatGer.gf]
|
||||
|
||||
|
||||
===Phrase category modules===
|
||||
|
||||
- [Noun gfdoc/Noun.html], [NounGer ../german/NounGer.gf]
|
||||
- [Adjective gfdoc/Adjective.html], [AdjectiveGer ../german/AdjectiveGer.gf]
|
||||
- [Verb gfdoc/Verb.html], [VerbGer ../german/VerbGer.gf]
|
||||
- [Adverb gfdoc/Adverb.html], [AdverbGer ../german/AdverbGer.gf]
|
||||
- [Numeral gfdoc/Numeral.html], [NumeralGer ../german/NumeralGer.gf]
|
||||
- [Sentence gfdoc/Sentence.html], [SentenceGer ../german/SentenceGer.gf]
|
||||
- [Question gfdoc/Question.html], [QuestionGer ../german/QuestionGer.gf]
|
||||
- [Relative gfdoc/Relative.html], [RelativeGer ../german/RelativeGer.gf]
|
||||
- [Conjunction gfdoc/Conjunction.html], [ConjunctionGer ../german/ConjunctionGer.gf]
|
||||
- [Phrase gfdoc/Phrase.html], [PhraseGer ../german/PhraseGer.gf]
|
||||
- [Text gfdoc/Text.html], [TextX ../common/TextX.gf]
|
||||
- [Idiom gfdoc/Idiom.html], [IdiomGer ../german/IdiomGer.gf]
|
||||
- [Lang gfdoc/Lang.html], [LangGer ../german/LangGer.gf]
|
||||
|
||||
|
||||
===Resource modules===
|
||||
|
||||
- [ResGer ../german/ResGer.gf]
|
||||
- [MorphoGer ../german/MorphoGer.gf]
|
||||
- [ParadigmsGer gfdoc/ParadigmsGer.html], [ParadigmsGer.gf ../german/ParadigmsGer.gf]
|
||||
|
||||
|
||||
===Lexicon===
|
||||
|
||||
- [Structural gfdoc/Structural.html], [StructuralGer ../german/StructuralGer.gf]
|
||||
- [Lexicon gfdoc/Lexicon.html], [LexiconGer ../german/LexiconGer.gf]
|
||||
|
||||
|
||||
==Lexicon extension==
|
||||
|
||||
===The irregularity lexicon===
|
||||
|
||||
It may be handy to provide a separate module of irregular
|
||||
verbs and other words which are difficult for a lexicographer
|
||||
to handle. There are usually a limited number of such words - a
|
||||
few hundred perhaps. Building such a lexicon separately also
|
||||
makes it less important to cover //everything// by the
|
||||
worst-case paradigms (``mkV`` etc).
|
||||
|
||||
|
||||
|
||||
===Lexicon extraction from a word list===
|
||||
|
||||
You can often find resources such as lists of
|
||||
irregular verbs on the internet. For instance, the
|
||||
[Irregular German Verbs http://www.iee.et.tu-dresden.de/~wernerr/grammar/verben_dt.html]
|
||||
page gives a list of verbs in the
|
||||
traditional tabular format, which begins as follows:
|
||||
```
|
||||
backen (du bäckst, er bäckt) backte [buk] gebacken
|
||||
befehlen (du befiehlst, er befiehlt; befiehl!) befahl (beföhle; befähle) befohlen
|
||||
beginnen begann (begönne; begänne) begonnen
|
||||
beißen biß gebissen
|
||||
```
|
||||
All you have to do is to write a suitable verb paradigm
|
||||
```
|
||||
irregV : (x1,_,_,_,_,x6 : Str) -> V ;
|
||||
```
|
||||
and a Perl or Python or Haskell script that transforms
|
||||
the table to
|
||||
```
|
||||
backen_V = irregV "backen" "bäckt" "back" "backte" "backte" "gebacken" ;
|
||||
befehlen_V = irregV "befehlen" "befiehlt" "befiehl" "befahl" "beföhle" "befohlen" ;
|
||||
```
|
||||
|
||||
When using ready-made word lists, you should think about
|
||||
coyright issues. Ideally, all resource grammar material should
|
||||
be provided under GNU General Public License.
|
||||
|
||||
|
||||
|
||||
===Lexicon extraction from raw text data===
|
||||
|
||||
This is a cheap technique to build a lexicon of thousands
|
||||
of words, if text data is available in digital format.
|
||||
See the [Functional Morphology http://www.cs.chalmers.se/~markus/FM/]
|
||||
homepage for details.
|
||||
|
||||
|
||||
|
||||
===Extending the resource grammar API===
|
||||
|
||||
Sooner or later it will happen that the resource grammar API
|
||||
does not suffice for all applications. A common reason is
|
||||
that it does not include idiomatic expressions in a given language.
|
||||
The solution then is in the first place to build language-specific
|
||||
extension modules. This chapter will deal with this issue (to be completed).
|
||||
|
||||
|
||||
==Writing an instance of parametrized resource grammar implementation==
|
||||
|
||||
Above we have looked at how a resource implementation is built by
|
||||
the copy and paste method (from English to German), that is, formally
|
||||
speaking, from scratch. A more elegant solution available for
|
||||
families of languages such as Romance and Scandinavian is to
|
||||
use parametrized modules. The advantages are
|
||||
|
||||
- theoretical: linguistic generalizations and insights
|
||||
- practical: maintainability improves with fewer components
|
||||
|
||||
|
||||
In this chapter, we will look at an example: adding Italian to
|
||||
the Romance family (to be completed). Here is a set of
|
||||
[slides http://www.cs.chalmers.se/~aarne/geocal2006.pdf]
|
||||
on the topic.
|
||||
|
||||
|
||||
==Parametrizing a resource grammar implementation==
|
||||
|
||||
This is the most demanding form of resource grammar writing.
|
||||
We do //not// recommend the method of parametrizing from the
|
||||
beginning: it is easier to have one language first implemented
|
||||
in the conventional way and then add another language of the
|
||||
same family by aprametrization. This means that the copy and
|
||||
paste method is still used, but at this time the differences
|
||||
are put into an ``interface`` module.
|
||||
|
||||
|
||||
|
||||
This chapter will work out an example of how an Estonian grammar
|
||||
is constructed from the Finnish grammar through parametrization.
|
||||
|
||||
|
||||
111
lib/resource/doc/Syntax.dot
Normal file
@@ -0,0 +1,111 @@
|
||||
digraph {
|
||||
|
||||
size = "12,8" ;
|
||||
|
||||
German [style = "solid", shape = "ellipse"];
|
||||
ExtraGer [style = "solid", shape = "ellipse"];
|
||||
IrregGer [style = "solid", shape = "ellipse"];
|
||||
|
||||
German -> IrregGer [style = "solid"];
|
||||
German -> ExtraGer [style = "solid"];
|
||||
German -> LangGer [style = "solid"];
|
||||
IrregGer -> ParadigmsGer [style = "solid"];
|
||||
ExtraGer -> Grammar [style = "solid"];
|
||||
|
||||
TryGer [style = "solid", shape = "rectangle"];
|
||||
|
||||
LangGer [style = "solid", shape = "ellipse"];
|
||||
|
||||
TryGer -> SyntaxGer [style = "solid"];
|
||||
|
||||
TryGer -> ParadigmsGer [style = "solid"];
|
||||
|
||||
TryGer -> Lexicon [style = "solid"];
|
||||
|
||||
LangGer -> Grammar [style = "solid"];
|
||||
LangGer -> Lexicon [style = "solid"];
|
||||
|
||||
Lexicon [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
|
||||
|
||||
SyntaxGer [style = "solid", shape = "rectangle"];
|
||||
|
||||
SyntaxGer -> Syntax [style = "solid"];
|
||||
|
||||
ParadigmsGer [style = "solid", shape = "rectangle"];
|
||||
|
||||
Syntax [style = "solid", shape = "diamond"];
|
||||
|
||||
Syntax -> Grammar [style = "solid"];
|
||||
Syntax -> Constructors [style = "solid"];
|
||||
ParadigmsGer -> Grammar [style = "solid"];
|
||||
|
||||
Constructors [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
|
||||
|
||||
Constructors -> Grammar [style = "solid"];
|
||||
|
||||
Grammar [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
|
||||
|
||||
|
||||
Grammar -> Noun [style = "solid"];
|
||||
Grammar -> Verb [style = "solid"];
|
||||
Grammar -> Adjective [style = "solid"];
|
||||
Grammar -> Adverb [style = "solid"];
|
||||
Grammar -> Numeral [style = "solid"];
|
||||
Grammar -> Sentence [style = "solid"];
|
||||
Grammar -> Question [style = "solid"];
|
||||
Grammar -> Relative [style = "solid"];
|
||||
Grammar -> Conjunction [style = "solid"];
|
||||
Grammar -> Phrase [style = "solid"];
|
||||
Grammar -> Text [style = "solid"];
|
||||
Grammar -> Idiom [style = "solid"];
|
||||
Grammar -> Structural [style = "solid"];
|
||||
|
||||
|
||||
Noun [style = "dashed", shape = "ellipse", URL = "Noun.gf"];
|
||||
Noun -> Cat [style = "solid"];
|
||||
|
||||
Verb [style = "dashed", shape = "ellipse", URL = "Verb.gf"];
|
||||
Verb -> Cat [style = "solid"];
|
||||
|
||||
Adjective [style = "dashed", shape = "ellipse", URL = "Adjective.gf"];
|
||||
Adjective -> Cat [style = "solid"];
|
||||
|
||||
Adverb [style = "dashed", shape = "ellipse", URL = "Adverb.gf"];
|
||||
Adverb -> Cat [style = "solid"];
|
||||
|
||||
Numeral [style = "dashed", shape = "ellipse", URL = "Numeral.gf"];
|
||||
Numeral -> Cat [style = "solid"];
|
||||
|
||||
Sentence [style = "dashed", shape = "ellipse", URL = "Sentence.gf"];
|
||||
Sentence -> Cat [style = "solid"];
|
||||
|
||||
Question [style = "dashed", shape = "ellipse", URL = "Question.gf"];
|
||||
Question -> Cat [style = "solid"];
|
||||
|
||||
Relative [style = "dashed", shape = "ellipse", URL = "Relative.gf"];
|
||||
Relative -> Cat [style = "solid"];
|
||||
|
||||
Conjunction [style = "dashed", shape = "ellipse", URL = "Conjunction.gf"];
|
||||
Conjunction -> Cat [style = "solid"];
|
||||
|
||||
Phrase [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Phrase -> Cat [style = "solid"];
|
||||
|
||||
Text [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Text -> Cat [style = "solid"];
|
||||
|
||||
Idiom [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
|
||||
Idiom -> Cat [style = "solid"];
|
||||
|
||||
Structural [style = "dashed", shape = "ellipse", URL = "Structural.gf"];
|
||||
Structural -> Cat [style = "solid"];
|
||||
|
||||
#Lexicon [style = "dashed", shape = "ellipse", URL = "Lexicon.gf"];
|
||||
#Lexicon -> Cat [style = "solid"];
|
||||
|
||||
Cat [style = "dashed", shape = "ellipse", URL = "Cat.gf"];
|
||||
Cat -> Common [style = "solid"];
|
||||
|
||||
Common [style = "dashed", shape = "ellipse", URL = "Tense.gf"];
|
||||
|
||||
}
|
||||
BIN
lib/resource/doc/Syntax.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
lib/resource/doc/Test.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
50
lib/resource/doc/categories-imagemap.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<map id="categories" name="categories">
|
||||
<area shape="poly" href="#Text" title="Text" alt="" coords="647,21 646,15 642,11 636,7 629,5 622,4 614,5 607,7 601,11 597,15 596,21 597,26 601,31 607,34 614,37 622,38 629,37 636,34 642,31 646,26"/>
|
||||
<area shape="poly" href="#Punct" title="Punct" alt="" coords="614,88 613,83 609,78 603,75 595,72 587,71 578,72 571,75 565,78 561,83 560,88 561,94 565,98 571,102 578,104 587,105 595,104 603,102 609,98 613,94"/>
|
||||
<area shape="poly" href="#Phr" title="Phr" alt="" coords="682,88 681,83 677,78 671,75 664,72 656,71 649,72 641,75 636,78 632,83 631,88 632,94 636,98 641,102 649,104 656,105 664,104 671,102 677,98 681,94"/>
|
||||
<area shape="poly" href="#PConj" title="PConj" alt="" coords="614,156 613,151 609,146 603,142 595,140 586,139 577,140 569,142 563,146 559,151 557,156 559,161 563,166 569,170 577,172 586,173 595,172 603,170 609,166 613,161"/>
|
||||
<area shape="poly" href="#Utt" title="Utt" alt="" coords="682,156 681,151 677,146 671,142 664,140 656,139 649,140 641,142 636,146 632,151 631,156 632,161 636,166 641,170 649,172 656,173 664,172 671,170 677,166 681,161"/>
|
||||
<area shape="poly" href="#Voc" title="Voc" alt="" coords="749,156 748,151 745,146 739,142 732,140 724,139 716,140 709,142 704,146 700,151 699,156 700,161 704,166 709,170 716,172 724,173 732,172 739,170 745,166 748,161"/>
|
||||
<area shape="poly" href="#Imp" title="Imp" alt="" coords="614,224 613,219 609,214 604,210 596,208 589,207 581,208 574,210 568,214 565,219 563,224 565,229 568,234 574,237 581,240 589,241 596,240 604,237 609,234 613,229"/>
|
||||
<area shape="poly" href="#S" title="S" alt="" coords="682,224 681,219 677,214 671,210 664,208 656,207 649,208 641,210 636,214 632,219 631,224 632,229 636,234 641,237 649,240 656,241 664,240 671,237 677,234 681,229"/>
|
||||
<area shape="poly" href="#QS" title="QS" alt="" coords="849,224 848,219 844,214 839,210 832,208 824,207 816,208 809,210 803,214 800,219 798,224 800,229 803,234 809,237 816,240 824,241 832,240 839,237 844,234 848,229"/>
|
||||
<area shape="poly" href="#Tense" title="Tense" alt="" coords="479,292 478,286 474,282 468,278 460,275 451,275 443,275 435,278 429,282 425,286 424,292 425,297 429,301 435,305 443,308 451,308 460,308 468,305 474,301 478,297"/>
|
||||
<area shape="poly" href="#Ant" title="Ant" alt="" coords="546,292 545,286 541,282 536,278 529,275 521,275 513,275 506,278 500,282 497,286 496,292 497,297 500,301 506,305 513,308 521,308 529,308 536,305 541,301 545,297"/>
|
||||
<area shape="poly" href="#Pol" title="Pol" alt="" coords="614,292 613,286 609,282 604,278 596,275 589,275 581,275 574,278 568,282 565,286 563,292 565,297 568,301 574,305 581,308 589,308 596,308 604,305 609,301 613,297"/>
|
||||
<area shape="poly" href="#Cl" title="Cl" alt="" coords="682,292 681,286 677,282 671,278 664,275 656,275 649,275 641,278 636,282 632,286 631,292 632,297 636,301 641,305 649,308 656,308 664,308 671,305 677,301 681,297"/>
|
||||
<area shape="poly" href="#ListS" title="ListS" alt="" coords="751,292 750,286 746,282 740,278 733,275 725,275 717,275 710,278 704,282 700,286 699,292 700,297 704,301 710,305 717,308 725,308 733,308 740,305 746,301 750,297"/>
|
||||
<area shape="poly" href="#Conj" title="Conj,DConj" alt="" coords="857,292 855,286 849,282 839,278 826,275 812,275 799,275 786,278 776,282 770,286 768,292 770,297 776,301 786,305 799,308 812,308 826,308 839,305 849,301 855,297"/>
|
||||
<area shape="poly" href="#QCl" title="QCl" alt="" coords="949,292 948,286 944,282 938,278 931,275 923,275 916,275 908,278 903,282 899,286 898,292 899,297 903,301 908,305 916,308 923,308 931,308 938,305 944,301 948,297"/>
|
||||
<area shape="poly" href="#NP" title="NP" alt="" coords="265,359 264,354 260,349 255,346 248,343 240,342 232,343 225,346 219,349 216,354 214,359 216,364 219,369 225,373 232,375 240,376 248,375 255,373 260,369 264,364"/>
|
||||
<area shape="poly" href="#VP" title="VP" alt="" coords="657,359 656,354 652,349 647,346 640,343 632,342 624,343 617,346 611,349 608,354 607,359 608,364 611,369 617,373 624,375 632,376 640,375 647,373 652,369 656,364"/>
|
||||
<area shape="rect" href="#Adv" title="Adv" alt="" coords="756,342,807,376"/>
|
||||
<area shape="poly" href="#Predet" title="Predet" alt="" coords="62,427 61,422 56,417 50,413 42,411 33,410 24,411 16,413 9,417 5,422 4,427 5,432 9,437 16,441 24,443 33,444 42,443 50,441 56,437 61,432"/>
|
||||
<area shape="poly" href="#Pron" title="Pron" alt="" coords="130,427 129,422 125,417 119,413 112,411 104,410 97,411 89,413 84,417 80,422 79,427 80,432 84,437 89,441 97,443 104,444 112,443 119,441 125,437 129,432"/>
|
||||
<area shape="rect" href="#PN" title="PN" alt="" coords="147,410,197,444"/>
|
||||
<area shape="poly" href="#Det" title="Det" alt="" coords="265,427 264,422 260,417 255,413 248,411 240,410 232,411 225,413 219,417 216,422 214,427 216,432 219,437 225,441 232,443 240,444 248,443 255,441 260,437 264,432"/>
|
||||
<area shape="poly" href="#CN" title="CN" alt="" coords="333,427 332,422 328,417 322,413 315,411 307,410 300,411 293,413 287,417 283,422 282,427 283,432 287,437 293,441 300,443 307,444 315,443 322,441 328,437 332,432"/>
|
||||
<area shape="poly" href="#ListNP" title="ListNP" alt="" coords="412,427 410,422 406,417 399,413 390,411 381,410 371,411 363,413 356,417 351,422 350,427 351,432 356,437 363,441 371,443 381,444 390,443 399,441 406,437 410,432"/>
|
||||
<area shape="poly" href="#AdV" title="AdV" alt="" coords="480,427 478,422 475,417 469,413 462,411 454,410 446,411 439,413 434,417 430,422 429,427 430,432 434,437 439,441 446,443 454,444 462,443 469,441 475,437 478,432"/>
|
||||
<area shape="rect" href="#V" title="V,V2,V3,VV,VS,VQ,VA,V2A" alt="" coords="496,410,671,444"/>
|
||||
<area shape="poly" href="#AP" title="AP" alt="" coords="739,427 738,422 734,417 729,413 722,411 714,410 706,411 699,413 693,417 690,422 688,427 690,432 693,437 699,441 706,443 714,444 722,443 729,441 734,437 738,432"/>
|
||||
<area shape="poly" href="#Subj" title="Subj" alt="" coords="807,427 806,422 802,417 796,413 789,411 781,410 774,411 766,413 761,417 757,422 756,427 757,432 761,437 766,441 774,443 781,444 789,443 796,441 802,437 806,432"/>
|
||||
<area shape="poly" href="#ListAdj" title="ListAdj" alt="" coords="888,427 887,422 882,417 875,413 866,411 856,410 846,411 837,413 829,417 825,422 823,427 825,432 829,437 837,441 846,443 856,444 866,443 875,441 882,437 887,432"/>
|
||||
<area shape="poly" href="#QuantSg" title="QuantSg,QuantPl" alt="" coords="130,495 127,489 119,485 106,481 90,479 71,478 53,479 37,481 24,485 16,489 13,495 16,500 24,505 37,508 53,511 71,512 90,511 106,508 119,505 127,500"/>
|
||||
<area shape="poly" href="#Num" title="Num" alt="" coords="198,495 197,489 193,485 187,481 180,479 172,478 164,479 157,481 151,485 148,489 146,495 148,500 151,505 157,508 164,511 172,512 180,511 187,508 193,505 197,500"/>
|
||||
<area shape="poly" href="#Ord" title="Ord" alt="" coords="265,495 264,489 260,485 255,481 248,479 240,478 232,479 225,481 219,485 216,489 214,495 216,500 219,505 225,508 232,511 240,512 248,511 255,508 260,505 264,500"/>
|
||||
<area shape="rect" href="#N" title="N,N2,N3" alt="" coords="282,478,346,512"/>
|
||||
<area shape="poly" href="#RS" title="RS" alt="" coords="414,495 413,489 409,485 403,481 396,479 388,478 381,479 373,481 368,485 364,489 363,495 364,500 368,505 373,508 381,511 388,512 396,511 403,508 409,505 413,500"/>
|
||||
<area shape="poly" href="#Quant" title="Quant" alt="" coords="100,562 99,557 95,552 88,549 80,546 71,545 63,546 55,549 48,552 44,557 43,562 44,568 48,572 55,576 63,578 71,579 80,578 88,576 95,572 99,568"/>
|
||||
<area shape="poly" href="#Numeral" title="Numeral,Int" alt="" coords="211,562 209,557 203,552 193,549 180,546 166,545 153,546 140,549 130,552 124,557 122,562 124,568 130,572 140,576 153,578 166,579 180,578 193,576 203,572 209,568"/>
|
||||
<area shape="poly" href="#AdN" title="AdN" alt="" coords="278,562 277,557 273,552 268,549 261,546 253,545 245,546 238,549 232,552 229,557 228,562 229,568 232,572 238,576 245,578 253,579 261,578 268,576 273,572 277,568"/>
|
||||
<area shape="poly" href="#CAdv" title="CAdv" alt="" coords="281,630 279,625 275,620 269,616 262,614 253,613 244,614 237,616 231,620 227,625 225,630 227,635 231,640 237,644 244,646 253,647 262,646 269,644 275,640 279,635"/>
|
||||
<area shape="poly" href="#RCl" title="RCl" alt="" coords="414,562 413,557 409,552 403,549 396,546 388,545 381,546 373,549 368,552 364,557 363,562 364,568 368,572 373,576 381,578 388,579 396,578 403,576 409,572 413,568"/>
|
||||
<area shape="poly" href="#AdA" title="AdA" alt="" coords="671,495 670,489 667,485 661,481 654,479 646,478 638,479 631,481 625,485 622,489 621,495 622,500 625,505 631,508 638,511 646,512 654,511 661,508 667,505 670,500"/>
|
||||
<area shape="rect" href="#A" title="A, A2" alt="" coords="688,478,739,512"/>
|
||||
<area shape="poly" href="#ListAP" title="ListAP" alt="" coords="818,495 817,489 812,485 805,481 797,479 787,478 777,479 769,481 762,485 758,489 756,495 758,500 762,505 769,508 777,511 787,512 797,511 805,508 812,505 817,500"/>
|
||||
<area shape="poly" href="#IP" title="IP" alt="" coords="915,359 914,354 910,349 904,346 897,343 890,342 882,343 875,346 869,349 865,354 864,359 865,364 869,369 875,373 882,375 890,376 897,375 904,373 910,369 914,364"/>
|
||||
<area shape="poly" href="#IAdv" title="IAdv" alt="" coords="983,359 982,354 978,349 972,346 965,343 957,342 949,343 942,346 936,349 933,354 931,359 933,364 936,369 942,373 949,375 957,376 965,375 972,373 978,369 982,364"/>
|
||||
<area shape="poly" href="#Slash" title="Slash" alt="" coords="1053,359 1051,354 1048,349 1042,346 1034,343 1026,342 1018,343 1010,346 1004,349 1000,354 999,359 1000,364 1004,369 1010,373 1018,375 1026,376 1034,375 1042,373 1048,369 1051,364"/>
|
||||
<area shape="poly" href="#IDet" title="IDet" alt="" coords="955,427 954,422 951,417 945,413 938,411 930,410 922,411 915,413 909,417 906,422 905,427 906,432 909,437 915,441 922,443 930,444 938,443 945,441 951,437 954,432"/>
|
||||
<area shape="poly" href="#RP" title="RP" alt="" coords="414,630 413,625 409,620 403,616 396,614 388,613 381,614 373,616 368,620 364,625 363,630 364,635 368,640 373,644 381,646 388,647 396,646 403,644 409,640 413,635"/>
|
||||
</map>
|
||||
19
lib/resource/doc/categories-intro.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
The chart below shows the categories in a hierarchical top-down order.
|
||||
The edges do not define the complete dependency structure; if they did,
|
||||
the graph would have many many more edges, and also many cycles. The precise
|
||||
meaning of a directed edge from //C// to //D// is: there is a constructor
|
||||
of //C// that takes //D// as an argument. What the constructors exactly are,
|
||||
and what other arguments they take, is described by separate tables for
|
||||
each category.
|
||||
|
||||
| [categories.png] |
|
||||
|
||||
%!include(html): ''categories-imagemap.html''
|
||||
|
||||
|
||||
The rectangular boxes mark open lexical categories, which have constructors
|
||||
also in the ``Paradigms`` modules.
|
||||
|
||||
|
||||
141
lib/resource/doc/categories.dot
Normal file
@@ -0,0 +1,141 @@
|
||||
digraph categories {
|
||||
|
||||
size = "11,11" ;
|
||||
node [href="#\N"];
|
||||
|
||||
Text [style = "solid", shape = "ellipse"];
|
||||
Text -> Punct [style = "solid"];
|
||||
Text -> Phr [style = "solid"];
|
||||
|
||||
Punct [style = "solid", shape = "ellipse"];
|
||||
|
||||
Phr [style = "solid", shape = "ellipse"];
|
||||
Phr -> PConj [style = "solid"];
|
||||
Phr -> Utt [style = "solid"];
|
||||
Phr -> Voc [style = "solid"];
|
||||
|
||||
PConj [style = "solid", shape = "ellipse"];
|
||||
Voc [style = "solid", shape = "ellipse"];
|
||||
|
||||
Utt [style = "solid", shape = "ellipse"];
|
||||
Utt -> Imp [style = "solid"];
|
||||
Utt -> S [style = "solid"];
|
||||
Utt -> QS [style = "solid"];
|
||||
|
||||
Imp [style = "solid", shape = "ellipse"];
|
||||
|
||||
S [style = "solid", shape = "ellipse"];
|
||||
S -> Tense [style = "solid"];
|
||||
S -> Ant [style = "solid"];
|
||||
S -> Pol [style = "solid"];
|
||||
S -> Cl [style = "solid"];
|
||||
S -> ListS [style = "solid"];
|
||||
S -> Conjs [style = "solid"];
|
||||
|
||||
Conjs [label = "Conj,DConj", href="#Conj", style = "solid", shape = "ellipse"];
|
||||
|
||||
Tense [style = "solid", shape = "ellipse"];
|
||||
Ant [style = "solid", shape = "ellipse"];
|
||||
Pol [style = "solid", shape = "ellipse"];
|
||||
|
||||
Cl [style = "solid", shape = "ellipse"];
|
||||
Cl -> NP [style = "solid"];
|
||||
Cl -> VP [style = "solid"];
|
||||
Cl -> Adv [style = "solid"];
|
||||
|
||||
Adv [style = "solid", shape = "rectangle"];
|
||||
Adv -> Subj [style = "solid"];
|
||||
Adv -> ListAdj [style = "solid"];
|
||||
|
||||
|
||||
NP [style = "solid", shape = "ellipse"];
|
||||
NP -> Predet [style = "solid"];
|
||||
NP -> Pron [style = "solid"];
|
||||
NP -> PN [style = "solid"];
|
||||
NP -> Det [style = "solid"];
|
||||
NP -> CN [style = "solid"];
|
||||
NP -> ListNP [style = "solid"];
|
||||
|
||||
Predet [style = "solid", shape = "ellipse"];
|
||||
|
||||
Pron [style = "solid", shape = "ellipse"];
|
||||
PN [style = "solid", shape = "rectangle"];
|
||||
|
||||
Det [style = "solid", shape = "ellipse"];
|
||||
Det -> Quants [style = "solid"];
|
||||
Det -> Num [style = "solid"];
|
||||
Det -> Ord [style = "solid"];
|
||||
|
||||
|
||||
Quants [label = "QuantSg,QuantPl", href="#QuantSg", style = "solid", shape = "ellipse"];
|
||||
Quants -> Quant [style = "solid"];
|
||||
|
||||
Quant [style = "solid", shape = "ellipse"];
|
||||
|
||||
|
||||
Num [style = "solid", shape = "ellipse"];
|
||||
Num -> Numerals [style = "solid"];
|
||||
Num -> AdN [style = "solid"];
|
||||
|
||||
AdN [style = "solid", shape = "ellipse"];
|
||||
AdN -> CAdv [style = "solid"];
|
||||
|
||||
|
||||
Numerals [label = "Numeral,Int", href="#Numeral", style = "solid", shape = "ellipse"];
|
||||
|
||||
|
||||
Ord [style = "solid", shape = "ellipse"];
|
||||
|
||||
CN [style = "solid", shape = "ellipse"];
|
||||
CN -> Ns [style = "solid"];
|
||||
CN -> RS [style = "solid"];
|
||||
|
||||
Ns [label = "N,N2,N3", href="#N", style = "solid", shape = "rectangle"];
|
||||
|
||||
|
||||
VP [style = "solid", shape = "ellipse"];
|
||||
VP -> AdV [style = "solid"];
|
||||
VP -> Vs [style = "solid"];
|
||||
VP -> AP [style = "solid"];
|
||||
|
||||
AdV [style = "solid", shape = "ellipse"];
|
||||
|
||||
Vs [label = "V,V2,V3,VV,VS,VQ,VA,V2A", href="#V", style = "solid", shape = "rectangle"];
|
||||
|
||||
AP [style = "solid", shape = "ellipse"];
|
||||
AP -> AdA [style = "solid"];
|
||||
AP -> As [style = "solid"];
|
||||
AP -> ListAP [style = "solid"];
|
||||
|
||||
As [label = "A, A2", href="#A", style = "solid", shape = "rectangle"];
|
||||
|
||||
|
||||
|
||||
|
||||
QS [style = "solid", shape = "ellipse"];
|
||||
QS -> QCl [style = "solid"];
|
||||
|
||||
QCl [style = "solid", shape = "ellipse"];
|
||||
QCl -> IP [style = "solid"];
|
||||
QCl -> IAdv [style = "solid"];
|
||||
QCl -> Slash [style = "solid"];
|
||||
|
||||
IP [style = "solid", shape = "ellipse"];
|
||||
IP -> IDet [style = "solid"];
|
||||
|
||||
IDet [style = "solid", shape = "ellipse"];
|
||||
|
||||
IAdv [style = "solid", shape = "ellipse"];
|
||||
|
||||
Slash [style = "solid", shape = "ellipse"];
|
||||
|
||||
RS [style = "solid", shape = "ellipse"];
|
||||
RS -> RCl [style = "solid"];
|
||||
|
||||
RCl [style = "solid", shape = "ellipse"];
|
||||
RCl -> RP [style = "solid"];
|
||||
|
||||
RP [style = "solid", shape = "ellipse"];
|
||||
|
||||
|
||||
}
|
||||
BIN
lib/resource/doc/categories.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
1065
lib/resource/doc/clt2006.html
Normal file
899
lib/resource/doc/clt2006.txt
Normal file
@@ -0,0 +1,899 @@
|
||||
The GF Resource Grammar Library Version 1.0
|
||||
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
|
||||
Last update: %%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags --toc clt2006.txt
|
||||
|
||||
%!target:html
|
||||
|
||||
%!postproc(html): #NEW <!-- NEW -->
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Plan==
|
||||
|
||||
Purpose
|
||||
|
||||
Background
|
||||
|
||||
Coverage
|
||||
|
||||
Structure
|
||||
|
||||
How to use
|
||||
|
||||
How to implement a new language
|
||||
|
||||
How to extend the API
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Purpose==
|
||||
|
||||
===Library for applications===
|
||||
|
||||
High-level access to grammatical rules
|
||||
|
||||
E.g. //You have k new messages// rendered in ten languages //X//
|
||||
```
|
||||
render X (Have (You (Number (k (New Message)))))
|
||||
```
|
||||
|
||||
Usability for different purposes
|
||||
- translation systems
|
||||
- software localization
|
||||
- dialogue systems
|
||||
- language teaching
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Not primarily code for a parser===
|
||||
|
||||
Often in NLP, a grammar is just high-level code for a parser.
|
||||
|
||||
But writing a grammar can be inadequate for parsing:
|
||||
- too much manual work
|
||||
- too inefficient
|
||||
- not robust
|
||||
- too ambiguous
|
||||
|
||||
|
||||
Moreover, a grammar fine-tuned for parsing may not be reusable
|
||||
- for generation
|
||||
- for specialized grammars
|
||||
- as library
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Grammar as language definition===
|
||||
|
||||
Linguistic ontology: **abstract syntax**
|
||||
|
||||
E.g. adjectival modification rule
|
||||
```
|
||||
AdjCN : AP -> CN -> CN ;
|
||||
```
|
||||
Rendering in different languages: **concrete syntax**
|
||||
```
|
||||
AdjCN (PositA even_A) (UseN number_N)
|
||||
|
||||
even number, even numbers
|
||||
|
||||
jämnt tal, jämna tal
|
||||
|
||||
nombre pair, nombres pairs
|
||||
```
|
||||
Abstract away from inflection, agreement, word order.
|
||||
|
||||
Resource grammars have generation perspective, rather than parsing
|
||||
- abstract syntax serves as a key to renderings in different languages
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Usability by non-linguists===
|
||||
|
||||
Division of labour: resource grammars hide linguistic details
|
||||
- ``AdjCN : AP -> CN -> CN`` hides agreement, word order,...
|
||||
|
||||
|
||||
Presentation: "school grammar" concepts, dictionary-like conventions
|
||||
```
|
||||
bird_N = reg2N "Vogel" "Vögel" masculine
|
||||
```
|
||||
API = Application Programmer's Interface
|
||||
|
||||
Documentation: ``gfdoc``
|
||||
- produces html from gf
|
||||
|
||||
|
||||
IDE = Interactive Development Environment (forthcoming)
|
||||
- library browser and syntax editor for grammar writing
|
||||
|
||||
|
||||
Example-based grammar writing
|
||||
```
|
||||
render Ita (parse Eng "you have k messages")
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Scientific interest===
|
||||
|
||||
Linguistics
|
||||
- definition of linguistic ontology
|
||||
- describing language on this level of abstraction
|
||||
- coping with different problems in different languages
|
||||
- sharing concrete-syntax code between languages
|
||||
- creating a resource for other NLP applications
|
||||
|
||||
|
||||
Computer science
|
||||
- datastructures for grammar rules
|
||||
- type systems for grammars
|
||||
- algorithms: parsing, generation, grammar compilation
|
||||
- domain-specific programming language (GF)
|
||||
- module system
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Background==
|
||||
|
||||
===History===
|
||||
|
||||
2002: v. 0.2
|
||||
- English, French, German, Swedish
|
||||
|
||||
|
||||
2003: v. 0.6
|
||||
- module system
|
||||
- added Finnish, Italian, Russian
|
||||
- used in KeY
|
||||
|
||||
|
||||
2005: v. 0.9
|
||||
- tenses
|
||||
- added Danish, Norwegian, Spanish; no German
|
||||
- used in WebALT
|
||||
|
||||
|
||||
2006: v. 1.0
|
||||
- approximate CLE coverage
|
||||
- reorganized module system and implementation
|
||||
- not yet (4/3/2006) for Danish and Russian
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Authors===
|
||||
|
||||
Janna Khegai (Russian modules, forthcoming),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Inger Andersson and Therese Söderberg (Spanish morphology),
|
||||
Ludmilla Bogavac (Russian morphology),
|
||||
Carlos Gonzalia (Spanish cardinals),
|
||||
Harald Hammarström (German morphology),
|
||||
Partik Jansson (Swedish cardinals),
|
||||
Aarne Ranta.
|
||||
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Hans-Joachim Daniels,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Wanjiku Ng'ang'a,
|
||||
Jordi Saludes.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Related work===
|
||||
|
||||
CLE (Core Language Engine,
|
||||
[Book 1992 http://mitpress.mit.edu/catalog/item/default.asp?tid=7739&ttype=2])
|
||||
- English, Swedish, French, Danish
|
||||
- uses Definita Clause Grammars, implementation in Prolog
|
||||
- coverage for the ATIS corpus,
|
||||
[Spoken Language Translator (2001) http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521770777]
|
||||
- grammar specialization via explanation-based learning
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Slightly less related work===
|
||||
|
||||
[LinGO Grammar Matrix http://www.delph-in.net/matrix/]
|
||||
- English, German, Japanese, Spanish, ...
|
||||
- uses HPSG, implementation in LKB
|
||||
- a check list for parallel grammar implementations
|
||||
|
||||
|
||||
[Pargram http://www2.parc.com/istl/groups/nltt/pargram/]
|
||||
- Aimed: Arabic, Chinese, English, French, German, Hungarian, Japanese,
|
||||
Malagasy, Norwegian, Turkish, Urdu, Vietnamese, and Welsh
|
||||
- uses LFG
|
||||
- one set of big grammars, transfer rules
|
||||
|
||||
|
||||
Rosetta Machine Translation ([Book 1994 http://citeseer.ist.psu.edu/181924.html])
|
||||
- Dutch, English, French
|
||||
- uses M-grammars, compositional translation inspired by Montague
|
||||
- compositional transfer rules
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Coverage==
|
||||
|
||||
===Languages===
|
||||
|
||||
The current GF Resource Project covers ten languages:
|
||||
- ``Dan``ish
|
||||
- ``Eng``lish
|
||||
- ``Fin``nish
|
||||
- ``Fre``nch
|
||||
- ``Ger``man
|
||||
- ``Ita``lian
|
||||
- ``Nor``wegian (bokmål)
|
||||
- ``Rus``sian
|
||||
- ``Spa``nish
|
||||
- ``Swe``dish
|
||||
|
||||
|
||||
In addition, parts of Arabic, Estonian, Latin, and Urdu
|
||||
|
||||
API 1.0 not yet implemented for Danish and Russian
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Morphology and lexicon===
|
||||
|
||||
Complete inflection engine
|
||||
- all word classes
|
||||
- all forms
|
||||
- all inflectional paradigms
|
||||
|
||||
|
||||
Basic lexicon
|
||||
- 100 structural words
|
||||
- 340 content words, mainly for testing
|
||||
- these include the 207 [Swadesh words http://en.wiktionary.org/wiki/Swadesh_List]
|
||||
|
||||
|
||||
It is more important to enable lexicon extensions than to
|
||||
provide a huge lexicon.
|
||||
- technical lexica can have very special words, which tend to be regular
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Syntactic structures===
|
||||
|
||||
Texts:
|
||||
sequences of phrases with punctuation
|
||||
|
||||
Phrases:
|
||||
declaratives, questions, imperatives, vocatives
|
||||
|
||||
Tense, mood, and polarity:
|
||||
present, past, future, conditional ; simultaneous, anterior ; positive, negative
|
||||
|
||||
Questions:
|
||||
yes-no, "wh" ; direct, indirect
|
||||
|
||||
Clauses:
|
||||
main, relative, embedded (subject, object, adverbial)
|
||||
|
||||
Verb phrases:
|
||||
intransitive, transitive, ditransitive, prepositional
|
||||
|
||||
Noun phrases:
|
||||
proper names, pronouns, determiners, possessives, cardinals and ordinals
|
||||
|
||||
Coordination:
|
||||
lists of sentences, noun phrases, adverbs, adjectival phrases
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Quantitative measures===
|
||||
|
||||
67 categories
|
||||
|
||||
150 abstract syntax combination rules
|
||||
|
||||
100 structural words
|
||||
|
||||
340 content words in a test lexicon
|
||||
|
||||
35 kLines of source code (4/3/2006):
|
||||
```
|
||||
abstract 1131
|
||||
english 2344
|
||||
german 2386
|
||||
finnish 3396
|
||||
norwegian 1257
|
||||
swedish 1465
|
||||
scandinavian 1023
|
||||
french 3246 -- Besch + Irreg + Morpho 2111
|
||||
italian 7797 -- Besch 6512
|
||||
spanish 7120 -- Besch 5877
|
||||
romance 1066
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Structure of the API==
|
||||
|
||||
===Language-independent ground API===
|
||||
|
||||
[Lang.png]
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===The structure of a text sentence===
|
||||
|
||||
```
|
||||
John walks.
|
||||
|
||||
TFullStop : Phr -> Text -> Text | TQuestMark, TExclMark
|
||||
(PhrUtt : PConj -> Utt -> Voc -> Phr | PhrYes, PhrNo, ...
|
||||
NoPConj | but_PConj, ...
|
||||
(UttS : S -> Utt | UttQS, UttImp, UttNP, ...
|
||||
(UseCl : Tense -> Anter -> Pol -> Cl -> S
|
||||
TPres
|
||||
ASimul
|
||||
PPos
|
||||
(PredVP : NP -> VP -> Cl | ImpersNP, ExistNP, ...
|
||||
(UsePN : PN -> NP
|
||||
john_PN)
|
||||
(UseV : V -> VP | ComplV2, UseComp, ...
|
||||
walk_V))))
|
||||
NoVoc) | VocNP, please_Voc, ...
|
||||
TEmpty
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The structure in the syntax editor===
|
||||
|
||||
[editor.png]
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Language-dependent paradigm modules===
|
||||
|
||||
====Regular paradigms====
|
||||
|
||||
Every language implements these regular patterns that take
|
||||
"dictionary forms" as arguments.
|
||||
```
|
||||
regN : Str -> N
|
||||
regA : Str -> A
|
||||
regV : Str -> V
|
||||
```
|
||||
Their usefulness varies. For instance, they
|
||||
all are quite good in Finnish and English.
|
||||
In Swedish, less so:
|
||||
```
|
||||
regN "val" ---> val, valen, valar, valarna
|
||||
```
|
||||
Initializing a lexicon with ``regX`` for every entry is
|
||||
usually a good starting point in grammar development.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
====Regular paradigms====
|
||||
|
||||
In Swedish, giving the gender of ``N`` improves a lot
|
||||
```
|
||||
regGenN "val" neutrum ---> val, valet, val, valen
|
||||
```
|
||||
|
||||
There are also special constructs taking other forms:
|
||||
```
|
||||
mk2N : (nyckel,nycklar : Str) -> N
|
||||
|
||||
mk1N : (bilarna : Str) -> N
|
||||
|
||||
irregV : (dricka, drack, druckit : Str) -> V
|
||||
```
|
||||
|
||||
Regular verbs are actually implemented the
|
||||
[Lexin http://lexin.nada.kth.se/sve-sve.shtml] way
|
||||
```
|
||||
regV : (talar : Str) -> V
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
====Worst-case paradigms====
|
||||
|
||||
To cover all situations, worst-case paradigms are given. E.g. Swedish
|
||||
```
|
||||
mkN : (apa,apan,apor,aporna : Str) -> N
|
||||
|
||||
mkA : (liten, litet, lilla, små, mindre, minst, minsta : Str) -> A
|
||||
|
||||
mkV : (supa,super,sup,söp,supit,supen : Str) -> V
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
====Irregular words====
|
||||
|
||||
Iregular words in ``IrregX``, e.g. Swedish:
|
||||
```
|
||||
draga_V : V =
|
||||
mkV
|
||||
(variants { "dra" ; "draga"})
|
||||
(variants { "drar" ; "drager"})
|
||||
(variants { "dra" ; "drag" })
|
||||
"drog"
|
||||
"dragit"
|
||||
"dragen" ;
|
||||
```
|
||||
Goal: eliminate the user's need of worst-case functions.
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Language-dependent syntax extensions===
|
||||
|
||||
Syntactic structures that are not shared by all languages.
|
||||
|
||||
Alternative (and often more idiomatic) ways to say what is already covered by the API.
|
||||
|
||||
Not implemented yet.
|
||||
|
||||
Candidates:
|
||||
- Norwegian post-possessives: ``bilen min``
|
||||
- French question forms: ``est-ce que tu dors ?``
|
||||
- Romance simple past tenses
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Special-purpose APIs===
|
||||
|
||||
Mathematical
|
||||
|
||||
Multimodal
|
||||
|
||||
Present
|
||||
|
||||
Minimal
|
||||
|
||||
Shallow
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===How to use the resource as top-level grammar===
|
||||
|
||||
===Compiling===
|
||||
|
||||
It is a good idea to compile the library, so that it can be opened faster
|
||||
```
|
||||
GF/lib/resource-1.0% make
|
||||
|
||||
writes GF/lib/alltenses
|
||||
GF/lib/present
|
||||
GF/lib/resource-1.0/langs.gfcm
|
||||
```
|
||||
If you don't intend to change the library, you never need to process the source
|
||||
files again. Just do some of
|
||||
```
|
||||
gf -nocf langs.gfcm -- all 8 languages
|
||||
|
||||
gf -nocf -path=alltenses:prelude alltenses/LangSwe.gfc -- Swedish only
|
||||
|
||||
gf -nocf -path=present:prelude present/LangSwe.gfc -- Swedish in present tense only
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Parsing===
|
||||
|
||||
The default parser does not work! (It is obsolete anyway.)
|
||||
|
||||
The MCFG parser (the new standard) works in theory, but can
|
||||
in practice be too slow to build.
|
||||
|
||||
But it does work in some languages, after waiting appr. 20 seconds
|
||||
```
|
||||
p -mcfg -lang=LangEng -cat=S "I would see her"
|
||||
|
||||
p -mcfg -lang=LangSwe -cat=S "jag skulle se henne"
|
||||
```
|
||||
Parsing in ``present/`` versions is quicker.
|
||||
|
||||
Remedies:
|
||||
- write application grammars for parsing
|
||||
- use treebank lookup instead
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Treebank generation===
|
||||
|
||||
Multilingual treebank entry = tree + linearizations
|
||||
|
||||
Some examples on treebank generation, assuming ``langs.gfcm``
|
||||
```
|
||||
gr -cat=S -number=10 -cf | tb -- 10 random S
|
||||
|
||||
gt -cat=Phr -depth=4 | tb -xml | wf ex.xml -- all Phr to depth 4, into file ex.xml
|
||||
```
|
||||
Regression testing
|
||||
```
|
||||
rf ex.xml | tb -c -- read treebank from file and compare to present grammars
|
||||
```
|
||||
Updating a treebank
|
||||
```
|
||||
rf old.xml | tb -trees | tb -xml | wf new.xml -- read old from file, write new to file
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The multilingual treebank format===
|
||||
|
||||
Tree + linearizations
|
||||
```
|
||||
> gr -cat=Cl | tb
|
||||
PredVP (UsePron they_Pron) (PassV2 seek_V2)
|
||||
They are sought
|
||||
Elles sont cherchées
|
||||
Son buscadas
|
||||
Vengono cercate
|
||||
De blir sökta
|
||||
De blir lette
|
||||
Sie werden gesucht
|
||||
Heidät etsitään
|
||||
```
|
||||
These can also be wrapped in XML tags (``tb -xml``)
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Treebank-based parsing===
|
||||
|
||||
Brute-force method that helps if real parsing is more expensive.
|
||||
```
|
||||
make treebank -- make treebank with all languages
|
||||
|
||||
gf -treebank langs.xml -- start GF by reading the treebank
|
||||
|
||||
> ut -strings -treebank=LangIta -- show all Ita strings
|
||||
|
||||
> ut -treebank=LangIta -raw "Quello non si romperebbe" -- look up a string
|
||||
|
||||
> i -nocf langs.gfcm -- read grammar to be able to linearize
|
||||
|
||||
> ut -treebank=LangIta "Quello non si romperebbe" | l -multi -- translate to all
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Morphology===
|
||||
|
||||
Use morphological analyser
|
||||
```
|
||||
gf -nocf -retain -path=alltenses:prelude alltenses/LangSwe.gf
|
||||
> ma "jag kan inte höra vad du säger"
|
||||
```
|
||||
|
||||
Try out a morphology quiz
|
||||
```
|
||||
> mq -cat=V
|
||||
```
|
||||
|
||||
Try out inflection patterns
|
||||
```
|
||||
gf -retain -path=alltenses:prelude alltenses/ParadigmsSwe.gfr
|
||||
> cc regV "lyser"
|
||||
```
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Syntax editing===
|
||||
|
||||
The simplest way to start editing with all grammars is
|
||||
```
|
||||
gfeditor langs.gfcm
|
||||
```
|
||||
The forthcoming IDE will extend the syntax editor with
|
||||
a ``Paradigms`` file browser and a control on what
|
||||
parts of an application grammar remain to be implemented.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Efficient parsing via application grammar===
|
||||
|
||||
Get rid of discontinuous constituents (in particular, ``VP``)
|
||||
|
||||
Example: [``mathematical/Predication`` gfdoc/Predication.html]:
|
||||
```
|
||||
predV2 : V2 -> NP -> NP -> Cl
|
||||
```
|
||||
instead of ``PredVP np (ComplV2 v2 np')``
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==How to use as library==
|
||||
|
||||
===Specialization through parametrized modules===
|
||||
|
||||
The application grammar is implemented with reference to
|
||||
the resource API
|
||||
|
||||
Individual languages are instantiations
|
||||
|
||||
Example: [tram ../../../examples/tram/TramI.gf]
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===Compile-time transfer===
|
||||
|
||||
Instead of parametrized modules:
|
||||
|
||||
select resource functions differently for different languages
|
||||
|
||||
Example: imperative vs. infinitive in mathematical exercises
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===A natural division into modules===
|
||||
|
||||
Lexicon in language-dependent moduls
|
||||
|
||||
Combination rules in a parametrized module
|
||||
|
||||
#NEW
|
||||
|
||||
===Example-based grammar writing===
|
||||
|
||||
Example: [animal ../../../examples/animal/QuestionsI.gfe]
|
||||
```
|
||||
--# -resource=present/LangEng.gf
|
||||
--# -path=.:present:prelude
|
||||
|
||||
-- to compile: gf -examples QuestionsI.gfe
|
||||
|
||||
incomplete concrete QuestionsI of Questions = open Lang in {
|
||||
lincat
|
||||
Phrase = Phr ;
|
||||
Entity = N ;
|
||||
Action = V2 ;
|
||||
lin
|
||||
Who love_V2 man_N = in Phr "who loves men" ;
|
||||
Whom man_N love_V2 = in Phr "whom does the man love" ;
|
||||
Answer woman_N love_V2 man_N = in Phr "the woman loves men" ;
|
||||
}
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
==How to implement a new language==
|
||||
|
||||
See [Resource-HOWTO Resource-HOWTO.html]
|
||||
|
||||
==Ordinary modules==
|
||||
|
||||
Write a concrete syntax module for each abstract module in the API
|
||||
|
||||
Write a ``Paradigms`` module
|
||||
|
||||
Examples: English, Finnish, German, Russian
|
||||
|
||||
#NEW
|
||||
|
||||
==Parametrized modules==
|
||||
|
||||
Examples: Romance (French, Italian, Spanish), Scandinavian (Danish, Norwegian, Swedish)
|
||||
|
||||
Write a ``Diff`` interface for a family of languages
|
||||
|
||||
Write concrete syntaxes as functors opening the interface
|
||||
|
||||
Write separate ``Paradigms`` modules for each language
|
||||
|
||||
Advantages:
|
||||
- easier maintenance of library
|
||||
- insights into language families
|
||||
|
||||
|
||||
Problems:
|
||||
- more abstract thinking required
|
||||
- individual grammars may not come out optimal in elegance and efficiency
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===The core API===
|
||||
|
||||
Everything else is variations of this
|
||||
```
|
||||
cat
|
||||
Cl ; -- clause
|
||||
VP ; -- verb phrase
|
||||
V2 ; -- two-place verb
|
||||
NP ; -- noun phrase
|
||||
CN ; -- common noun
|
||||
Det ; -- determiner
|
||||
AP ; -- adjectival phrase
|
||||
|
||||
fun
|
||||
PredVP : NP -> VP -> Cl ; -- predication
|
||||
ComplV2 : V2 -> NP -> VP ; -- complementization
|
||||
DetCN : Det -> CN -> NP ; -- determination
|
||||
ModCN : AP -> CN -> CN ; -- modification
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The core API in Latin: parameters===
|
||||
|
||||
This [toy Latin grammar latin.gf] shows in a nutshell how the core
|
||||
can be implemented.
|
||||
```
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Person = P1 | P2 | P3 ;
|
||||
Tense = Pres | Past ;
|
||||
Polarity = Pos | Neg ;
|
||||
Case = Nom | Acc | Dat ;
|
||||
Gender = Masc | Fem | Neutr ;
|
||||
oper
|
||||
Agr = {g : Gender ; n : Number ; p : Person} ; -- agreement features
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The core API in Latin: linearization types===
|
||||
|
||||
```
|
||||
lincat
|
||||
Cl = {
|
||||
s : Tense => Polarity => Str
|
||||
} ;
|
||||
VP = {
|
||||
verb : Tense => Polarity => Agr => Str ; -- finite verb
|
||||
neg : Polarity => Str ; -- negation
|
||||
compl : Agr => Str -- complement
|
||||
} ;
|
||||
V2 = {
|
||||
s : Tense => Number => Person => Str ;
|
||||
c : Case -- complement case
|
||||
} ;
|
||||
NP = {
|
||||
s : Case => Str ;
|
||||
a : Agr -- agreement features
|
||||
} ;
|
||||
CN = {
|
||||
s : Number => Case => Str ;
|
||||
g : Gender
|
||||
} ;
|
||||
Det = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number
|
||||
} ;
|
||||
AP = {
|
||||
s : Gender => Number => Case => Str
|
||||
} ;
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The core API in Latin: predication and complementization===
|
||||
|
||||
```
|
||||
lin
|
||||
PredVP np vp = {
|
||||
s = \\t,p =>
|
||||
let
|
||||
agr = np.a ;
|
||||
subject = np.s ! Nom ;
|
||||
object = vp.compl ! agr ;
|
||||
verb = vp.neg ! p ++ vp.verb ! t ! p ! agr
|
||||
in
|
||||
subject ++ object ++ verb
|
||||
} ;
|
||||
|
||||
ComplV2 v np = {
|
||||
verb = \\t,p,a => v.s ! t ! a.n ! a.p ;
|
||||
compl = \\_ => np.s ! v.c ;
|
||||
neg = table {Pos => [] ; Neg => "non"}
|
||||
} ;
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
===The core API in Latin: determination and modification===
|
||||
|
||||
```
|
||||
DetCN det cn =
|
||||
let
|
||||
g = cn.g ;
|
||||
n = det.n
|
||||
in {
|
||||
s = \\c => det.s ! g ! c ++ cn.s ! n ! c ;
|
||||
a = {g = g ; n = n ; p = P3}
|
||||
} ;
|
||||
|
||||
ModCN ap cn =
|
||||
let
|
||||
g = cn.g
|
||||
in {
|
||||
s = \\n,c => cn.s ! n ! c ++ ap.s ! g ! n ! c ;
|
||||
g = g
|
||||
} ;
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
===How to proceed===
|
||||
|
||||
+ put up a directory with dummy modules by copying from e.g. English and
|
||||
commenting out the contents
|
||||
|
||||
+ so you will have a compilable ``LangX`` all the time
|
||||
|
||||
+ start with nouns and their inflection
|
||||
|
||||
+ proceed to verbs and their inflection
|
||||
|
||||
+ add some noun phrases
|
||||
|
||||
+ implement predication
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==How to extend the API==
|
||||
|
||||
Extend old modules or add a new one?
|
||||
|
||||
Usually better to start a new one: then you don't have to implement it
|
||||
for all languages at once.
|
||||
|
||||
Exception: if you are working with a language-specific API extension,
|
||||
you can work directly in that module.
|
||||
BIN
lib/resource/doc/editor.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
69
lib/resource/doc/gfdoc/Adjective.html
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Adjective: Adjectives and Adjectival Phrases</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Adjective: Adjectives and Adjectival Phrases</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-05-31 14:17:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Adjective = Cat ** {
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The principal ways of forming an adjectival phrase are
|
||||
positive, comparative, relational, reflexive-relational, and
|
||||
elliptic-relational.
|
||||
(The superlative use is covered in <A HREF="Noun.html">Noun</A>.<CODE>SuperlA</CODE>.)
|
||||
</P>
|
||||
<PRE>
|
||||
PositA : A -> AP ; -- warm
|
||||
ComparA : A -> NP -> AP ; -- warmer than Spain
|
||||
ComplA2 : A2 -> NP -> AP ; -- divisible by 2
|
||||
ReflA2 : A2 -> AP ; -- divisible by itself
|
||||
UseA2 : A2 -> A ; -- divisible
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Sentence and question complements defined for all adjectival
|
||||
phrases, although the semantics is only clear for some adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
SentAP : AP -> SC -> AP ; -- great that she won, uncertain if she did
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
An adjectival phrase can be modified by an <B>adadjective</B>, such as <I>very</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
AdAP : AdA -> AP -> AP ; -- very uncertain
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The formation of adverbs from adjective (e.g. <I>quickly</I>) is covered
|
||||
by <A HREF="Adverb.html">Adverb</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Adjective.txt -->
|
||||
</BODY></HTML>
|
||||
74
lib/resource/doc/gfdoc/Adverb.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Adverb: Adverbs and Adverbial Phrases</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Adverb: Adverbs and Adverbial Phrases</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-15 09:19:39 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Adverb = Cat ** {
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The two main ways of forming adverbs are from adjectives and by
|
||||
prepositions from noun phrases.
|
||||
</P>
|
||||
<PRE>
|
||||
PositAdvAdj : A -> Adv ; -- quickly
|
||||
PrepNP : Prep -> NP -> Adv ; -- in the house
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Comparative adverbs have a noun phrase or a sentence as object of
|
||||
comparison.
|
||||
</P>
|
||||
<PRE>
|
||||
ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more quickly than John
|
||||
ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more quickly than he runs
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
AdAdv : AdA -> Adv -> Adv ; -- very quickly
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Subordinate clauses can function as adverbs.
|
||||
</P>
|
||||
<PRE>
|
||||
SubjS : Subj -> S -> Adv ; -- when he arrives
|
||||
AdvSC : SC -> Adv ; -- that he arrives ---- REMOVE?
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Comparison adverbs also work as numeral adverbs.
|
||||
</P>
|
||||
<PRE>
|
||||
AdnCAdv : CAdv -> AdN ; -- more (than five)
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Adverb.txt -->
|
||||
</BODY></HTML>
|
||||
264
lib/resource/doc/gfdoc/Basic.html
Normal file
@@ -0,0 +1,264 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> A Basic Lexicon</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> A Basic Lexicon</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: </I><BR>
|
||||
Last update: Wed Jan 25 10:50:12 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">A Basic Lexicon</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<A NAME="toc1"></A>
|
||||
<H1>A Basic Lexicon</H1>
|
||||
<P>
|
||||
This files gives a list of words whose purpose is to test the GF
|
||||
resource grammar. It covers all lexical categories of <A HREF="Cat.html">Cat</A>.
|
||||
By containing some of the most common words,
|
||||
it is aimed to cover, with high probability, all morphological
|
||||
patterns in the different languages.
|
||||
Using this lexicon for translation is not recommended. The linearizations
|
||||
of the words in different languages are not guaranteed to be translation
|
||||
equivalents.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Basic = Cat ** {
|
||||
fun
|
||||
add_V3 : V3 ;
|
||||
airplane_N : N ;
|
||||
already_Adv : Adv ;
|
||||
answer_V2S : V2 ;
|
||||
apartment_N : N ;
|
||||
apple_N : N ;
|
||||
art_N : N ;
|
||||
ask_V2Q : V2 ;
|
||||
baby_N : N ;
|
||||
bad_A : A ;
|
||||
bank_N : N ;
|
||||
beautiful_A : A ;
|
||||
become_VA : VA ;
|
||||
beer_N : N ;
|
||||
beg_V2V : V2 ;
|
||||
big_A : A ;
|
||||
bike_N : N ;
|
||||
bird_N : N ;
|
||||
black_A : A ;
|
||||
blue_A : A ;
|
||||
boat_N : N ;
|
||||
book_N : N ;
|
||||
boot_N : N ;
|
||||
boss_N : N ;
|
||||
boy_N : N ;
|
||||
bread_N : N ;
|
||||
break_V2 : V2 ;
|
||||
broad_A : A ;
|
||||
brother_N2 : N2 ;
|
||||
brown_A : A ;
|
||||
butter_N : N ;
|
||||
buy_V2 : V2 ;
|
||||
camera_N : N ;
|
||||
cap_N : N ;
|
||||
car_N : N ;
|
||||
carpet_N : N ;
|
||||
cat_N : N ;
|
||||
ceiling_N : N ;
|
||||
chair_N : N ;
|
||||
cheese_N : N ;
|
||||
child_N : N ;
|
||||
church_N : N ;
|
||||
city_N : N ;
|
||||
clean_A : A ;
|
||||
clever_A : A ;
|
||||
close_V2 : V2 ;
|
||||
coat_N : N ;
|
||||
cold_A : A ;
|
||||
come_V : V ;
|
||||
computer_N : N ;
|
||||
country_N : N ;
|
||||
cousin_N : N ;
|
||||
cow_N : N ;
|
||||
die_V : V ;
|
||||
dirty_A : A ;
|
||||
distance_N3 : N3 ;
|
||||
do_V2 : V2 ;
|
||||
doctor_N : N ;
|
||||
dog_N : N ;
|
||||
door_N : N ;
|
||||
drink_V2 : V2 ;
|
||||
easy_A2V : A2 ;
|
||||
eat_V2 : V2 ;
|
||||
enemy_N : N ;
|
||||
empty_A : A ;
|
||||
factory_N : N ;
|
||||
father_N2 : N2 ;
|
||||
fear_VS : VS ;
|
||||
find_V2 : V2 ;
|
||||
fish_N : N ;
|
||||
floor_N : N ;
|
||||
forget_V2 : V2 ;
|
||||
fridge_N : N ;
|
||||
friend_N : N ;
|
||||
fruit_N : N ;
|
||||
fun_AV : A ;
|
||||
garden_N : N ;
|
||||
girl_N : N ;
|
||||
glove_N : N ;
|
||||
gold_N : N ;
|
||||
good_A : A ;
|
||||
go_V : V ;
|
||||
green_A : A ;
|
||||
harbour_N : N ;
|
||||
hate_V2 : V2 ;
|
||||
hat_N : N ;
|
||||
have_V2 : V2 ;
|
||||
hear_V2 : V2 ;
|
||||
hill_N : N ;
|
||||
hope_VS : VS ;
|
||||
horse_N : N ;
|
||||
hot_A : A ;
|
||||
house_N : N ;
|
||||
important_A : A ;
|
||||
industry_N : N ;
|
||||
iron_N : N ;
|
||||
jump_V : V ;
|
||||
king_N : N ;
|
||||
know_V2 : V2 ;
|
||||
lake_N : N ;
|
||||
lamp_N : N ;
|
||||
learn_V2 : V2 ;
|
||||
leather_N : N ;
|
||||
leave_V2 : V2 ;
|
||||
like_V2 : V2 ;
|
||||
listen_V2 : V2 ;
|
||||
live_V : V ;
|
||||
long_A : A ;
|
||||
lose_V2 : V2 ;
|
||||
love_N : N ;
|
||||
love_V2 : V2 ;
|
||||
man_N : N ;
|
||||
married_A2 : A2 ;
|
||||
meat_N : N ;
|
||||
milk_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
mountain_N : N ;
|
||||
music_N : N ;
|
||||
narrow_A : A ;
|
||||
new_A : A ;
|
||||
newspaper_N : N ;
|
||||
now_Adv : Adv ;
|
||||
number_N : N ;
|
||||
oil_N : N ;
|
||||
old_A : A ;
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
paris_PN : PN ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
planet_N : N ;
|
||||
plastic_N : N ;
|
||||
play_V2 : V2 ;
|
||||
policeman_N : N ;
|
||||
priest_N : N ;
|
||||
probable_AS : A ;
|
||||
put_V2 : V2 ;
|
||||
queen_N : N ;
|
||||
radio_N : N ;
|
||||
rain_V0 : V ;
|
||||
read_V2 : V2 ;
|
||||
red_A : A ;
|
||||
religion_N : N ;
|
||||
restaurant_N : N ;
|
||||
river_N : N ;
|
||||
rock_N : N ;
|
||||
roof_N : N ;
|
||||
rubber_N : N ;
|
||||
run_V : V ;
|
||||
say_VS : VS ;
|
||||
school_N : N ;
|
||||
science_N : N ;
|
||||
sea_N : N ;
|
||||
seek_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
sell_V3 : V3 ;
|
||||
send_V3 : V3 ;
|
||||
sheep_N : N ;
|
||||
ship_N : N ;
|
||||
shirt_N : N ;
|
||||
shoe_N : N ;
|
||||
shop_N : N ;
|
||||
short_A : A ;
|
||||
silver_N : N ;
|
||||
sister_N : N ;
|
||||
sleep_V : V ;
|
||||
small_A : A ;
|
||||
snake_N : N ;
|
||||
sock_N : N ;
|
||||
song_N : N ;
|
||||
speak_V2 : V2 ;
|
||||
star_N : N ;
|
||||
steel_N : N ;
|
||||
stone_N : N ;
|
||||
stop_V : V ;
|
||||
stove_N : N ;
|
||||
student_N : N ;
|
||||
stupid_A : A ;
|
||||
sun_N : N ;
|
||||
switch8off_V2 : V2 ;
|
||||
switch8on_V2 : V2 ;
|
||||
table_N : N ;
|
||||
talk_V3 : V3 ;
|
||||
teacher_N : N ;
|
||||
teach_V2 : V2 ;
|
||||
television_N : N ;
|
||||
thick_A : A ;
|
||||
thin_A : A ;
|
||||
train_N : N ;
|
||||
travel_V : V ;
|
||||
tree_N : N ;
|
||||
---- trousers_N : N ;
|
||||
ugly_A : A ;
|
||||
understand_V2 : V2 ;
|
||||
university_N : N ;
|
||||
village_N : N ;
|
||||
wait_V2 : V2 ;
|
||||
walk_V : V ;
|
||||
warm_A : A ;
|
||||
war_N : N ;
|
||||
watch_V2 : V2 ;
|
||||
water_N : N ;
|
||||
white_A : A ;
|
||||
window_N : N ;
|
||||
wine_N : N ;
|
||||
win_V2 : V2 ;
|
||||
woman_N : N ;
|
||||
wonder_VQ : VQ ;
|
||||
wood_N : N ;
|
||||
write_V2 : V2 ;
|
||||
yellow_A : A ;
|
||||
young_A : A ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Basic.txt -->
|
||||
</BODY></HTML>
|
||||
195
lib/resource/doc/gfdoc/Cat.html
Normal file
@@ -0,0 +1,195 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Cat: the Category System</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Cat: the Category System</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 11:21:49 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Sentences and clauses</A>
|
||||
<LI><A HREF="#toc2">Questions and interrogatives</A>
|
||||
<LI><A HREF="#toc3">Relative clauses and pronouns</A>
|
||||
<LI><A HREF="#toc4">Verb phrases</A>
|
||||
<LI><A HREF="#toc5">Adjectival phrases</A>
|
||||
<LI><A HREF="#toc6">Nouns and noun phrases</A>
|
||||
<LI><A HREF="#toc7">Numerals</A>
|
||||
<LI><A HREF="#toc8">Structural words</A>
|
||||
<LI><A HREF="#toc9">Words of open classes</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
The category system is central to the library in the sense
|
||||
that the other modules (<CODE>Adjective</CODE>, <CODE>Adverb</CODE>, <CODE>Noun</CODE>, <CODE>Verb</CODE> etc)
|
||||
communicate through it. This means that a e.g. a function using
|
||||
<CODE>NP</CODE>s in <CODE>Verb</CODE> need not know how <CODE>NP</CODE>s are constructed in <CODE>Noun</CODE>:
|
||||
it is enough that both <CODE>Verb</CODE> and <CODE>Noun</CODE> use the same type <CODE>NP</CODE>,
|
||||
which is given here in <CODE>Cat</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
Some categories are inherited from <A HREF="Common.html"><CODE>Common</CODE></A>.
|
||||
The reason they are defined there is that they have the same
|
||||
implementation in all languages in the resource (typically,
|
||||
just a string). These categories are
|
||||
<CODE>AdA, AdN, AdV, Adv, Ant, CAdv, IAdv, PConj, Phr</CODE>,
|
||||
<CODE>Pol, SC, Tense, Text, Utt, Voc</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
Moreover, the list categories <CODE>ListAdv, ListAP, ListNP, ListS</CODE>
|
||||
are defined on <CODE>Conjunction</CODE> and only used locally there.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Cat = Common ** {
|
||||
|
||||
cat
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Sentences and clauses</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Sentence.html">Sentence</A>, and also in
|
||||
<A HREF="Idiom.html">Idiom</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
S ; -- declarative sentence e.g. "she lived here"
|
||||
QS ; -- question e.g. "where did she live"
|
||||
RS ; -- relative e.g. "in which she lived"
|
||||
Cl ; -- declarative clause, with all tenses e.g. "she looks at this"
|
||||
Slash ; -- clause missing NP (S/NP in GPSG) e.g. "she looks at"
|
||||
Imp ; -- imperative e.g. "look at this"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Questions and interrogatives</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Question.html">Question</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
QCl ; -- question clause, with all tenses e.g. "why does she walk"
|
||||
IP ; -- interrogative pronoun e.g. "who"
|
||||
IComp ; -- interrogative complement of copula e.g. "where"
|
||||
IDet ; -- interrogative determiner e.g. "which"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Relative clauses and pronouns</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Relative.html">Relative</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
RCl ; -- relative clause, with all tenses e.g. "in which she lives"
|
||||
RP ; -- relative pronoun e.g. "in which"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Verb phrases</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Verb.html">Verb</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
VP ; -- verb phrase e.g. "is very warm"
|
||||
Comp ; -- complement of copula, such as AP e.g. "very warm"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Adjectival phrases</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Adjective.html">Adjective</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
AP ; -- adjectival phrase e.g. "very warm"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Nouns and noun phrases</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Noun.html">Noun</A>.
|
||||
Many atomic noun phrases e.g. <I>everybody</I>
|
||||
are constructed in <A HREF="Structural.html">Structural</A>.
|
||||
The determiner structure is
|
||||
</P>
|
||||
<PRE>
|
||||
Predet (QuantSg | QuantPl Num) Ord
|
||||
</PRE>
|
||||
<P>
|
||||
as defined in <A HREF="Noun.html">Noun</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
CN ; -- common noun (without determiner) e.g. "red house"
|
||||
NP ; -- noun phrase (subject or object) e.g. "the red house"
|
||||
Pron ; -- personal pronoun e.g. "she"
|
||||
Det ; -- determiner phrase e.g. "those seven"
|
||||
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
||||
QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
||||
QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
||||
Quant ; -- quantifier with both sg and pl e.g. "this/these"
|
||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Numerals</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Numeral.html">Numeral</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
Numeral;-- cardinal or ordinal, e.g. "five/fifth"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H2>Structural words</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Structural.html">Structural</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
Conj ; -- conjunction, e.g. "and"
|
||||
DConj ; -- distributed conj. e.g. "both - and"
|
||||
Subj ; -- subjunction, e.g. "if"
|
||||
Prep ; -- preposition, or just case e.g. "in"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Words of open classes</H2>
|
||||
<P>
|
||||
These are constructed in <A HREF="Lexicon.html">Lexicon</A> and in
|
||||
additional lexicon modules.
|
||||
</P>
|
||||
<PRE>
|
||||
V ; -- one-place verb e.g. "sleep"
|
||||
V2 ; -- two-place verb e.g. "love"
|
||||
V3 ; -- three-place verb e.g. "show"
|
||||
VV ; -- verb-phrase-complement verb e.g. "want"
|
||||
VS ; -- sentence-complement verb e.g. "claim"
|
||||
VQ ; -- question-complement verb e.g. "ask"
|
||||
VA ; -- adjective-complement verb e.g. "look"
|
||||
V2A ; -- verb with NP and AP complement e.g. "paint"
|
||||
|
||||
A ; -- one-place adjective e.g. "warm"
|
||||
A2 ; -- two-place adjective e.g. "divisible"
|
||||
|
||||
N ; -- common noun e.g. "house"
|
||||
N2 ; -- relational noun e.g. "son"
|
||||
N3 ; -- three-place relational noun e.g. "connection"
|
||||
PN ; -- proper name e.g. "Paris"
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Cat.txt -->
|
||||
</BODY></HTML>
|
||||
140
lib/resource/doc/gfdoc/Combinators.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Combinators: a High-Level Syntax API</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Combinators: a High-Level Syntax API</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-05-31 11:49:38 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Predication</A>
|
||||
<LI><A HREF="#toc2">Function application</A>
|
||||
<LI><A HREF="#toc3">Coordination</A>
|
||||
<LI><A HREF="#toc4">Modification</A>
|
||||
<LI><A HREF="#toc5">Negation</A>
|
||||
<LI><A HREF="#toc6">Text append</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This module defines some <I>grammatical functions</I> that give shortcuts to
|
||||
typical constructions. <A HREF="Constructors.html"><CODE>Constructors</CODE></A> and the
|
||||
language-specific <CODE>Paradigms</CODE> modules are usually needed
|
||||
to construct arguments of these functions.
|
||||
</P>
|
||||
<PRE>
|
||||
incomplete resource Combinators = open Grammar in {
|
||||
|
||||
oper
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Predication</H2>
|
||||
<PRE>
|
||||
pred : overload {
|
||||
pred : V -> NP -> Cl ; -- x converges
|
||||
pred : V2 -> NP -> NP -> Cl ; -- x intersects y
|
||||
pred : V3 -> NP -> NP -> NP -> Cl ; -- x intersects y at z
|
||||
pred : V -> NP -> NP -> Cl ; -- x and y intersect
|
||||
pred : A -> NP -> Cl ; -- x is even
|
||||
pred : A2 -> NP -> NP -> Cl ; -- x is divisible by y
|
||||
pred : A -> NP -> NP -> Cl ; -- x and y are equal
|
||||
pred : N -> NP -> Cl ; -- x is a maximum
|
||||
pred : CN -> NP -> Cl ; -- x is a local maximum
|
||||
pred : NP -> NP -> Cl ; -- x is the neutral element
|
||||
pred : N -> NP -> NP -> Cl ; -- x and y are inverses
|
||||
pred : Adv -> NP -> Cl ; -- x is in scope
|
||||
pred : Prep -> NP -> NP -> Cl -- x is outside y
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Function application</H2>
|
||||
<PRE>
|
||||
app : overload {
|
||||
app : N -> NP ;
|
||||
app : N2 -> NP -> NP ;
|
||||
app : N3 -> NP -> NP -> NP ;
|
||||
app : N2 -> NP -> NP -> NP ;
|
||||
app : N2 -> N -> CN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Coordination</H2>
|
||||
<PRE>
|
||||
coord : overload {
|
||||
coord : Conj -> Adv -> Adv -> Adv ;
|
||||
coord : Conj -> AP -> AP -> AP ;
|
||||
coord : Conj -> NP -> NP -> NP ;
|
||||
coord : Conj -> S -> S -> S ;
|
||||
coord : DConj -> Adv -> Adv -> Adv ;
|
||||
coord : DConj -> AP -> AP -> AP ;
|
||||
coord : DConj -> NP -> NP -> NP ;
|
||||
coord : DConj -> S -> S -> S ;
|
||||
coord : Conj -> ListAdv -> Adv ;
|
||||
coord : Conj -> ListAP -> AP ;
|
||||
coord : Conj -> ListNP -> NP ;
|
||||
coord : Conj -> ListS -> S ;
|
||||
coord : DConj -> ListAdv -> Adv ;
|
||||
coord : DConj -> ListAP -> AP ;
|
||||
coord : DConj -> ListNP -> NP ;
|
||||
coord : DConj -> ListS -> S
|
||||
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Modification</H2>
|
||||
<PRE>
|
||||
mod : overload {
|
||||
mod : A -> N -> CN ;
|
||||
mod : AP -> CN -> CN ;
|
||||
mod : AdA -> A -> AP ;
|
||||
mod : Det -> N -> NP ;
|
||||
mod : Det -> CN -> NP ;
|
||||
mod : Quant -> N -> NP ;
|
||||
mod : Quant -> CN -> NP ;
|
||||
mod : Predet -> N -> NP ;
|
||||
mod : Numeral -> N -> NP
|
||||
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Negation</H2>
|
||||
<PRE>
|
||||
neg : overload {
|
||||
neg : Imp -> Utt ;
|
||||
neg : Cl -> S ;
|
||||
neg : QCl -> QS ;
|
||||
neg : RCl -> RS
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Text append</H2>
|
||||
<P>
|
||||
This is not in ground API, because it would destroy parsing.
|
||||
</P>
|
||||
<PRE>
|
||||
appendText : Text -> Text -> Text ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc api/Combinators.txt -->
|
||||
</BODY></HTML>
|
||||
107
lib/resource/doc/gfdoc/Common.html
Normal file
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Common: Structures with Common Implementations.</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Common: Structures with Common Implementations.</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-04 11:06:11 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Top-level units</A>
|
||||
<LI><A HREF="#toc2">Adverbs</A>
|
||||
<LI><A HREF="#toc3">Tense, polarity, and anteriority</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This module defines the categories that uniformly have the linearization
|
||||
<CODE>{s : Str}</CODE> in all languages.
|
||||
Moreover, this module defines the abstract parameters of tense, polarity, and
|
||||
anteriority, which are used in <A HREF="Phrase.html"><CODE>Phrase</CODE></A> to generate different
|
||||
forms of sentences. Together they give 4 x 2 x 2 = 16 sentence forms.
|
||||
These tenses are defined for all languages in the library. More tenses
|
||||
can be defined in the language extensions, e.g. the <I>passé simple</I> of
|
||||
Romance languages in <A HREF="../romance/ExtraRomance.gf"><CODE>ExtraRomance</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Common = {
|
||||
|
||||
cat
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Top-level units</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Text.html"><CODE>Text</CODE></A>: <CODE>Text</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
Text ; -- text consisting of several phrases e.g. "He is here. Why?"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Constructed in <A HREF="Phrase.html"><CODE>Phrase</CODE></A>:
|
||||
</P>
|
||||
<PRE>
|
||||
Phr ; -- phrase in a text e.g. "but be quiet please"
|
||||
Utt ; -- sentence, question, word... e.g. "be quiet"
|
||||
Voc ; -- vocative or "please" e.g. "my darling"
|
||||
PConj ; -- phrase-beginning conj. e.g. "therefore"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Constructed in <A HREF="Sentence.html"><CODE>Sentence</CODE></A>:
|
||||
</P>
|
||||
<PRE>
|
||||
SC ; -- embedded sentence or question e.g. "that it rains"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Constructed in <A HREF="Adverb.html"><CODE>Adverb</CODE></A>.
|
||||
Many adverbs are constructed in <A HREF="Structural.html"><CODE>Structural</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
Adv ; -- verb-phrase-modifying adverb, e.g. "in the house"
|
||||
AdV ; -- adverb directly attached to verb e.g. "always"
|
||||
AdA ; -- adjective-modifying adverb, e.g. "very"
|
||||
AdN ; -- numeral-modifying adverb, e.g. "more than"
|
||||
IAdv ; -- interrogative adverb e.g. "why"
|
||||
CAdv ; -- comparative adverb e.g. "more"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Tense, polarity, and anteriority</H2>
|
||||
<PRE>
|
||||
Tense ; -- tense e.g. present, past, future
|
||||
Pol ; -- polarity e.g. positive, negative
|
||||
Ant ; -- anteriority e.g. simultaneous, anterior
|
||||
|
||||
fun
|
||||
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||
|
||||
TPres : Tense ;
|
||||
ASimul : Ant ;
|
||||
TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent
|
||||
AAnter : Ant ; -- I have slept --# notpresent
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Common.txt -->
|
||||
</BODY></HTML>
|
||||
91
lib/resource/doc/gfdoc/Conjunction.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Conjunction: Coordination</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Conjunction: Coordination</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Rules</A>
|
||||
<LI><A HREF="#toc2">Categories</A>
|
||||
<LI><A HREF="#toc3">List constructors</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Coordination is defined for many different categories; here is
|
||||
a sample. The rules apply to <B>lists</B> of two or more elements,
|
||||
and define two general patterns:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>ordinary conjunction: X,...X and X
|
||||
<LI>distributed conjunction: both X,...,X and X
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
<CODE>VP</CODE> conjunctions are not covered here, because their applicability
|
||||
depends on language. Some special cases are defined in
|
||||
<A HREF="../abstract/Extra.gf"><CODE>Extra</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Conjunction = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Rules</H2>
|
||||
<PRE>
|
||||
fun
|
||||
ConjS : Conj -> [S] -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> [AP] -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> [NP] -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> [Adv] -> Adv ; -- "quickly or slowly"
|
||||
|
||||
DConjS : DConj -> [S] -> S ; -- "either John walks or Mary runs"
|
||||
DConjAP : DConj -> [AP] -> AP ; -- "both even and prime"
|
||||
DConjNP : DConj -> [NP] -> NP ; -- "either John or Mary"
|
||||
DConjAdv : DConj -> [Adv] -> Adv; -- "both badly and slowly"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Categories</H2>
|
||||
<P>
|
||||
These categories are only used in this module.
|
||||
</P>
|
||||
<PRE>
|
||||
cat
|
||||
[S]{2} ;
|
||||
[Adv]{2} ;
|
||||
[NP]{2} ;
|
||||
[AP]{2} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>List constructors</H2>
|
||||
<P>
|
||||
The list constructors are derived from the list notation and therefore
|
||||
not given explicitly. But here are their type signatures:
|
||||
</P>
|
||||
<PRE>
|
||||
-- BaseC : C -> C -> [C] ; -- for C = S, AP, NP, Adv
|
||||
-- ConsC : C -> [C] -> [C] ;
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Conjunction.txt -->
|
||||
</BODY></HTML>
|
||||
1196
lib/resource/doc/gfdoc/Constructors.html
Normal file
150
lib/resource/doc/gfdoc/Demonstrative.html
Normal file
@@ -0,0 +1,150 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Last update: 2006-03-06 21:21:27 CET
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Demonstrative = Cat, PredefAbs ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Naming convention: <CODE>M</CODE> prepended to 'unimodal' names.
|
||||
Exceptions: lexical units, those without unimodal counterparts.
|
||||
</P>
|
||||
<PRE>
|
||||
cat
|
||||
|
||||
MS ; -- multimodal sentence or question
|
||||
MQS ; -- multimodal wh question
|
||||
MImp ; -- multimodal imperative
|
||||
MVP ; -- multimodal verb phrase
|
||||
MComp ; -- multimodal complement to copula (MAP, MNP, MAdv)
|
||||
MAP ; -- multimodal adjectival phrase
|
||||
MNP ; -- multimodal (demonstrative) noun phrase
|
||||
MAdv ; -- multimodal (demonstrative) adverbial
|
||||
|
||||
Point ; -- pointing gesture
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A pointing gesture is constructed from a string.
|
||||
</P>
|
||||
<PRE>
|
||||
MkPoint : String -> Point ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Construction of sentences, questions, and imperatives.
|
||||
</P>
|
||||
<PRE>
|
||||
MPredVP : MNP -> MVP -> MS ; -- he flies here
|
||||
MQPredVP : MNP -> MVP -> MQS ; -- does he fly here
|
||||
|
||||
MQuestVP : IP -> MVP -> MQS ; -- who flies here
|
||||
|
||||
MImpVP : MVP -> MImp ; -- fly here!
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Construction of verb phrases from verb + complements.
|
||||
</P>
|
||||
<PRE>
|
||||
MUseV : V -> MVP ; -- flies (here)
|
||||
MComplV2 : V2 -> MNP -> MVP ; -- takes this (here)
|
||||
MComplVV : VV -> MVP -> MVP ; -- wants to fly (here)
|
||||
|
||||
MUseComp : MComp -> MVP ; -- is here ; is bigger than this
|
||||
|
||||
MCompAP : MAP -> MComp ; -- bigger than this
|
||||
MCompNP : MNP -> MComp ; -- the price of this
|
||||
MCompAdv : MAdv -> MComp ; -- here
|
||||
|
||||
MPositA : A -> MAP ; -- big
|
||||
MComparA : A -> MNP -> MAP ; -- bigger than this
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbial modification of a verb phrase.
|
||||
</P>
|
||||
<PRE>
|
||||
MAdvVP : MVP -> MAdv -> MVP ; -- fly here
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Demonstrative pronouns as NPs and determiners.
|
||||
</P>
|
||||
<PRE>
|
||||
this_MNP : Point -> MNP ; -- this
|
||||
that_MNP : Point -> MNP ; -- that
|
||||
thisDet_MNP : CN -> Point -> MNP ; -- this car
|
||||
thatDet_MNP : CN -> Point -> MNP ; -- that car
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Demonstrative adverbs.
|
||||
</P>
|
||||
<PRE>
|
||||
here_MAdv : Point -> MAdv ; -- here
|
||||
here7from_MAdv : Point -> MAdv ; -- from here
|
||||
here7to_MAdv : Point -> MAdv ; -- to here
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Building an adverb as prepositional phrase.
|
||||
</P>
|
||||
<PRE>
|
||||
MPrepNP : Prep -> MNP -> MAdv ; -- in this car
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Using ordinary categories.
|
||||
Mounting nondemonstrative expressions.
|
||||
</P>
|
||||
<PRE>
|
||||
DemNP : NP -> MNP ;
|
||||
DemAdv : Adv -> MAdv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Top-level phrases.
|
||||
</P>
|
||||
<PRE>
|
||||
PhrMS : Pol -> MS -> Phr ;
|
||||
PhrMS : Pol -> MS -> Phr ;
|
||||
PhrMQS : Pol -> MQS -> Phr ;
|
||||
PhrMImp : Pol -> MImp -> Phr ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
For testing and example-based grammar writing.
|
||||
</P>
|
||||
<PRE>
|
||||
point1, point2 : Point ;
|
||||
|
||||
x_MAdv, y_MAdv : MAdv ;
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc multimodal/Demonstrative.txt -->
|
||||
</BODY></HTML>
|
||||
48
lib/resource/doc/gfdoc/Grammar.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Grammar: the Main Module of the Resource Grammar</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Grammar: the Main Module of the Resource Grammar</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-06-20 08:34:45 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This grammar is a collection of the different grammar modules,
|
||||
To test the resource, import <A HREF="Lang.html"><CODE>Lang</CODE></A>, which also contains
|
||||
a lexicon.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Grammar =
|
||||
Noun,
|
||||
Verb,
|
||||
Adjective,
|
||||
Adverb,
|
||||
Numeral,
|
||||
Sentence,
|
||||
Question,
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Text,
|
||||
Structural,
|
||||
Idiom ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Grammar.txt -->
|
||||
</BODY></HTML>
|
||||
52
lib/resource/doc/gfdoc/Idiom.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Idiom: Idiomatic Expressions</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Idiom: Idiomatic Expressions</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-15 09:19:39 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Idiom = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This module defines constructions that are formed in fixed ways,
|
||||
often different even in closely related languages.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
ImpersCl : VP -> Cl ; -- it rains
|
||||
GenericCl : VP -> Cl ; -- one sleeps
|
||||
|
||||
CleftNP : NP -> RS -> Cl ; -- it is you who did it
|
||||
CleftAdv : Adv -> S -> Cl ; -- it is yesterday she arrived
|
||||
|
||||
ExistNP : NP -> Cl ; -- there is a house
|
||||
ExistIP : IP -> QCl ; -- which houses are there
|
||||
|
||||
ProgrVP : VP -> VP ; -- be sleeping
|
||||
|
||||
ImpPl1 : VP -> Utt ; -- let's go
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Idiom.txt -->
|
||||
</BODY></HTML>
|
||||
181
lib/resource/doc/gfdoc/IrregEng.gf
Normal file
@@ -0,0 +1,181 @@
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
|
||||
concrete IrregEng of IrregEngAbs = CatEng ** open ParadigmsEng in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
awake_V = irregV "awake" "awoke" "awoken" ;
|
||||
bear_V = irregV "bear" "bore" "born" ;
|
||||
beat_V = irregV "beat" "beat" "beat" ;
|
||||
become_V = irregV "become" "became" "become" ;
|
||||
begin_V = irregV "begin" "began" "begun" ;
|
||||
bend_V = irregV "bend" "bent" "bent" ;
|
||||
beset_V = irregV "beset" "beset" "beset" ;
|
||||
bet_V = irregDuplV "bet" "bet" "bet" ;
|
||||
bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ;
|
||||
bind_V = irregV "bind" "bound" "bound" ;
|
||||
bite_V = irregV "bite" "bit" "bitten" ;
|
||||
bleed_V = irregV "bleed" "bled" "bled" ;
|
||||
blow_V = irregV "blow" "blew" "blown" ;
|
||||
break_V = irregV "break" "broke" "broken" ;
|
||||
breed_V = irregV "breed" "bred" "bred" ;
|
||||
bring_V = irregV "bring" "brought" "brought" ;
|
||||
broadcast_V = irregV "broadcast" "broadcast" "broadcast" ;
|
||||
build_V = irregV "build" "built" "built" ;
|
||||
burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ;
|
||||
burst_V = irregV "burst" "burst" "burst" ;
|
||||
buy_V = irregV "buy" "bought" "bought" ;
|
||||
cast_V = irregV "cast" "cast" "cast" ;
|
||||
catch_V = irregV "catch" "caught" "caught" ;
|
||||
choose_V = irregV "choose" "chose" "chosen" ;
|
||||
cling_V = irregV "cling" "clung" "clung" ;
|
||||
come_V = irregV "come" "came" "come" ;
|
||||
cost_V = irregV "cost" "cost" "cost" ;
|
||||
creep_V = irregV "creep" "crept" "crept" ;
|
||||
cut_V = irregDuplV "cut" "cut" "cut" ;
|
||||
deal_V = irregV "deal" "dealt" "dealt" ;
|
||||
dig_V = irregDuplV "dig" "dug" "dug" ;
|
||||
dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ;
|
||||
do_V = mk5V "do" "does" "did" "done" "doing" ;
|
||||
draw_V = irregV "draw" "drew" "drawn" ;
|
||||
dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ;
|
||||
drive_V = irregV "drive" "drove" "driven" ;
|
||||
drink_V = irregV "drink" "drank" "drunk" ;
|
||||
eat_V = irregV "eat" "ate" "eaten" ;
|
||||
fall_V = irregV "fall" "fell" "fallen" ;
|
||||
feed_V = irregV "feed" "fed" "fed" ;
|
||||
feel_V = irregV "feel" "felt" "felt" ;
|
||||
fight_V = irregV "fight" "fought" "fought" ;
|
||||
find_V = irregV "find" "found" "found" ;
|
||||
fit_V = irregDuplV "fit" "fit" "fit" ;
|
||||
flee_V = irregV "flee" "fled" "fled" ;
|
||||
fling_V = irregV "fling" "flung" "flung" ;
|
||||
fly_V = irregV "fly" "flew" "flown" ;
|
||||
forbid_V = irregDuplV "forbid" "forbade" "forbidden" ;
|
||||
forget_V = irregDuplV "forget" "forgot" "forgotten" ;
|
||||
forgive_V = irregV "forgive" "forgave" "forgiven" ;
|
||||
forsake_V = irregV "forsake" "forsook" "forsaken" ;
|
||||
freeze_V = irregV "freeze" "froze" "frozen" ;
|
||||
get_V = irregDuplV "get" "got" "gotten" ;
|
||||
give_V = irregV "give" "gave" "given" ;
|
||||
go_V = mk5V "go" "goes" "went" "gone" "going" ;
|
||||
grind_V = irregV "grind" "ground" "ground" ;
|
||||
grow_V = irregV "grow" "grew" "grown" ;
|
||||
hang_V = irregV "hang" "hung" "hung" ;
|
||||
have_V = mk5V "have" "has" "had" "had" "having" ;
|
||||
hear_V = irregV "hear" "heard" "heard" ;
|
||||
hide_V = irregV "hide" "hid" "hidden" ;
|
||||
hit_V = irregDuplV "hit" "hit" "hit" ;
|
||||
hold_V = irregV "hold" "held" "held" ;
|
||||
hurt_V = irregV "hurt" "hurt" "hurt" ;
|
||||
keep_V = irregV "keep" "kept" "kept" ;
|
||||
kneel_V = irregV "kneel" "knelt" "knelt" ;
|
||||
knit_V = irregDuplV "knit" "knit" "knit" ;
|
||||
know_V = irregV "know" "knew" "know" ;
|
||||
lay_V = irregV "lay" "laid" "laid" ;
|
||||
lead_V = irregV "lead" "led" "led" ;
|
||||
leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ;
|
||||
learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ;
|
||||
leave_V = irregV "leave" "left" "left" ;
|
||||
lend_V = irregV "lend" "lent" "lent" ;
|
||||
let_V = irregDuplV "let" "let" "let" ;
|
||||
lie_V = irregV "lie" "lay" "lain" ;
|
||||
light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ;
|
||||
lose_V = irregV "lose" "lost" "lost" ;
|
||||
make_V = irregV "make" "made" "made" ;
|
||||
mean_V = irregV "mean" "meant" "meant" ;
|
||||
meet_V = irregV "meet" "met" "met" ;
|
||||
misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ;
|
||||
mistake_V = irregV "mistake" "mistook" "mistaken" ;
|
||||
mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ;
|
||||
overcome_V = irregV "overcome" "overcame" "overcome" ;
|
||||
overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ;
|
||||
overtake_V = irregV "overtake" "overtook" "overtaken" ;
|
||||
overthrow_V = irregV "overthrow" "overthrew" "overthrown" ;
|
||||
pay_V = irregV "pay" "paid" "paid" ;
|
||||
plead_V = irregV "plead" "pled" "pled" ;
|
||||
prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ;
|
||||
put_V = irregDuplV "put" "put" "put" ;
|
||||
quit_V = irregDuplV "quit" "quit" "quit" ;
|
||||
read_V = irregV "read" "read" "read" ;
|
||||
rid_V = irregDuplV "rid" "rid" "rid" ;
|
||||
ride_V = irregV "ride" "rode" "ridden" ;
|
||||
ring_V = irregV "ring" "rang" "rung" ;
|
||||
rise_V = irregV "rise" "rose" "risen" ;
|
||||
run_V = irregDuplV "run" "ran" "run" ;
|
||||
saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ;
|
||||
say_V = irregV "say" "said" "said" ;
|
||||
see_V = irregV "see" "saw" "seen" ;
|
||||
seek_V = irregV "seek" "sought" "sought" ;
|
||||
sell_V = irregV "sell" "sold" "sold" ;
|
||||
send_V = irregV "send" "sent" "sent" ;
|
||||
set_V = irregDuplV "set" "set" "set" ;
|
||||
sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ;
|
||||
shake_V = irregV "shake" "shook" "shaken" ;
|
||||
shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ;
|
||||
shear_V = irregV "shear" "shore" "shorn" ;
|
||||
shed_V = irregDuplV "shed" "shed" "shed" ;
|
||||
shine_V = irregV "shine" "shone" "shone" ;
|
||||
shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ;
|
||||
shoot_V = irregV "shoot" "shot" "shot" ;
|
||||
show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ;
|
||||
shrink_V = irregV "shrink" "shrank" "shrunk" ;
|
||||
shut_V = irregDuplV "shut" "shut" "shut" ;
|
||||
sing_V = irregV "sing" "sang" "sung" ;
|
||||
sink_V = irregV "sink" "sank" "sunk" ;
|
||||
sit_V = irregDuplV "sit" "sat" "sat" ;
|
||||
sleep_V = irregV "sleep" "slept" "slept" ;
|
||||
slay_V = irregV "slay" "slew" "slain" ;
|
||||
slide_V = irregV "slide" "slid" "slid" ;
|
||||
sling_V = irregV "sling" "slung" "slung" ;
|
||||
slit_V = irregDuplV "slit" "slit" "slit" ;
|
||||
smite_V = irregV "smite" "smote" "smitten" ;
|
||||
sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ;
|
||||
speak_V = irregV "speak" "spoke" "spoken" ;
|
||||
speed_V = irregV "speed" "sped" "sped" ;
|
||||
spend_V = irregV "spend" "spent" "spent" ;
|
||||
spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ;
|
||||
spin_V = irregDuplV "spin" "spun" "spun" ;
|
||||
spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ;
|
||||
split_V = irregDuplV "split" "split" "split" ;
|
||||
spread_V = irregV "spread" "spread" "spread" ;
|
||||
spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ;
|
||||
stand_V = irregV "stand" "stood" "stood" ;
|
||||
steal_V = irregV "steal" "stole" "stolen" ;
|
||||
stick_V = irregV "stick" "stuck" "stuck" ;
|
||||
sting_V = irregV "sting" "stung" "stung" ;
|
||||
stink_V = irregV "stink" "stank" "stunk" ;
|
||||
stride_V = irregV "stride" "strod" "stridden" ;
|
||||
strike_V = irregV "strike" "struck" "struck" ;
|
||||
string_V = irregV "string" "strung" "strung" ;
|
||||
strive_V = irregV "strive" "strove" "striven" ;
|
||||
swear_V = irregV "swear" "swore" "sworn" ;
|
||||
sweep_V = irregV "sweep" "swept" "swept" ;
|
||||
swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ;
|
||||
swim_V = irregDuplV "swim" "swam" "swum" ;
|
||||
swing_V = irregV "swing" "swung" "swung" ;
|
||||
take_V = irregV "take" "took" "taken" ;
|
||||
teach_V = irregV "teach" "taught" "taught" ;
|
||||
tear_V = irregV "tear" "tore" "torn" ;
|
||||
tell_V = irregV "tell" "told" "told" ;
|
||||
think_V = irregV "think" "thought" "thought" ;
|
||||
thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ;
|
||||
throw_V = irregV "throw" "threw" "thrown" ;
|
||||
thrust_V = irregV "thrust" "thrust" "thrust" ;
|
||||
tread_V = irregV "tread" "trod" "trodden" ;
|
||||
understand_V = irregV "understand" "understood" "understood" ;
|
||||
uphold_V = irregV "uphold" "upheld" "upheld" ;
|
||||
upset_V = irregDuplV "upset" "upset" "upset" ;
|
||||
wake_V = irregV "wake" "woke" "woken" ;
|
||||
wear_V = irregV "wear" "wore" "worn" ;
|
||||
weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ;
|
||||
wed_V = irregDuplV "wed" "wed" "wed" ;
|
||||
weep_V = irregV "weep" "wept" "wept" ;
|
||||
wind_V = irregV "wind" "wound" "wound" ;
|
||||
win_V = irregDuplV "win" "won" "won" ;
|
||||
withhold_V = irregV "withhold" "withheld" "withheld" ;
|
||||
withstand_V = irregV "withstand" "withstood" "withstood" ;
|
||||
wring_V = irregV "wring" "wrung" "wrung" ;
|
||||
write_V = irregV "write" "wrote" "written" ;
|
||||
}
|
||||
395
lib/resource/doc/gfdoc/IrregFre.gf
Normal file
@@ -0,0 +1,395 @@
|
||||
--# -path=.:../romance:../common:../abstract:../../prelude
|
||||
|
||||
-- Irregular verbs from Nancy, based on a list from Sylvain Pogodalla, 25/11/2004
|
||||
-- Translated to GF by Aarne Ranta
|
||||
-- added extracted subcat information 29/11
|
||||
|
||||
concrete IrregFre of IrregFreAbs = CatFre **
|
||||
open DiffFre, MorphoFre, BeschFre, Prelude in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
-- all verbs in classes with "er" and "finir" are omitted
|
||||
|
||||
lin
|
||||
abattre_V2 = v_besch55 "abattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
absoudre_V2 = v_besch72 "absoudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
abstenir_V = v_besch23 "abstenir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
abstraire_V2 = v_besch61 "abstraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
accourir_V = v_besch33 "accourir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
accroître_V2 = v_besch73 "accroître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
accueillir_V2 = v_besch28 "accueillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
acquérir_V2 = v_besch24 "acquérir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
adjoindre_V2 = v_besch58 "adjoindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
admettre_V2 = v_besch56 "admettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
advenir_V = v_besch23 "advenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
aller_V = v_besch22 "aller" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
apercevoir_V2 = v_besch38 "apercevoir" ** {vtyp = VRefl ; lock_V2 = <> ; c2 = complGen} ;
|
||||
apparaître_V = v_besch64 "apparaître" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
appartenir_V2 = v_besch23 "appartenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
appendre_V2 = v_besch53 "appendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
apprendre_V2 = v_besch54 "apprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
assaillir_V2 = v_besch29 "assaillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
asseoir_V2 = v_besch49 "asseoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
astreindre_V2 = v_besch57 "astreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
atteindre_V2 = v_besch57 "atteindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
attendre_V2 = v_besch53 "attendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
avoir_V2 = v_besch1 "avoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
battre_V2 = v_besch55 "battre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
boire_V2 = v_besch69 "boire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
bouillir_V2 = v_besch31 "bouillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
braire_V = v_besch61 "braire" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
ceindre_V2 = v_besch57 "ceindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
choir_V = v_besch52 "choir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
circonscrire_V2 = v_besch80 "circonscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
circonvenir_V2 = v_besch23 "circonvenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
clore_V2 = v_besch70 "clore" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
combattre_V2 = v_besch55 "combattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
commettre_V2 = v_besch56 "commettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
comparaître_V2 = v_besch64 "comparaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
complaire_V2 = v_besch63 "complaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
comprendre_V2 = v_besch54 "comprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
compromettre_V2 = v_besch56 "compromettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
concevoir_V2 = v_besch38 "concevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
conclure_V2 = v_besch71 "conclure" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
concourir_V2 = v_besch33 "concourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
condescendre_V2 = v_besch53 "condescendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
conduire_V2 = v_besch82 "conduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
confire_V2 = v_besch81 "confire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
confondre_V2 = v_besch53 "confondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
conjoindre_V2 = v_besch58 "conjoindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
connaître_V2 = v_besch64 "connaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
conquérir_V2 = v_besch24 "conquérir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
consentir_V2 = v_besch25 "consentir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
construire_V2 = v_besch82 "construire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contenir_V2 = v_besch23 "contenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contraindre_V2 = v_besch59 "contraindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contrebattre_V2 = v_besch55 "contrebattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contredire_V2 = v_besch78 "contredire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contrefaire_V2 = v_besch62 "contrefaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
contrevenir_V2 = v_besch23 "contrevenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
convaincre_V2 = v_besch60 "convaincre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
convenir_V2 = v_besch23 "convenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
correspondre_V2 = v_besch53 "correspondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
corrompre_V2 = v_besch53 "corrompre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
coudre_V2 = v_besch73 "coudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
courir_V2 = v_besch33 "courir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
couvrir_V2 = v_besch27 "couvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
craindre_V2 = v_besch59 "craindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
croire_V2 = v_besch68 "croire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
croître_V = v_besch67 "croître" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
cueillir_V2 = v_besch28 "cueillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
cuire_V2 = v_besch82 "cuire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
débattre_V2 = v_besch55 "débattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
débouillir_V2 = v_besch31 "débouillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
décevoir_V2 = v_besch38 "décevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déchoir_V2 = v_besch52 "déchoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déclore_V2 = v_besch70 "déclore" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
décommettre_V2 = v_besch56 "décommettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déconfire_V2 = v_besch81 "déconfire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
découdre_V2 = v_besch73 "découdre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
découvrir_V2 = v_besch27 "découvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
décrire_V2 = v_besch80 "décrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
décroître_V2 = v_besch67 "décroître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
décuire_V2 = v_besch82 "décuire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déduire_V2 = v_besch82 "déduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
défaillir_V = v_besch30 "défaillir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
défaire_V2 = v_besch62 "défaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
défendre_V2 = v_besch53 "défendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
démentir_V2 = v_besch25 "démentir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
démettre_V2 = v_besch56 "démettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
démordre_V = v_besch53 "démordre" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
départir_V2 = v_besch25 "départir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
dépeindre_V2 = v_besch57 "dépeindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
dépendre_V2 = v_besch53 "dépendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
déplaire_V = v_besch63 "déplaire" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
dépourvoir_V2 = v_besch40 "dépourvoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déprendre_V2 = v_besch54 "déprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
désapprendre_V2 = v_besch54 "désapprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
descendre_V2 = v_besch53 "descendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
desservir_V2 = v_besch35 "desservir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
déteindre_V2 = v_besch57 "déteindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
détendre_V2 = v_besch53 "détendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
détenir_V2 = v_besch23 "détenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
détordre_V2 = v_besch53 "détordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
détruire_V2 = v_besch82 "détruire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
devenir_V = v_besch23 "devenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
dévêtir_V2 = v_besch26 "dévêtir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
devoir_V2 = v_besch42 "devoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
dire_V2 = v_besch78 "dire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
disconvenir_V2 = v_besch23 "disconvenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
discourir_V2 = v_besch33 "discourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
disjoindre_V2 = v_besch58 "disjoindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
disparaître_V2 = v_besch64 "disparaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
dissoudre_V2 = v_besch72 "dissoudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
distendre_V2 = v_besch53 "distendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
distordre_V2 = v_besch53 "distordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
distraire_V2 = v_besch61 "distraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
dormir_V2 = v_besch32 "dormir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
ébattre_V = v_besch55 "ébattre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
échoir_V2 = v_besch52 "échoir" ** {vtyp = VEsse ; lock_V2 = <> ; c2 = complDat} ;
|
||||
éclore_V2 = v_besch70 "éclore" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
éconduire_V2 = v_besch82 "éconduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
écrire_V2 = v_besch80 "écrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
élire_V2 = v_besch77 "élire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
embatre_V2 = v_besch55 "embatre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
embattre_V2 = v_besch55 "embattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
emboire_V = v_besch69 "emboire" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
émettre_V2 = v_besch56 "émettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
émoudre_V2 = v_besch74 "émoudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
émouvoir_V2 = v_besch44 "émouvoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
empreindre_V2 = v_besch57 "empreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
enceindre_V2 = v_besch57 "enceindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
enclore_V2 = v_besch70 "enclore" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
encourir_V2 = v_besch33 "encourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
endormir_V2 = v_besch32 "endormir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
enduire_V2 = v_besch82 "enduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
enfreindre_V2 = v_besch57 "enfreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
enfuir_V = v_besch36 "enfuir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
enjoindre_V2 = v_besch58 "enjoindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
enquérir_V = v_besch24 "enquérir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entendre_V2 = v_besch53 "entendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
entr'apercevoir_V = v_besch38 "entr'apercevoir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entrebattre_V = v_besch55 "entrebattre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entre_détruire_V = v_besch82 "entre-détruire" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entre_haïr_V = v_besch20 "entre-haïr" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entremettre_V = v_besch56 "entremettre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
entre_nuire_V = v_besch82 "entre-nuire" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
entreprendre_V2 = v_besch54 "entreprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
entretenir_V2 = v_besch23 "entretenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
entrevoir_V2 = v_besch39 "entrevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
entrouvrir_V2 = v_besch27 "entrouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
envoyer_V2 = v_besch18 "envoyer" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
épandre_V2 = v_besch53 "épandre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
éperdre_V = v_besch53 "éperdre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
éprendre_V = v_besch54 "éprendre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
équivaloir_V2 = v_besch47 "équivaloir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
éteindre_V2 = v_besch57 "éteindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
étendre_V2 = v_besch53 "étendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
étreindre_V2 = v_besch57 "étreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
être_V = v_besch2 "être" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
exclure_V2 = v_besch71 "exclure" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
extraire_V2 = v_besch61 "extraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
faillir_V2 = v_besch30 "faillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
faire_V2 = v_besch62 "faire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
falloir_V = v_besch46 "falloir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
feindre_V2 = v_besch57 "feindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
fendre_V2 = v_besch53 "fendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
fondre_V2 = v_besch53 "fondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
forfaire_V2 = v_besch62 "forfaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
foutre_V2 = v_besch53 "foutre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
frire_V2 = v_besch81 "frire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
fuir_V2 = v_besch36 "fuir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
geindre_V2 = v_besch57 "geindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
gésir_V2 = mkNV (conj3gésir "gésir") ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
haïr_V2 = v_besch20 "haïr" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
inclure_V2 = v_besch71 "inclure" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
induire_V2 = v_besch82 "induire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
inscrire_V2 = v_besch80 "inscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
instruire_V2 = v_besch82 "instruire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
interdire_V2 = v_besch78 "interdire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
interrompre_V2 = v_besch53 "interrompre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
intervenir_V = v_besch23 "intervenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
introduire_V2 = v_besch82 "introduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
joindre_V2 = v_besch58 "joindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
lire_V2 = v_besch77 "lire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
luire_V = v_besch82 "luire" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
mainmettre_V2 = v_besch56 "mainmettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
maintenir_V2 = v_besch23 "maintenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
méconnaître_V2 = v_besch64 "méconnaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
mécroire_V2 = v_besch68 "mécroire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
médire_V2 = v_besch78 "médire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
mentir_V2 = v_besch25 "mentir" ** {vtyp = VEsse ; lock_V2 = <> ; c2 = complDat} ;
|
||||
méprendre_V2 = v_besch54 "méprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
messeoir_V2 = v_besch50 "messeoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
mettre_V2 = v_besch56 "mettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
mévendre_V2 = v_besch53 "mévendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
mordre_V2 = v_besch53 "mordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
morfondre_V = v_besch53 "morfondre" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
moudre_V2 = v_besch74 "moudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
mourir_V = v_besch34 "mourir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
mouvoir_V2 = v_besch44 "mouvoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
naître_V = v_besch65 "naître" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
nuire_V2 = v_besch82 "nuire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
obtenir_V2 = v_besch23 "obtenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
obvenir_V = v_besch23 "obvenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
occlure_V2 = v_besch71 "occlure" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
offrir_V2 = v_besch27 "offrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
oindre_V2 = v_besch58 "oindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
omettre_V2 = v_besch56 "omettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
ouïr_V2 = v_besch37 "ouïr" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
ouvrir_V2 = v_besch27 "ouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
paître_V2 = v_besch66 "paître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
paître_V = v_besch66 "paître" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
paraître_V = v_besch64 "paraître" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
parcourir_V2 = v_besch33 "parcourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
parfondre_V2 = v_besch53 "parfondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
partir_V = v_besch25 "partir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
parvenir_V = v_besch23 "parvenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
peindre_V2 = v_besch57 "peindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
pendre_V2 = v_besch53 "pendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
percevoir_V2 = v_besch38 "percevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
perdre_V2 = v_besch53 "perdre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
permettre_V2 = v_besch56 "permettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
plaindre_V2 = v_besch59 "plaindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
plaire_V2 = v_besch63 "plaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
pleuvoir_V = v_besch45 "pleuvoir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
poindre_V2 = v_besch58 "poindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
pondre_V2 = v_besch53 "pondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
pourfendre_V2 = v_besch53 "pourfendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
poursuivre_V2 = v_besch75 "poursuivre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
pourvoir_V2 = v_besch40 "pourvoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
pouvoir_V = v_besch43 "pouvoir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
prédire_V2 = v_besch78 "prédire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
prendre_V2 = v_besch54 "prendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
prescrire_V2 = v_besch80 "prescrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
pressentir_V2 = v_besch25 "pressentir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
prétendre_V2 = v_besch53 "prétendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
prévaloir_V2 = v_besch47 "prévaloir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
prévenir_V2 = v_besch23 "prévenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
prévoir_V2 = v_besch39 "prévoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
produire_V2 = v_besch82 "produire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
promettre_V2 = v_besch56 "promettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
promouvoir_V2 = v_besch44 "promouvoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
proscrire_V2 = v_besch80 "proscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
provenir_V = v_besch23 "provenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
rabattre_V2 = v_besch55 "rabattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
raire_V2 = v_besch61 "raire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rapprendre_V2 = v_besch54 "rapprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rasseoir_V2 = v_besch49 "rasseoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réadmettre_V2 = v_besch56 "réadmettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réapparaître_V = v_besch64 "réapparaître" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
réapprendre_V2 = v_besch54 "réapprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rebattre_V2 = v_besch55 "rebattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recevoir_V2 = v_besch38 "recevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recomparaître_V2 = v_besch64 "recomparaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reconduire_V2 = v_besch82 "reconduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reconnaître_V2 = v_besch64 "reconnaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reconquérir_V2 = v_besch24 "reconquérir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reconstruire_V2 = v_besch82 "reconstruire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recoudre_V2 = v_besch73 "recoudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recourir_V2 = v_besch33 "recourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
recouvrir_V2 = v_besch27 "recouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
récrire_V2 = v_besch80 "récrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recroître_V2 = v_besch67 "recroître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recueillir_V2 = v_besch28 "recueillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
recuire_V2 = v_besch82 "recuire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
redécouvrir_V2 = v_besch27 "redécouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
redéfaire_V2 = v_besch62 "redéfaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
redescendre_V2 = v_besch53 "redescendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
redevenir_V = v_besch23 "redevenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
redevoir_V2 = v_besch42 "redevoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
redire_V2 = v_besch78 "redire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réduire_V2 = v_besch82 "réduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
réécrire_V2 = v_besch80 "réécrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réélire_V2 = v_besch77 "réélire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réentendre_V2 = v_besch53 "réentendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
refaire_V2 = v_besch62 "refaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
refendre_V2 = v_besch53 "refendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
refondre_V2 = v_besch53 "refondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réinscrire_V2 = v_besch80 "réinscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
réintroduire_V2 = v_besch82 "réintroduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rejoindre_V2 = v_besch58 "rejoindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
relire_V2 = v_besch77 "relire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reluire_V2 = v_besch82 "reluire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
remettre_V2 = v_besch56 "remettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
remordre_V2 = v_besch53 "remordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
remoudre_V2 = v_besch74 "remoudre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
renaître_V2 = v_besch65 "renaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rendormir_V2 = v_besch32 "rendormir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rendre_V2 = v_besch53 "rendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rentraire_V2 = v_besch61 "rentraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rentrouvrir_V2 = v_besch27 "rentrouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
renvoyer_V2 = v_besch18 "renvoyer" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
repaître_V2 = v_besch66 "repaître" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
répandre_V2 = v_besch53 "répandre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reparaître_V = v_besch64 "reparaître" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
repartir_V = v_besch25 "repartir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
repeindre_V2 = v_besch57 "repeindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rependre_V2 = v_besch53 "rependre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
repentir_V = v_besch25 "repentir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
reperdre_V2 = v_besch53 "reperdre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
repleuvoir_V = v_besch45 "repleuvoir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
répondre_V2 = v_besch53 "répondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reprendre_V2 = v_besch54 "reprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reproduire_V2 = v_besch82 "reproduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
requérir_V2 = v_besch24 "requérir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
résoudre_V2 = mkNV (conj3résoudre "résoudre") ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
ressentir_V2 = v_besch25 "ressentir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
resservir_V2 = v_besch35 "resservir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
ressortir_V = v_besch25 "ressortir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
ressouvenir_V = v_besch23 "ressouvenir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
restreindre_V2 = v_besch57 "restreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
reteindre_V2 = v_besch57 "reteindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retendre_V2 = v_besch53 "retendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retenir_V2 = v_besch23 "retenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retondre_V2 = v_besch53 "retondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retordre_V2 = v_besch53 "retordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retraduire_V2 = v_besch82 "retraduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retraire_V2 = v_besch61 "retraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retranscrire_V2 = v_besch80 "retranscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
retransmettre_V2 = v_besch56 "retransmettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rétreindre_V2 = v_besch57 "rétreindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revaloir_V2 = v_besch47 "revaloir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revendre_V2 = v_besch53 "revendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revenir_V = v_besch23 "revenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
revêtir_V2 = v_besch26 "revêtir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revivre_V2 = v_besch76 "revivre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revoir_V2 = v_besch39 "revoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
revouloir_V2 = v_besch48 "revouloir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rire_V2 = v_besch79 "rire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complGen} ;
|
||||
rompre_V2 = v_besch53 "rompre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
rouvrir_V2 = v_besch27 "rouvrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
saillir_V2 = v_besch29 "saillir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
satisfaire_V2 = v_besch62 "satisfaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
savoir_V2 = v_besch41 "savoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
secourir_V2 = v_besch33 "secourir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
séduire_V2 = v_besch82 "séduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
sentir_V2 = v_besch25 "sentir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
seoir_V = v_besch50 "seoir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
servir_V2 = v_besch35 "servir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
sortir_V = v_besch25 "sortir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
soubattre_V2 = v_besch55 "soubattre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
souffrir_V2 = v_besch27 "souffrir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
soumettre_V2 = v_besch56 "soumettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
sourire_V2 = v_besch79 "sourire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
souscrire_V2 = v_besch80 "souscrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
sous_entendre_V2 = v_besch53 "sous-entendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
sous_tendre_V2 = v_besch53 "sous-tendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
soustraire_V2 = v_besch61 "soustraire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
soutenir_V2 = v_besch23 "soutenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
souvenir_V = v_besch23 "souvenir" ** {vtyp = VHabere ; lock_V = <> ; c2 = complAcc} ;
|
||||
subvenir_V2 = v_besch23 "subvenir" ** {vtyp = VEsse ; lock_V2 = <> ; c2 = complDat} ;
|
||||
suffire_V2 = v_besch81 "suffire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
suivre_V2 = v_besch75 "suivre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
surfaire_V2 = v_besch62 "surfaire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
surprendre_V2 = v_besch54 "surprendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
surproduire_V2 = v_besch82 "surproduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
surseoir_V2 = v_besch51 "surseoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
surtondre_V2 = v_besch53 "surtondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
survenir_V = v_besch23 "survenir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
survivre_V2 = v_besch76 "survivre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
suspendre_V2 = v_besch53 "suspendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
taire_V2 = v_besch63 "taire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
teindre_V2 = v_besch57 "teindre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
tendre_V2 = v_besch53 "tendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
tenir_V2 = v_besch23 "tenir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complDat} ;
|
||||
tondre_V2 = v_besch53 "tondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
tordre_V2 = v_besch53 "tordre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
traduire_V2 = v_besch82 "traduire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
traire_V2 = v_besch61 "traire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
transcrire_V2 = v_besch80 "transcrire" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
transmettre_V2 = v_besch56 "transmettre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
transparaître_V = v_besch64 "transparaître" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
tréfondre_V2 = v_besch53 "tréfondre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
tressaillir_V = v_besch29 "tressaillir" ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
vaincre_V2 = v_besch60 "vaincre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
valoir_V2 = v_besch47 "valoir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
vendre_V2 = v_besch53 "vendre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
venir_V = v_besch23 "venir" ** {vtyp = VEsse ; lock_V = <>} ;
|
||||
vêtir_V2 = v_besch26 "vêtir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
vivre_V2 = v_besch76 "vivre" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
voir_V2 = v_besch39 "voir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
vouloir_V2 = v_besch48 "vouloir" ** {vtyp = VHabere ; lock_V2 = <> ; c2 = complAcc} ;
|
||||
|
||||
}
|
||||
228
lib/resource/doc/gfdoc/IrregGer.gf
Normal file
@@ -0,0 +1,228 @@
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
|
||||
-- adapted from verb list in
|
||||
-- http://www.iee.et.tu-dresden.de/~wernerr/grammar/verben_dt.html
|
||||
|
||||
concrete IrregGer of IrregGerAbs = CatGer ** open
|
||||
ParadigmsGer,
|
||||
(M = MorphoGer)
|
||||
in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin backen_V = irregV "backen" "bäckt" (variants {"backt" ; "buk"}) (variants {"backt" ; "buke"}) "gebacken" ;
|
||||
lin befehlen_V = irregV "befehlen" "befiehlt" "befahl" "beföhle" "befähle)" ;
|
||||
lin beginnen_V = irregV "beginnen" "beginnt" "begann" "begönne" "begänne)" ;
|
||||
lin beißen_V = irregV "beißen" "beißt" "biß" "biße" "gebissen" ;
|
||||
lin bergen_V = irregV "bergen" "birgt" "barg" "bärge" "geborgen" ;
|
||||
lin bersten_V = irregV "bersten" "birst" "barst" "bärste" "geborsten" ;
|
||||
lin bewegen_V = irregV "bewegen" "bewegt" "bewog" "bewöge" "bewogen" ;
|
||||
lin biegen_V = irregV "biegen" "biegt" "bog" "böge" "gebogen" ;
|
||||
lin bieten_V = irregV "bieten" "bietet" "bot" "böte" "geboten" ;
|
||||
lin binden_V = irregV "binden" "bindt" "band" "bände" "gebunden" ;
|
||||
lin bitten_V = irregV "bitten" "bittet" "bat" "bäte" "gebeten" ;
|
||||
lin blasen_V = irregV "blasen" "bläst" "blies" "bliese" "geblasen" ;
|
||||
lin bleiben_V = irregV "bleiben" "bleibt" "blieb" "bliebe" "geblieben" ;
|
||||
lin braten_V = irregV "braten" "brät" "briet" "briete" "gebraten" ;
|
||||
lin brechen_V = irregV "brechen" "bricht" "brach" "bräche" "gebrochen" ;
|
||||
lin brennen_V = irregV "brennen" "brennt" "brannte" "brennte" "gebrannt" ;
|
||||
lin bringen_V = irregV "bringen" "bringt" "brachte" "brachte" "gebracht" ;
|
||||
lin denken_V = irregV "denken" "denkt" "dachte" "dachte" "gedacht" ;
|
||||
lin dingen_V = irregV "dingen" "dingt" "dingte" "dang" "gedungen" ;
|
||||
lin dreschen_V = irregV "dreschen" "drischt" "drosch" "drösche" "gedroschen" ;
|
||||
lin dringen_V = irregV "dringen" "dringt" "drang" "dränge" "gedrungen" ;
|
||||
lin dürfen_V = M.mkV
|
||||
"dürfen" "darf" "darfst" "darf" "dürft" "dürf"
|
||||
"durfte" "durftest" "durften" "durftet"
|
||||
"dürfte" "gedurft" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
lin empfehlen_V = irregV "empfehlen" "empfiehlt" "empfahl"
|
||||
(variants {"empföhle" ; "empfähle"}) "empfohlen" ;
|
||||
lin erlöschen_V = irregV "erlöschen" "erlischt" "erlosch" "erlösche" "erloschen" ;
|
||||
lin erkennen_V = irregV "erkennen" "erkennt" "erkannte" "erkannte" "erkannt" ;
|
||||
lin erschrecken_V = irregV "erschrecken" "erschrickt" "erschrak" "erschräke" "erschrocken" ;
|
||||
lin essen_V = irregV "essen" "ißt" "aß" "äße" "gegessen" ;
|
||||
lin fahren_V = irregV "fahren" "fährt" "fuhr" "führe" "gefahren" ;
|
||||
lin fallen_V = irregV "fallen" "fällt" "fiel" "fiele" "gefallen" ;
|
||||
lin fangen_V = irregV "fangen" "fängt" "fing" "finge" "gefangen" ;
|
||||
lin fechten_V = irregV "fechten" "fechtet" "focht" "föchte" "gefochten" ;
|
||||
lin finden_V = irregV "finden" "findt" "fand" "fände" "gefunden" ;
|
||||
lin flechten_V = irregV "flechten" "flicht" "flocht" "flöchte" "geflochten" ;
|
||||
lin fliegen_V = irregV "fliegen" "fliegt" "flog" "flöge" "geflogen" ;
|
||||
lin fliehen_V = irregV "fliehen" "flieht" "floh" "flöhe" "geflohen" ;
|
||||
lin fließen_V = irregV "fließen" "fließt" "floß" "flösse" "geflossen" ;
|
||||
lin fressen_V = irregV "fressen" "frißt" "fraß" "fräße" "gefressen" ;
|
||||
lin frieren_V = irregV "frieren" "friert" "fror" "fröre" "gefroren" ;
|
||||
lin gären_V = irregV "gären" "gärt" (variants {"gor" ; "gärte"}) "göre" "gegoren" ;
|
||||
lin gebären_V = irregV "gebären" "gebiert" "gebar" "gebäre" "geboren" ;
|
||||
lin geben_V = irregV "geben" "gibt" "gab" "gäbe" "gegeben" ;
|
||||
lin gedeihen_V = irregV "gedeihen" "gedeiht" "gedieh" "gediehe" "gediehen" ;
|
||||
lin gehen_V = irregV "gehen" "geht" "ging" "ginge" "gegangen" ;
|
||||
lin gelingen_V = irregV "gelingen" "gelingt" "gelang" "gelange" "gelungen" ;
|
||||
lin gelten_V = irregV "gelten" "gilt" "galt" (variants {"galte" ; "golte"}) "gegolten" ;
|
||||
lin genesen_V = irregV "genesen" "genest" "genas" "genäse" "genesen" ;
|
||||
lin genießen_V = irregV "genießen" "genießt" "genoß" "genösse" "genossen" ;
|
||||
lin geschehen_V = irregV "geschehen" "geschieht" "geschah" "geschehen" "geschähe" ;
|
||||
lin gewinnen_V = irregV "gewinnen" "gewinnt" "gewann" (variants {"gewönne" ; "gewänne"}) "gewonnen" ;
|
||||
lin gießen_V = irregV "gießen" "gießt" "goß" "gösse" "gegossen" ;
|
||||
lin gleichen_V = irregV "gleichen" "gleicht" "glich" "gliche" "geglichen" ;
|
||||
lin gleiten_V = irregV "gleiten" "gleitet" "glitt" "glitte" "geglitten" ;
|
||||
lin glimmen_V = irregV "glimmen" "glimmt" "glomm" "glimmte" "glömme" ;
|
||||
lin graben_V = irregV "graben" "gräbt" "grub" "grübe" "gegraben" ;
|
||||
lin greifen_V = irregV "greifen" "greift" "griff" "griffe" "gegriffen" ;
|
||||
lin haben_V = irregV "haben" "hat" "hatte" "hatte" "gehabt" ;
|
||||
lin halten_V = irregV "halten" "hält" "hielt" "hielte" "gehalten" ;
|
||||
lin hängen_V = irregV "hängen" "hängt" "hing" "hinge" "gehangen" ;
|
||||
lin hauen_V = irregV "hauen" "haut" (variants {"haute" ; "hieb"}) (variants {"haute" ; "hiebe"}) "gehauen" ;
|
||||
lin heben_V = irregV "heben" "hebt" "hob" "höbe" "gehoben" ;
|
||||
lin heißen_V = irregV "heißen" "heißt" "hieß" "hieße" "geheißen" ;
|
||||
lin helfen_V = irregV "helfen" "hilft" "half" "hülfe" "geholfen" ;
|
||||
lin kennen_V = irregV "kennen" "kennt" "kannte" "kennte" "gekannt" ;
|
||||
lin klimmen_V = irregV "klimmen" "klimmt" "klomm" "klömme" "geklommen" ;
|
||||
lin klingen_V = irregV "klingen" "klingt" "klang" "klänge" "geklungen" ;
|
||||
lin kneifen_V = irregV "kneifen" "kneift" "kniff" "kniffe" "gekniffen" ;
|
||||
lin kommen_V = irregV "kommen" "kommt" "kam" "käme" "gekommen" ;
|
||||
lin können_V = M.mkV
|
||||
"können" "kann" "kannst" "kann" "könnt" "könn"
|
||||
"konnte" "konntest" "konnten" "konntet"
|
||||
"könnte" "gekonnt" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
lin kriechen_V = irregV "kriechen" "kriecht" "kroch" "kröche" "gekrochen" ;
|
||||
lin küren_V = irregV "küren" "kürt" "kürte" "kor" "gekürt" ;
|
||||
lin laden_V = irregV "laden" "lädt" "lud" "lüde" "geladen" ;
|
||||
lin lassen_V = irregV "lassen" "läßt" "ließ" "ließe" "gelassen" ;
|
||||
lin laufen_V = irregV "laufen" "läuft" "lief" "liefe" "gelaufen" ;
|
||||
lin leiden_V = irregV "leiden" "leidt" "litt" "litte" "gelitten" ;
|
||||
lin leihen_V = irregV "leihen" "leiht" "lieh" "liehe" "geliehen" ;
|
||||
lin lesen_V = irregV "lesen" "liest" "las" "läse" "gelesen" ;
|
||||
lin liegen_V = irregV "liegen" "liegt" "lag" "läge" "gelegen" ;
|
||||
lin lügen_V = irregV "lügen" "lügt" "log" "löge" "gelogen" ;
|
||||
lin mahlen_V = irregV "mahlen" "mahlt" "mahlte" "mahlte" "gemahlen" ;
|
||||
lin meiden_V = irregV "meiden" "meidt" "mied" "miede" "gemieden" ;
|
||||
lin melken_V = irregV "melken" (variants {"melkt" ; "milkt"}) (variants {"melkte" ; "molk"}) "gemolken" "gemelkt" ;
|
||||
lin messen_V = irregV "messen" "mißt" "maß" "mäße" "gemessen" ;
|
||||
lin mißlingen_V = irregV "mißlingen" "mißlingt" "mißlang" "mißlungen" "mißlänge" ;
|
||||
lin mögen_V = M.mkV
|
||||
"mögen" "mag" "magst" "mag" "mögt" "mög"
|
||||
"mochte" "mochtest" "mochten" "mochtet"
|
||||
"möchte" "gemocht" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
lin müssen_V = M.mkV
|
||||
"müssen" "muß" "mußt" "muß" "müßt" "müß"
|
||||
"mußte" "mußtest" "mußten" "mußtet"
|
||||
"müßte" "gemußt" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
lin nehmen_V = mk6V "nehmen" "nimmt" "nimm" "nahm" "nähme" "genommen" ;
|
||||
lin nennen_V = irregV "nennen" "nennt" "nannte" "nennte" "genannt" ;
|
||||
lin pfeifen_V = irregV "pfeifen" "pfeift" "pfiff" "pfiffe" "gepfiffen" ;
|
||||
lin preisen_V = irregV "preisen" "preist" "pries" "priese" "gepriesen" ;
|
||||
lin quellen_V = irregV "quellen" "quillt" "quoll" "quölle" "gequollen" ;
|
||||
lin raten_V = irregV "raten" "rät" "riet" "riete" "geraten" ;
|
||||
lin reiben_V = irregV "reiben" "reibt" "rieb" "riebe" "gerieben" ;
|
||||
lin reißen_V = irregV "reißen" "reißt" "riß" "riße" "gerissen" ;
|
||||
lin reiten_V = irregV "reiten" "reitet" "ritt" "ritte" "geritten" ;
|
||||
lin rennen_V = irregV "rennen" "rennt" "rannte" "rennte" "gerannt" ;
|
||||
lin riechen_V = irregV "riechen" "riecht" "roch" "röche" "gerochen" ;
|
||||
lin ringen_V = irregV "ringen" "ringt" "rang" "ränge" "gerungen" ;
|
||||
lin rinnen_V = irregV "rinnen" "rinnt" "rann" "ränne" "geronnen" ;
|
||||
lin rufen_V = irregV "rufen" "ruft" "rief" "riefe" "gerufen" ;
|
||||
lin salzen_V = irregV "salzen" "salzt" "salzte" "salzte" "gesalzen" ;
|
||||
lin saufen_V = irregV "saufen" "säuft" "soff" "söffe" "gesoffen" ;
|
||||
lin saugen_V = irregV "saugen" "saugt" (variants {"saugte" ; "sog"}) (variants {"saugte" ; "soge"}) (variants {"gesaugt" ; "gesogen"}) ;
|
||||
lin schaffen_V = irregV "schaffen" "schafft" "schuf" "schüfe" "geschaffen" ;
|
||||
lin scheiden_V = irregV "scheiden" "scheidt" "schied" "schiede" "geschieden" ;
|
||||
lin scheinen_V = irregV "scheinen" "scheint" "schien" "schiene" "geschienen" ;
|
||||
lin scheißen_V = irregV "scheißen" "scheißt" "schiß" "schiße" "geschissen" ;
|
||||
lin schelten_V = irregV "schelten" "schilt" "schalt" "schölte" "gescholten" ;
|
||||
lin scheren_V = irregV "scheren" "schert" "schor" "schöre" "geschoren" ;
|
||||
lin schieben_V = irregV "schieben" "schiebt" "schob" "schöbe" "geschoben" ;
|
||||
lin schießen_V = irregV "schießen" "schießt" "schoß" "schösse" "geschossen" ;
|
||||
lin schinden_V = irregV "schinden" "schindt" "schund" "schunde" "geschunden" ;
|
||||
lin schlafen_V = irregV "schlafen" "schläft" "schlief" "schliefe" "geschlafen" ;
|
||||
lin schlagen_V = irregV "schlagen" "schlägt" "schlug" "schlüge" "geschlagen" ;
|
||||
lin schleichen_V = irregV "schleichen" "schleicht" "schlich" "schliche" "geschlichen" ;
|
||||
lin schleifen_V = irregV "schleifen" "schleift" "schliff" "schliffe" "geschliffen" ;
|
||||
lin schleißen_V = irregV "schleißen" "schleißt" (variants {"schliß" ; "schleißte"}) (variants {"schliß" ; "schleißte"}) (variants {"geschlissen" ; "geschleißt"}) ;
|
||||
lin schließen_V = irregV "schließen" "schließt" "schloß" "schlösse" "geschlossen" ;
|
||||
lin schlingen_V = irregV "schlingen" "schlingt" "schlang" "schlünge" "geschlungen" ;
|
||||
lin schmeißen_V = irregV "schmeißen" "schmeißt" "schmiß" "schmiße" "geschmissen" ;
|
||||
lin schmelzen_V = irregV "schmelzen" "schmilzt" "schmolz" "schmölze" "geschmolzen" ;
|
||||
lin schneiden_V = irregV "schneiden" "schneidt" "schnitt" "schnitte" "geschnitten" ;
|
||||
lin schreiben_V = irregV "schreiben" "schreibt" "schrieb" "schriebe" "geschrieben" ;
|
||||
lin schreien_V = irregV "schreien" "schreit" "schrie" "schrie" "geschrien" ;
|
||||
lin schreiten_V = irregV "schreiten" "schreitet" "schritt" "schritte" "geschritten" ;
|
||||
lin schweigen_V = irregV "schweigen" "schweigt" "schwieg" "schwiege" "geschwiegen" ;
|
||||
lin schwellen_V = irregV "schwellen" "schwillt" "schwoll" "schwölle" "geschwollen" ;
|
||||
lin schwimmen_V = irregV "schwimmen" "schwimmt" "schwamm" (variants {"schwömme" ; "schwämme"}) "geschwommen" ;
|
||||
lin schwinden_V = irregV "schwinden" "schwindt" "schwand" "schwände" "geschwunden" ;
|
||||
lin schwingen_V = irregV "schwingen" "schwingt" "schwang" "schwänge" "geschwungen" ;
|
||||
lin schwören_V = irregV "schwören" "schwört" "schwor" "schwüre" "geschworen" ;
|
||||
lin sehen_V = irregV "sehen" "sieht" "sah" "sähe" "gesehen" ;
|
||||
lin sein_V = irregV "sein" "ist" "war" "wäre" "gewesen" ;
|
||||
lin senden_V = irregV "senden" "sendt" (variants {"sandte" ; "sendete"}) (variants {"sandte" ; "sendete"}) (variants {"gesandt" ; "gesendet"}) ;
|
||||
lin sieden_V = irregV "sieden" "siedt" (variants {"siedete" ; "sott"}) (variants {"siedete" ; "sotte"}) (variants {"gesotten" ; "gesiedet"}) ;
|
||||
lin singen_V = irregV "singen" "singt" "sang" "sänge" "gesungen" ;
|
||||
lin sinken_V = irregV "sinken" "sinkt" "sank" "sänke" "gesunken" ;
|
||||
lin sinnen_V = irregV "sinnen" "sinnt" "sann" "sänne" "gesonnen" ;
|
||||
lin sitzen_V = irregV "sitzen" "sitzt" "saß" "säße" "gesessen" ;
|
||||
lin sollen_V = M.mkV
|
||||
"sollen" "soll" "sollst" "soll" "sollt" "soll"
|
||||
"sollte" "solltest" "sollten" "solltet"
|
||||
"sollte" "gesollt" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
|
||||
lin speien_V = irregV "speien" "speit" "spie" "spie" "gespien" ;
|
||||
lin spinnen_V = irregV "spinnen" "spinnt" "spann" (variants {"spönne" ; "spänne"}) "gesponnen" ;
|
||||
lin spleißen_V = irregV "spleißen" "spleißt" "spliß" "spliße" "gesplissen" ;
|
||||
lin sprechen_V = irregV "sprechen" "spricht" "sprach" "spräche" "gesprochen" ;
|
||||
lin sprießen_V = irregV "sprießen" "sprießt" "sproß" "sprösse" "gesprossen" ;
|
||||
lin springen_V = irregV "springen" "springt" "sprang" "spränge" "gesprungen" ;
|
||||
lin stechen_V = irregV "stechen" "sticht" "stach" "stäche" "gestochen" ;
|
||||
lin stehen_V = irregV "stehen" "steht" "stand" (variants {"stünde" ; "stände"}) "gestanden" ;
|
||||
lin stehlen_V = irregV "stehlen" "stiehlt" "stahl" "stähle" "gestohlen" ;
|
||||
lin steigen_V = irregV "steigen" "steigt" "stieg" "stiege" "gestiegen" ;
|
||||
lin sterben_V = irregV "sterben" "stirbt" "starb" "stürbe" "gestorben" ;
|
||||
lin stieben_V = irregV "stieben" "stiebt" "stob" "stöbe" "gestoben" ;
|
||||
lin stinken_V = irregV "stinken" "stinkt" "stank" "stänke" "gestunken" ;
|
||||
lin stoßen_V = irregV "stoßen" "stößt" "stieß" "stieße" "gestoßen" ;
|
||||
lin streichen_V = irregV "streichen" "streicht" "strich" "striche" "gestrichen" ;
|
||||
lin streiten_V = irregV "streiten" "streitet" "stritt" "stritte" "gestritten" ;
|
||||
lin tragen_V = irregV "tragen" "trägt" "trug" "trüge" "getragen" ;
|
||||
lin treffen_V = irregV "treffen" "trifft" "traf" "träfe" "getroffen" ;
|
||||
lin treiben_V = irregV "treiben" "treibt" "trieb" "triebe" "getrieben" ;
|
||||
lin treten_V = irregV "treten" "tritt" "trat" "träte" "getreten" ;
|
||||
lin trinken_V = irregV "trinken" "trinkt" "trank" "tränke" "getrunken" ;
|
||||
lin trügen_V = irregV "trügen" "trügt" "trog" "tröge" "getrogen" ;
|
||||
lin tun_V = irregV "tun" "tut" "tat" "täte" "getan" ;
|
||||
lin verderben_V = irregV "verderben" "verdirbt" "verdarb" "verdarbe" "verdorben" ;
|
||||
lin verlieren_V = irregV "verlieren" "verliert" "verlor" "verlöre" "verloren" ;
|
||||
lin wachsen_V = irregV "wachsen" "wächst" "wuchs" "wüchse" "gewachsen" ;
|
||||
lin wägen_V = irregV "wägen" "wägt" "wog" "woge" "gewogen" ;
|
||||
lin waschen_V = irregV "waschen" "wäscht" "wusch" "wüsche" "gewaschen" ;
|
||||
lin weben_V = irregV "weben" "webt" (variants {"wob" ; "webte"}) "wöbe" (variants {"gewoben" ; "gewebt"}) ;
|
||||
lin weichen_V = irregV "weichen" "weicht" "wich" "wiche" "gewichen" ;
|
||||
lin weisen_V = irregV "weisen" "weist" "wies" "wiese" "gewiesen" ;
|
||||
lin wenden_V = irregV "wenden" "wendt" (variants {"wandte" ; "wendete"}) (variants {"wandte" ; "wendete"}) (variants {"gewandt" ; "gewendet"}) ;
|
||||
lin werben_V = irregV "werben" "wirbt" "warb" "würbe" "geworben" ;
|
||||
lin werden_V = M.mkV
|
||||
"werden" "werde" "wirst" "wird" "werdet" "werd"
|
||||
"wurde" "wurdest" "wurden" "wurdet"
|
||||
"würde" "geworden" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
lin werfen_V = irregV "werfen" "wirft" "warf" "würfe" "geworfen" ;
|
||||
lin wiegen_V = irregV "wiegen" "wiegt" "wog" "wöge" "gewogen" ;
|
||||
lin winden_V = irregV "winden" "windt" "wand" "wände" "gewunden" ;
|
||||
lin wissen_V = irregV "wissen" "weiß" "wußte" "wüßte" "gewußt" ;
|
||||
lin wollen_V = M.mkV
|
||||
"wollen" "will" "willst" "will" "wollt" "woll"
|
||||
"wollte" "wolltest" "wollten" "wolltet"
|
||||
"wollte" "gewollt" []
|
||||
M.VHaben ** {lock_V = <>} ;
|
||||
|
||||
|
||||
lin wringen_V = irregV "wringen" "wringt" "wrang" "wränge" "gewrungen" ;
|
||||
lin zeihen_V = irregV "zeihen" "zeiht" "zieh" "ziehe" "geziehen" ;
|
||||
lin ziehen_V = irregV "ziehen" "zieht" "zog" "zöge" "gezogen" ;
|
||||
lin zwingen_V = irregV "zwingen" "zwingt" "zwang" "zwänge" "gezwungen" ;
|
||||
|
||||
}
|
||||
72
lib/resource/doc/gfdoc/IrregNor.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
--# -path=.:../scandinavian:../common:../abstract:../../prelude
|
||||
|
||||
-- see: http://frodo.bruderhof.com/norskklassen/commonverbs.htm
|
||||
|
||||
concrete IrregNor of IrregNorAbs = CatNor ** open ParadigmsNor in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin be_V = mkV "be" "ber" "bes" "bad" "bedt" "be" ;
|
||||
lin bite_V = irregV "bite" (variants {"bet" ; "beit"}) "bitt" ;
|
||||
lin bli_V = irregV "bli" (variants {"ble" ; "blei"}) "blitt" ;
|
||||
lin brenne_V = irregV "brenne" (variants {"brant" ; "brente"}) "brent" ;
|
||||
lin bringe_V = irregV "bringe" "brakte" "brakt" ;
|
||||
lin burde_V = irregV "burde" "burde" "burdet" ;
|
||||
lin bære_V = irregV "bære" "bar" "båret" ;
|
||||
lin dra_V = mkV "dra" "drar" "dras" "drog" (variants {"dradd" ; "dratt"}) "dra" ;
|
||||
lin drikke_V = irregV "drikke" "drakk" "drukket" ;
|
||||
lin drive_V = irregV "drive" (variants {"drev" ; "dreiv"}) "drevet" ;
|
||||
lin dø_V = irregV "dø" (variants {"dødde" ; "døde"}) "dødd" ;
|
||||
lin eie_V = irregV "eie" (variants {"eide" ; "åtte"}) (variants {"eid" ; "ått"}) ;
|
||||
lin falle_V = irregV "falle" "falt" "falt" ;
|
||||
lin finne_V = irregV "finne" "fant" "funnet" ;
|
||||
lin fly_V = irregV "fly" (variants {"fløy" ; "flaug"}) (variants {"fløyet";"flydd"}) ;
|
||||
lin flyte_V = irregV "flyte" (variants {"fløte" ; "flaut"}) "flytt" ;
|
||||
lin foretrekke_V = irregV "foretrekke" "foretrakk" "foretrukket" ;
|
||||
lin forlate_V = irregV "forlate" "forlot" "forlatt" ;
|
||||
lin forstå_V = irregV "forstå" "forstod" "forstått" ;
|
||||
lin fortelle_V = irregV "fortelle" "fortalte" "fortalt" ;
|
||||
lin fryse_V = irregV "fryse" "frøs" "frosset" ;
|
||||
lin få_V = irregV "få" "fikk" "fått" ;
|
||||
lin gi_V = irregV "gi" "gav" "gitt" ;
|
||||
lin gjelde_V = irregV "gjelde" (variants {"gjaldt" ; "galdt"}) "gjeldt" ;
|
||||
lin gjøre_V = irregV "gjøre" "gjorde" "gjort" ;
|
||||
lin gni_V = irregV "gni" (variants {"gned" ; "gnei" ; "gnidde"}) "gnidd" ;
|
||||
lin gå_V = irregV "gå" "gikk" "gått" ;
|
||||
lin ha_V = irregV "ha" "hadde" "hatt" ;
|
||||
lin hente_V = irregV "hente" "hentet" "hendt" ;
|
||||
lin hete_V = irregV "hete" (variants {"het" ; "hette"}) "hett" ;
|
||||
lin hjelpe_V = irregV "hjelpe" "hjalp" "hjulpet" ;
|
||||
lin holde_V = irregV "holde" "holdt" "holdt" ;
|
||||
lin komme_V = irregV "komme" "kom" "kommet" ;
|
||||
lin kunne_V = irregV "kunne" "kunne" "kunnet" ;
|
||||
lin la_V = irregV "la" "lot" "latt" ;
|
||||
lin legge_V = irregV "legge" "la" "lagt" ;
|
||||
lin ligge_V = irregV "ligge" "lå" "ligget" ;
|
||||
lin løpe_V = irregV "løpe" "løp" (variants {"løpt" ; "løpet"}) ;
|
||||
lin måtte_V = irregV "måtte" "måtte" "måttet" ;
|
||||
lin renne_V = irregV "renne" "rant" "rent" ;
|
||||
lin se_V = mkV "se" "ser" "ses" "så" "sett" "se" ;
|
||||
lin selge_V = irregV "selge" "solgte" "solgt" ;
|
||||
lin sette_V = irregV "sette" "satte" "satt" ;
|
||||
lin si_V = mkV "si" "sier" "sies" "sa" "sagt" "sagd" ;
|
||||
lin sitte_V = irregV "sitte" "satt" "sittet" ;
|
||||
lin skjære_V = irregV "skjære" "skar" "skåret" ;
|
||||
lin skrive_V = irregV "skrive" "skrev" "skrevet" ;
|
||||
lin skulle_V = irregV "skulle" "skulle" "skullet" ;
|
||||
lin slå_V = irregV "slå" "slo" "slått" ;
|
||||
lin slåss_V = mkV "slåss" "slåss" "slåss" "sloss" "slåss" "slåss" ;
|
||||
lin sove_V = irregV "sove" "sov" "sovet" ;
|
||||
lin springe_V = irregV "springe" "sprang" "sprunget" ;
|
||||
lin spørre_V = irregV "spørre" "spurte" "spurt" ;
|
||||
lin stikke_V = irregV "stikke" "stakk" "stukket" ;
|
||||
lin stå_V = irregV "stå" "stod" "stått" ;
|
||||
lin suge_V = irregV "suge" (variants {"sugde" ; "saug"}) "sugd" ;
|
||||
lin synes_V = irregV "synes" "syntes" (variants {"synes" ; "syns"}) ;
|
||||
lin synge_V = irregV "synge" "sang" "sunget" ;
|
||||
lin ta_V = irregV "ta" "tok" "tatt" ;
|
||||
lin treffe_V = irregV "treffe" "traff" "truffet" ;
|
||||
lin trives_V = irregV "trives" "trivdes" (variants {"trives" ; "trivs"}) ;
|
||||
lin ville_V = irregV "ville" "ville" "villet" ;
|
||||
lin vite_V = mkV "vite" "vet" "vetes" "visste" "visst" "vit" ;
|
||||
}
|
||||
185
lib/resource/doc/gfdoc/IrregSwe.gf
Normal file
@@ -0,0 +1,185 @@
|
||||
--# -path=.:../scandinavian:../common:../abstract:../../prelude
|
||||
|
||||
concrete IrregSwe of IrregSweAbs = CatSwe ** open ParadigmsSwe in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
anfalla_V = irregV "anfalla" "anföll" "anfallit" ;
|
||||
angiva_V = irregV "angiva" "angav" "angivit" ;
|
||||
angripa_V = irregV "angripa" "angrep" "angripit" ;
|
||||
anhålla_V = irregV "anhålla" "anhäll" "anhållit" ;
|
||||
antaga_V = irregV "antaga" "antog" "antagit" ;
|
||||
äta_V = irregV "äta" "åt" "ätit" ;
|
||||
återfinna_V = irregV "återfinna" "återfann" "återfunnit" ;
|
||||
avbryta_V = irregV "avbryta" "avbröt" "avbrutit" ;
|
||||
avfalla_V = irregV "avfalla" "avföll" "avfallit" ;
|
||||
avhugga_V = irregV "avhugga" "avhögg" "avhuggit" ;
|
||||
avlida_V = irregV "avlida" "avled" "avlidit" ;
|
||||
avnjuta_V = irregV "avnjuta" "avnjöt" "avnjutit" ;
|
||||
avsitta_V = irregV "avsitta" "avsatt" "avsuttit" ;
|
||||
avskriva_V = irregV "avskriva" "avskrev" "avskrivit" ;
|
||||
avstiga_V = irregV "avstiga" "avsteg" "avstigit" ;
|
||||
bära_V = irregV "bära" "bar" "burit" ;
|
||||
bedraga_V = irregV "bedraga" "bedrog" "bedragit" ;
|
||||
bedriva_V = irregV "bedriva" "bedrev" "bedrivit" ;
|
||||
befinna_V = irregV "befinna" "befann" "befunnit" ;
|
||||
begrava_V = irregV "begrava" "begrov" "begravit" ;
|
||||
behålla_V = irregV "behålla" "behöll" "behållit" ;
|
||||
beljuga_V = irregV "beljuga" "beljög" "beljugit" ;
|
||||
berida_V = irregV "berida" "bered" "beridit" ;
|
||||
besitta_V = irregV "besitta" "besatt" "besuttit" ;
|
||||
beskriva_V = irregV "beskriva" "beskrev" "beskrivit" ;
|
||||
besluta_V = irregV "besluta" "beslöt" "beslutit" ;
|
||||
bestiga_V = irregV "bestiga" "besteg" "bestigit" ;
|
||||
bestrida_V = irregV "bestrida" "bestred" "bestridit" ;
|
||||
bidraga_V = irregV "bidraga" "bidrog" "bidragit" ;
|
||||
bifalla_V = irregV "bifalla" "biföll" "bifallit" ;
|
||||
binda_V = irregV "binda" "band" "bundit" ;
|
||||
bita_V = irregV "bita" "bet" "bitit" ;
|
||||
bjuda_V = irregV "bjuda" "bjöd" "bjudit" ;
|
||||
bliva_V = irregV "bli" "blev" "blivit" ;
|
||||
borttaga_V = irregV "borttaga" "borttog" "borttagit" ;
|
||||
brinna_V = irregV "brinna" "brann" "brunnit" ;
|
||||
brista_V = irregV "brista" "brast" "brustit" ;
|
||||
bryta_V = irregV "bryta" "bröt" "brutit" ;
|
||||
dö_V = irregV "dö" "dog" "dött" ;
|
||||
draga_V = mkV (variants { "dra"; "draga"}) (variants { "drar" ;
|
||||
"drager"}) (variants { "dra" ; "drag" }) "drog" "dragit" "dragen" ;
|
||||
dricka_V = irregV "dricka" "drack" "druckit" ;
|
||||
driva_V = irregV "driva" "drev" "drivit" ;
|
||||
drypa_V = irregV "drypa" "dröp" "drupit" ;
|
||||
duga_V = irregV "duga" "dög" "dugit" ;
|
||||
dyka_V = irregV "dyka" "dök" "dukit" ;
|
||||
erbjuda_V = irregV "erbjuda" "erbjöd" "erbjudit" ;
|
||||
erfara_V = irregV "erfara" "erfor" "erfarit" ;
|
||||
erhålla_V = irregV "erhålla" "erhöll" "erhållit" ;
|
||||
falla_V = irregV "falla" "föll" "fallit" ;
|
||||
fånga_V = irregV "fånga" "fäng" "fångit" ;
|
||||
fara_V = irregV "fara" "for" "farit" ;
|
||||
finna_V = irregV "finna" "fann" "funnit" ;
|
||||
flyga_V = irregV "flyga" "flög" "flugit" ;
|
||||
flyta_V = irregV "flyta" "flöt" "flutit" ;
|
||||
förbehålla_V = irregV "förbehålla" "förbehöll" "förbehållit" ;
|
||||
förbinda_V = irregV "förbinda" "förband" "förbundit" ;
|
||||
förbjuda_V = irregV "förbjuda" "förbjöd" "förbjudit" ;
|
||||
fördriva_V = irregV "fördriva" "fördrev" "fördrivit" ;
|
||||
föreskriva_V = irregV "föreskriva" "föreskrev" "föreskrivit" ;
|
||||
företaga_V = irregV "företaga" "företog" "företagit" ;
|
||||
förfrysa_V = irregV "förfrysa" "förfrös" "förfrusit" ;
|
||||
förlåta_V = irregV "förlåta" "förlät" "förlåtit" ;
|
||||
förnimma_V = irregV "förnimma" "förnamm" "förnummit" ;
|
||||
försitta_V = irregV "försitta" "försatt" "försuttit" ;
|
||||
försvinna_V = irregV "försvinna" "försvann" "försvunnit" ;
|
||||
förtiga_V = irregV "förtiga" "förteg" "förtigit" ;
|
||||
frysa_V = irregV "frysa" "frös" "frusit" ;
|
||||
gå_V = irregV "gå" "gick" "gått" ;
|
||||
göra_V = mkV "göra" "gör" "gör" "gjorde" "gjort" "gjord" ;
|
||||
genomdriva_V = irregV "genomdriva" "genomdrev" "genomdrivit" ;
|
||||
gilla_V = irregV "gilla" "gall" "gillit" ;
|
||||
giva_V = irregV "ge" "gav" "givit" ;
|
||||
gjuta_V = irregV "gjuta" "gjöt" "gjutit" ;
|
||||
glida_V = irregV "glida" "gled" "glidit" ;
|
||||
gnida_V = irregV "gnida" "gned" "gnidit" ;
|
||||
gråta_V = irregV "gråta" "grät" "gråtit" ;
|
||||
gripa_V = irregV "gripa" "grep" "gripit" ;
|
||||
hålla_V = irregV "hålla" "höll" "hållit" ;
|
||||
hinna_V = irregV "hinna" "hann" "hunnit" ;
|
||||
hugga_V = irregV "hugga" "högg" "huggit" ;
|
||||
iakttaga_V = irregV "iakttaga" "iakttog" "iakttagit" ;
|
||||
inbegripa_V = irregV "inbegripa" "inbegrep" "inbegripit" ;
|
||||
inbjuda_V = irregV "inbjuda" "inbjöd" "inbjudit" ;
|
||||
indraga_V = irregV "indraga" "indrog" "indragit" ;
|
||||
innesluta_V = irregV "innesluta" "inneslöt" "inneslutit" ;
|
||||
inskriva_V = irregV "inskriva" "inskrev" "inskrivit" ;
|
||||
intaga_V = irregV "intaga" "intog" "intagit" ;
|
||||
känna_V = irregV "känna" "kände" "känt" ;
|
||||
klämma_V = regV "klämmer" ;
|
||||
kliva_V = irregV "kliva" "klev" "klivit" ;
|
||||
klyva_V = irregV "klyva" "klöv" "kluvit" ;
|
||||
knipa_V = irregV "knipa" "knep" "knipit" ;
|
||||
knyta_V = irregV "knyta" "knöt" "knutit" ;
|
||||
komma_V = irregV "komma" "kom" "kommit" ;
|
||||
krypa_V = irregV "krypa" "kröp" "krupit" ;
|
||||
kunna_V = mkV "kunna" "kan" "kan" "kunde" "kunnat" "känd" ;
|
||||
kvida_V = irregV "kvida" "kved" "kvidit" ;
|
||||
låta_V = irregV "låta" "lät" "låtit" ;
|
||||
leva_V = irregV "leva" "levde" "levt" ;
|
||||
ligga_V = irregV "ligga" "låg" "legat" ;
|
||||
ljuda_V = irregV "ljuda" "ljöd" "ljudit" ;
|
||||
ljuga_V = irregV "ljuga" "ljög" "ljugit" ;
|
||||
ljuta_V = irregV "ljuta" "ljöt" "ljutit" ;
|
||||
lägga_V = irregV "lägga" "lade" "lagt" ;
|
||||
mottaga_V = irregV "mottaga" "mottog" "mottagit" ;
|
||||
nerstiga_V = irregV "nerstiga" "nersteg" "nerstigit" ;
|
||||
niga_V = irregV "niga" "neg" "nigit" ;
|
||||
njuta_V = irregV "njuta" "njöt" "njutit" ;
|
||||
omgiva_V = irregV "omgiva" "omgav" "omgivit" ;
|
||||
överfalla_V = irregV "överfalla" "överföll" "överfallit" ;
|
||||
övergiva_V = irregV "övergiva" "övergav" "övergivit" ;
|
||||
pipa_V = irregV "pipa" "pep" "pipit" ;
|
||||
rida_V = irregV "rida" "red" "ridit" ;
|
||||
rinna_V = irregV "rinna" "rann" "runnit" ;
|
||||
riva_V = irregV "riva" "rev" "rivit" ;
|
||||
ryta_V = irregV "ryta" "röt" "rutit" ;
|
||||
säga_V = irregV "säga" "sade" "sagt" ;
|
||||
se_V = irregV "se" "såg" "sett" ;
|
||||
sitta_V = irregV "sitta" "satt" "suttit" ;
|
||||
sjuda_V = irregV "sjuda" "sjöd" "sjudit" ;
|
||||
sjunga_V = irregV "sjunga" "sjöng" "sjungit" ;
|
||||
sjunka_V = irregV "sjunka" "sjönk" "sjunkit" ;
|
||||
skära_V = mkV "skära" "skär" "skär" "skar" "skurit" "skuren" ;
|
||||
skina_V = irregV "skina" "sken" "skinit" ;
|
||||
skita_V = irregV "skita" "sket" "skitit" ;
|
||||
skjuta_V = irregV "skjuta" "skjöt" "skjutit" ;
|
||||
skrida_V = irregV "skrida" "skred" "skridit" ;
|
||||
skrika_V = irregV "skrika" "skrek" "skrikit" ;
|
||||
skriva_V = irregV "skriva" "skrev" "skrivit" ;
|
||||
skryta_V = irregV "skryta" "skröt" "skrutit" ;
|
||||
slå_V = irregV "slå" "slog" "slagit" ;
|
||||
slinka_V = irregV "slinka" "slank" "slunkit" ;
|
||||
slippa_V = irregV "slippa" "slapp" "sluppit" ;
|
||||
slita_V = irregV "slita" "slet" "slitit" ;
|
||||
sluta_V = irregV "sluta" "slöt" "slutit" ;
|
||||
smörja_V = irregV "smörja" "smorjde" "smort" ;
|
||||
smita_V = irregV "smita" "smet" "smitit" ;
|
||||
snyta_V = irregV "snyta" "snöt" "snutit" ;
|
||||
sova_V = irregV "sova" "sov" "sovit" ;
|
||||
spinna_V = irregV "spinna" "spann" "spunnit" ;
|
||||
spricka_V = irregV "spricka" "sprack" "spruckit" ;
|
||||
sprida_V = irregV "sprida" "spred" "spridit" ;
|
||||
springa_V = irregV "springa" "sprang" "sprungit" ;
|
||||
stå_V = irregV "stå" "stod" "stått" ;
|
||||
sticka_V = irregV "sticka" "stack" "stuckit" ;
|
||||
stiga_V = irregV "stiga" "steg" "stigit" ;
|
||||
stinka_V = irregV "stinka" "stank" "stunkit" ;
|
||||
strida_V = irregV "strida" "stred" "stridit" ;
|
||||
strypa_V = irregV "strypa" "ströp" "strupit" ;
|
||||
suga_V = irregV "suga" "sög" "sugit" ;
|
||||
supa_V = irregV "supa" "söp" "supit" ;
|
||||
svälla_V = irregV "svälla" "svällde" "svällt" ;
|
||||
svida_V = irregV "svida" "sved" "svidit" ;
|
||||
svika_V = irregV "svika" "svek" "svikit" ;
|
||||
sy_V = irregV "sy" "sydde" "sytt" ;
|
||||
taga_V = irregV "taga" "tog" "tagit" ;
|
||||
tiga_V = irregV "tiga" "teg" "tigit" ;
|
||||
tillåta_V = irregV "tillåta" "tillät" "tillåtit" ;
|
||||
tillsluta_V = irregV "tillsluta" "tillslöt" "tillslutit" ;
|
||||
tjuta_V = irregV "tjuta" "tjöt" "tjutit" ;
|
||||
tryta_V = irregV "tryta" "tröt" "trutit" ;
|
||||
tvinga_V = irregV "tvinga" "tvang" "tvungit" ;
|
||||
uppfinna_V = irregV "uppfinna" "uppfann" "uppfunnit" ;
|
||||
uppgiva_V = irregV "uppgiva" "uppgav" "uppgivit" ;
|
||||
upplåta_V = irregV "upplåta" "upplät" "upplåtit" ;
|
||||
uppstiga_V = irregV "uppstiga" "uppsteg" "uppstigit" ;
|
||||
upptaga_V = irregV "upptaga" "upptog" "upptagit" ;
|
||||
utbjuda_V = irregV "utbjuda" "utbjöd" "utbjudit" ;
|
||||
utbrista_V = irregV "utbrista" "utbrast" "utbrustit" ;
|
||||
utesluta_V = irregV "utesluta" "uteslöt" "uteslutit" ;
|
||||
utskriva_V = irregV "utskriva" "utskrev" "utskrivit" ;
|
||||
veta_V = mk6V "veta" "vet" "vet" "visste" "vetat" (variants {}) ;
|
||||
vända_V = irregV "vända" "vände" "vänt" ;
|
||||
vina_V = irregV "vina" "ven" "vinit" ;
|
||||
vinna_V = irregV "vinna" "vann" "vunnit" ;
|
||||
vrida_V = irregV "vrida" "vred" "vridit" ;
|
||||
}
|
||||
39
lib/resource/doc/gfdoc/Lang.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Lang: a Test Module for the Resource Grammar</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Lang: a Test Module for the Resource Grammar</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This grammar is for testing the resource as included in the
|
||||
language-independent API, consisting of a grammar and a lexicon.
|
||||
The grammar without a lexicon is <A HREF="Grammar.html"><CODE>Grammar</CODE></A>,
|
||||
which may be more suitable to open in applications.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Lang =
|
||||
Grammar,
|
||||
Lexicon
|
||||
** {} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Lang.txt -->
|
||||
</BODY></HTML>
|
||||
102
lib/resource/doc/gfdoc/Lex.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Test lexicon</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Test lexicon</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: </I><BR>
|
||||
Last update: Fri Jan 20 18:01:38 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Test lexicon</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<A NAME="toc1"></A>
|
||||
<H1>Test lexicon</H1>
|
||||
<P>
|
||||
This lexicon is used when developing a grammar, and called by
|
||||
<A HREF="Test.html">Test</A>. The full lexicon is divided between
|
||||
<A HREF="Structural.html">Structural</A>, <A HREF="Basic.html">Basic</A>, and <A HREF="Numeral.html">Numeral</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Lex = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Words of open classes
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
walk_V : V ;
|
||||
help_V2 : V2 ;
|
||||
show_V3 : V3 ;
|
||||
want_VV : VV ;
|
||||
claim_VS : VS ;
|
||||
ask_VQ : VQ ;
|
||||
|
||||
dog_N : N ;
|
||||
son_N2 : N2 ;
|
||||
way_N3 : N3 ;
|
||||
|
||||
warm_A : A ;
|
||||
close_A2 : A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Structural words
|
||||
</P>
|
||||
<PRE>
|
||||
only_Predet, all_Predet : Predet ;
|
||||
|
||||
this_Quant : QuantSg ;
|
||||
these_Quant : QuantPl ;
|
||||
|
||||
i_Pron, he_Pron, we_Pron : Pron ;
|
||||
|
||||
whoSg_IP, whoPl_IP : IP ;
|
||||
|
||||
when_IAdv, where_IAdv, why_IAdv : IAdv ;
|
||||
|
||||
whichSg_IDet, whichPl_IDet : IDet ;
|
||||
|
||||
here_Adv : Adv ;
|
||||
|
||||
very_AdA : AdA ;
|
||||
|
||||
always_AdV : AdV ;
|
||||
|
||||
forty_Numeral : Numeral ;
|
||||
|
||||
in_Prep, of_Prep : Prep ;
|
||||
|
||||
and_Conj : Conj ;
|
||||
either7or_DConj : DConj ;
|
||||
|
||||
but_PConj : PConj ;
|
||||
|
||||
if_Subj, because_Subj : Subj ;
|
||||
|
||||
please_Voc : Voc ;
|
||||
|
||||
more_CAdv, less_CAdv : CAdv ;
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Lex.txt -->
|
||||
</BODY></HTML>
|
||||
385
lib/resource/doc/gfdoc/Lexicon.html
Normal file
@@ -0,0 +1,385 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Last update: 2007-06-04 14:10:04 CEST
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Lexicon = Cat ** {
|
||||
fun
|
||||
add_V3 : V3 ;
|
||||
airplane_N : N ;
|
||||
already_Adv : Adv ;
|
||||
animal_N : N ;
|
||||
answer_V2S : V2 ;
|
||||
apartment_N : N ;
|
||||
apple_N : N ;
|
||||
art_N : N ;
|
||||
ashes_N : N ;
|
||||
ask_V2Q : V2 ;
|
||||
baby_N : N ;
|
||||
back_N : N ;
|
||||
bad_A : A ;
|
||||
bank_N : N ;
|
||||
bark_N : N ;
|
||||
beautiful_A : A ;
|
||||
become_VA : VA ;
|
||||
beer_N : N ;
|
||||
beg_V2V : V2 ;
|
||||
belly_N : N ;
|
||||
big_A : A ;
|
||||
bike_N : N ;
|
||||
bird_N : N ;
|
||||
bite_V2 : V2 ;
|
||||
black_A : A ;
|
||||
blood_N : N ;
|
||||
blow_V : V ;
|
||||
blue_A : A ;
|
||||
boat_N : N ;
|
||||
bone_N : N ;
|
||||
book_N : N ;
|
||||
boot_N : N ;
|
||||
boss_N : N ;
|
||||
boy_N : N ;
|
||||
bread_N : N ;
|
||||
break_V2 : V2 ;
|
||||
breast_N : N ;
|
||||
breathe_V : V ;
|
||||
broad_A : A ;
|
||||
brother_N2 : N2 ;
|
||||
brown_A : A ;
|
||||
burn_V : V ;
|
||||
butter_N : N ;
|
||||
buy_V2 : V2 ;
|
||||
camera_N : N ;
|
||||
cap_N : N ;
|
||||
car_N : N ;
|
||||
carpet_N : N ;
|
||||
cat_N : N ;
|
||||
ceiling_N : N ;
|
||||
chair_N : N ;
|
||||
cheese_N : N ;
|
||||
child_N : N ;
|
||||
church_N : N ;
|
||||
city_N : N ;
|
||||
clean_A : A ;
|
||||
clever_A : A ;
|
||||
close_V2 : V2 ;
|
||||
cloud_N : N ;
|
||||
coat_N : N ;
|
||||
cold_A : A ;
|
||||
come_V : V ;
|
||||
computer_N : N ;
|
||||
correct_A : A ;
|
||||
country_N : N ;
|
||||
count_V2 : V2 ;
|
||||
cousin_N : N ;
|
||||
cow_N : N ;
|
||||
cut_V2 : V2 ;
|
||||
day_N : N ;
|
||||
die_V : V ;
|
||||
dig_V : V ;
|
||||
dirty_A : A ;
|
||||
distance_N3 : N3 ;
|
||||
doctor_N : N ;
|
||||
dog_N : N ;
|
||||
door_N : N ;
|
||||
do_V2 : V2 ;
|
||||
drink_V2 : V2 ;
|
||||
drink_V2 : V2 ;
|
||||
dry_A : A ;
|
||||
dull_A : A ;
|
||||
dust_N : N ;
|
||||
ear_N : N ;
|
||||
earth_N : N ;
|
||||
easy_A2V : A2 ;
|
||||
eat_V2 : V2 ;
|
||||
eat_V2 : V2 ;
|
||||
egg_N : N ;
|
||||
empty_A : A ;
|
||||
enemy_N : N ;
|
||||
eye_N : N ;
|
||||
factory_N : N ;
|
||||
fall_V : V ;
|
||||
far_Adv : Adv ;
|
||||
father_N2 : N2 ;
|
||||
fat_N : N ;
|
||||
fear_VS : VS ;
|
||||
fear_V2 : V2 ;
|
||||
feather_N : N ;
|
||||
fight_V2 : V2 ;
|
||||
find_V2 : V2 ;
|
||||
fingernail_N : N ;
|
||||
fire_N : N ;
|
||||
fish_N : N ;
|
||||
float_V : V ;
|
||||
floor_N : N ;
|
||||
flower_N : N ;
|
||||
flow_V : V ;
|
||||
fly_V : V ;
|
||||
fog_N : N ;
|
||||
foot_N : N ;
|
||||
forest_N : N ;
|
||||
forget_V2 : V2 ;
|
||||
freeze_V : V ;
|
||||
fridge_N : N ;
|
||||
friend_N : N ;
|
||||
fruit_N : N ;
|
||||
full_A : A ;
|
||||
fun
|
||||
fun_AV : A ;
|
||||
garden_N : N ;
|
||||
girl_N : N ;
|
||||
give_V3 : V3 ;
|
||||
glove_N : N ;
|
||||
gold_N : N ;
|
||||
good_A : A ;
|
||||
go_V : V ;
|
||||
grammar_N : N ;
|
||||
grass_N : N ;
|
||||
green_A : A ;
|
||||
guts_N : N ;
|
||||
hair_N : N ;
|
||||
hand_N : N ;
|
||||
harbour_N : N ;
|
||||
hate_V2 : V2 ;
|
||||
hat_N : N ;
|
||||
have_V2 : V2 ;
|
||||
head_N : N ;
|
||||
heart_N : N ;
|
||||
hear_V2 : V2 ;
|
||||
hear_V2 : V2 ;
|
||||
heavy_A : A ;
|
||||
hill_N : N ;
|
||||
hit_V2 : V2 ;
|
||||
hold_V2 : V2 ;
|
||||
hope_VS : VS ;
|
||||
horn_N : N ;
|
||||
horse_N : N ;
|
||||
hot_A : A ;
|
||||
house_N : N ;
|
||||
hunt_V2 : V2 ;
|
||||
husband_N : N ;
|
||||
ice_N : N ;
|
||||
important_A : A ;
|
||||
industry_N : N ;
|
||||
iron_N : N ;
|
||||
john_PN : PN ;
|
||||
jump_V : V ;
|
||||
kill_V2 : V2 ;
|
||||
king_N : N ;
|
||||
knee_N : N ;
|
||||
know_V2 : V2 ;
|
||||
know_V2 : V2 ;
|
||||
lake_N : N ;
|
||||
lamp_N : N ;
|
||||
language_N : N ;
|
||||
laugh_V : V ;
|
||||
leaf_N : N ;
|
||||
learn_V2 : V2 ;
|
||||
leather_N : N ;
|
||||
leave_V2 : V2 ;
|
||||
left_Ord : Ord ;
|
||||
leg_N : N ;
|
||||
lie_V : V ;
|
||||
like_V2 : V2 ;
|
||||
listen_V2 : V2 ;
|
||||
liver_N : N ;
|
||||
live_V : V ;
|
||||
long_A : A ;
|
||||
lose_V2 : V2 ;
|
||||
louse_N : N ;
|
||||
love_N : N ;
|
||||
love_V2 : V2 ;
|
||||
man_N : N ;
|
||||
married_A2 : A2 ;
|
||||
meat_N : N ;
|
||||
milk_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
mountain_N : N ;
|
||||
mouth_N : N ;
|
||||
music_N : N ;
|
||||
name_N : N ;
|
||||
narrow_A : A ;
|
||||
near_A : A ;
|
||||
neck_N : N ;
|
||||
new_A : A ;
|
||||
newspaper_N : N ;
|
||||
night_N : N ;
|
||||
nose_N : N ;
|
||||
now_Adv : Adv ;
|
||||
number_N : N ;
|
||||
oil_N : N ;
|
||||
old_A : A ;
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
paris_PN : PN ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
person_N : N ;
|
||||
planet_N : N ;
|
||||
plastic_N : N ;
|
||||
play_V2 : V2 ;
|
||||
play_V : V ;
|
||||
policeman_N : N ;
|
||||
priest_N : N ;
|
||||
probable_AS : A ;
|
||||
pull_V2 : V2 ;
|
||||
push_V2 : V2 ;
|
||||
put_V2 : V2 ;
|
||||
queen_N : N ;
|
||||
question_N : N ;
|
||||
radio_N : N ;
|
||||
rain_N : N ;
|
||||
rain_V0 : V ;
|
||||
read_V2 : V2 ;
|
||||
ready_A : A ;
|
||||
reason_N : N ;
|
||||
red_A : A ;
|
||||
religion_N : N ;
|
||||
restaurant_N : N ;
|
||||
right_Ord : Ord ;
|
||||
river_N : N ;
|
||||
road_N : N ;
|
||||
rock_N : N ;
|
||||
roof_N : N ;
|
||||
root_N : N ;
|
||||
rope_N : N ;
|
||||
rotten_A : A ;
|
||||
round_A : A ;
|
||||
rubber_N : N ;
|
||||
rub_V2 : V2 ;
|
||||
rule_N : N ;
|
||||
run_V : V ;
|
||||
salt_N : N ;
|
||||
sand_N : N ;
|
||||
say_VS : VS ;
|
||||
school_N : N ;
|
||||
science_N : N ;
|
||||
scratch_V2 : V2 ;
|
||||
sea_N : N ;
|
||||
seed_N : N ;
|
||||
seek_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
sell_V3 : V3 ;
|
||||
send_V3 : V3 ;
|
||||
sew_V : V ;
|
||||
sharp_A : A ;
|
||||
sheep_N : N ;
|
||||
ship_N : N ;
|
||||
shirt_N : N ;
|
||||
shoe_N : N ;
|
||||
shop_N : N ;
|
||||
short_A : A ;
|
||||
silver_N : N ;
|
||||
sing_V : V ;
|
||||
sister_N : N ;
|
||||
sit_V : V ;
|
||||
skin_N : N ;
|
||||
sky_N : N ;
|
||||
sleep_V : V ;
|
||||
small_A : A ;
|
||||
smell_V : V ;
|
||||
smoke_N : N ;
|
||||
smooth_A : A ;
|
||||
snake_N : N ;
|
||||
snow_N : N ;
|
||||
sock_N : N ;
|
||||
song_N : N ;
|
||||
speak_V2 : V2 ;
|
||||
spit_V : V ;
|
||||
split_V2 : V2 ;
|
||||
squeeze_V2 : V2 ;
|
||||
stab_V2 : V2 ;
|
||||
stand_V : V ;
|
||||
star_N : N ;
|
||||
steel_N : N ;
|
||||
stick_N : N ;
|
||||
stone_N : N ;
|
||||
stop_V : V ;
|
||||
stove_N : N ;
|
||||
straight_A : A ;
|
||||
student_N : N ;
|
||||
stupid_A : A ;
|
||||
suck_V2 : V2 ;
|
||||
sun_N : N ;
|
||||
swell_V : V ;
|
||||
swim_V : V ;
|
||||
switch8off_V2 : V2 ;
|
||||
switch8on_V2 : V2 ;
|
||||
table_N : N ;
|
||||
tail_N : N ;
|
||||
talk_V3 : V3 ;
|
||||
teacher_N : N ;
|
||||
teach_V2 : V2 ;
|
||||
television_N : N ;
|
||||
thick_A : A ;
|
||||
thin_A : A ;
|
||||
think_V : V ;
|
||||
throw_V2 : V2 ;
|
||||
tie_V2 : V2 ;
|
||||
today_Adv : Adv ;
|
||||
tongue_N : N ;
|
||||
tooth_N : N ;
|
||||
train_N : N ;
|
||||
travel_V : V ;
|
||||
tree_N : N ;
|
||||
turn_V : V ;
|
||||
ugly_A : A ;
|
||||
uncertain_A : A ;
|
||||
understand_V2 : V2 ;
|
||||
university_N : N ;
|
||||
village_N : N ;
|
||||
vomit_V : V ;
|
||||
wait_V2 : V2 ;
|
||||
walk_V : V ;
|
||||
warm_A : A ;
|
||||
war_N : N ;
|
||||
wash_V2 : V2 ;
|
||||
watch_V2 : V2 ;
|
||||
water_N : N ;
|
||||
wet_A : A ;
|
||||
white_A : A ;
|
||||
wide_A : A ;
|
||||
wife_N : N ;
|
||||
wind_N : N ;
|
||||
window_N : N ;
|
||||
wine_N : N ;
|
||||
wing_N : N ;
|
||||
win_V2 : V2 ;
|
||||
wipe_V2 : V2 ;
|
||||
woman_N : N ;
|
||||
wonder_VQ : VQ ;
|
||||
wood_N : N ;
|
||||
worm_N : N ;
|
||||
write_V2 : V2 ;
|
||||
year_N : N ;
|
||||
yellow_A : A ;
|
||||
young_A : A ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Lexicon.txt -->
|
||||
</BODY></HTML>
|
||||
59
lib/resource/doc/gfdoc/ListConjunction.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Author:
|
||||
Last update: Fri Jan 20 18:01:38 2006
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
==
|
||||
</P>
|
||||
<PRE>
|
||||
abstract ListConjunction = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
ConjS : Conj -> [S] -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> [AP] -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> [NP] -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> [Adv] -> Adv ; -- "quickly or slowly"
|
||||
|
||||
DConjS : DConj -> [S] -> S ; -- "either John walks or Mary runs"
|
||||
DConjAP : DConj -> [AP] -> AP ; -- "both even and prime"
|
||||
DConjNP : DConj -> [NP] -> NP ; -- "either John or Mary"
|
||||
DConjAdv : DConj -> [Adv] -> Adv ; -- "both badly and slowly"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
These categories are internal to this module.
|
||||
</P>
|
||||
<PRE>
|
||||
cat
|
||||
[S]{2} ;
|
||||
[Adv]{2} ;
|
||||
[NP]{2} ;
|
||||
[AP]{2} ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/ListConjunction.txt -->
|
||||
</BODY></HTML>
|
||||
72
lib/resource/doc/gfdoc/Mathematical.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> The Mathematics API to the Resource Grammar</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> The Mathematics API to the Resource Grammar</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-02-28 09:26:58 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This grammar is a collection of the different modules.
|
||||
It differs from <CODE>Lang</CODE> in two main ways:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the combinations in Noun, Verb, Adjective, Adverb, Sentence are not included
|
||||
<LI>instead, Symbol and Predication are used
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
In practice, the most important difference is that only present-tense sentences
|
||||
are included, and that symbolic expressions are recognized as NPs.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Mathematical =
|
||||
Noun - [ComplN2], --- to avoid ambiguity
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Verb,
|
||||
</P>
|
||||
<PRE>
|
||||
Adjective,
|
||||
Adverb,
|
||||
Numeral,
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Sentence,
|
||||
</P>
|
||||
<PRE>
|
||||
Question,
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Text,
|
||||
Idiom,
|
||||
Structural,
|
||||
|
||||
Symbol,
|
||||
Predication,
|
||||
|
||||
Lexicon
|
||||
** {} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc mathematical/Mathematical.txt -->
|
||||
</BODY></HTML>
|
||||
80
lib/resource/doc/gfdoc/Multi.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Multimodal additions to the resource grammar library</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Multimodal additions to the resource grammar library</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-05-24 15:08:56 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Multi = Lang ** {
|
||||
|
||||
cat
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Entrypoint for speech recognition - suppresses clicks.
|
||||
</P>
|
||||
<PRE>
|
||||
Speech ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The entrypoint to sequencialized multimodal input is <CODE>Phr</CODE>.
|
||||
The pointing gesture (click) type.
|
||||
</P>
|
||||
<PRE>
|
||||
Point ;
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The top function to send an utterance to speech recognizer.
|
||||
</P>
|
||||
<PRE>
|
||||
SpeechUtt : PConj -> Utt -> Voc -> Speech ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Demonstratives.
|
||||
</P>
|
||||
<PRE>
|
||||
this8point_NP : Point -> NP ;
|
||||
that8point_NP : Point -> NP ;
|
||||
these8point_NP : Point -> NP ;
|
||||
those8point_NP : Point -> NP ;
|
||||
here8point_Adv : Point -> Adv ;
|
||||
here7to8point_Adv : Point -> Adv ;
|
||||
here7from8point_Adv : Point -> Adv ;
|
||||
this8point_Quant : Point -> Quant ;
|
||||
that8point_Quant : Point -> Quant ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Building points from strings.
|
||||
</P>
|
||||
<PRE>
|
||||
MkPoint : String -> Point ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc multimodal/Multi.txt -->
|
||||
</BODY></HTML>
|
||||
55
lib/resource/doc/gfdoc/Multimodal.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Last update: 2006-02-25 21:46:53 CET
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Multimodal =
|
||||
Noun,
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Verb,
|
||||
</P>
|
||||
<PRE>
|
||||
Adjective,
|
||||
Adverb,
|
||||
Numeral,
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Sentence,
|
||||
Question,
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Tensed,
|
||||
</P>
|
||||
<PRE>
|
||||
Structural,
|
||||
Demonstrative,
|
||||
Lexicon
|
||||
** {} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc multimodal/Multimodal.txt -->
|
||||
</BODY></HTML>
|
||||
224
lib/resource/doc/gfdoc/Noun.html
Normal file
@@ -0,0 +1,224 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Noun: Nouns, noun phrases, and determiners</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Noun: Nouns, noun phrases, and determiners</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Noun phrases</A>
|
||||
<LI><A HREF="#toc2">Determiners</A>
|
||||
<LI><A HREF="#toc3">Common nouns</A>
|
||||
<LI><A HREF="#toc4">Apposition</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Noun = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Noun phrases</H2>
|
||||
<P>
|
||||
The three main types of noun phrases are
|
||||
</P>
|
||||
<UL>
|
||||
<LI>common nouns with determiners
|
||||
<LI>proper names
|
||||
<LI>pronouns
|
||||
</UL>
|
||||
|
||||
<PRE>
|
||||
fun
|
||||
DetCN : Det -> CN -> NP ; -- the man
|
||||
UsePN : PN -> NP ; -- John
|
||||
UsePron : Pron -> NP ; -- he
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Pronouns are defined in the module <A HREF="Structural.html"><CODE>Structural</CODE></A>.
|
||||
A noun phrase already formed can be modified by a <CODE>Predet</CODE>erminer.
|
||||
</P>
|
||||
<PRE>
|
||||
PredetNP : Predet -> NP -> NP; -- only the man
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A noun phrase can also be postmodified by the past participle of a
|
||||
verb or by an adverb.
|
||||
</P>
|
||||
<PRE>
|
||||
PPartNP : NP -> V2 -> NP ; -- the number squared
|
||||
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Determiners</H2>
|
||||
<P>
|
||||
The determiner has a fine-grained structure, in which a 'nucleus'
|
||||
quantifier and two optional parts can be discerned.
|
||||
The cardinal numeral is only available for plural determiners.
|
||||
(This is modified from CLE by further dividing their <CODE>Num</CODE> into
|
||||
cardinal and ordinal.)
|
||||
</P>
|
||||
<PRE>
|
||||
DetSg : QuantSg -> Ord -> Det ; -- this best man
|
||||
DetPl : QuantPl -> Num -> Ord -> Det ; -- these five best men
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Quantifiers that have both forms can be used in both ways.
|
||||
</P>
|
||||
<PRE>
|
||||
SgQuant : Quant -> QuantSg ; -- this
|
||||
PlQuant : Quant -> QuantPl ; -- these
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Pronouns have possessive forms. Genitives of other kinds
|
||||
of noun phrases are not given here, since they are not possible
|
||||
in e.g. Romance languages. They can be found in
|
||||
<A HREF="../abstract/Extra.gf"><CODE>Extra</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
PossPron : Pron -> Quant ; -- my (house)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
All parts of the determiner can be empty, except <CODE>Quant</CODE>, which is
|
||||
the <I>kernel</I> of a determiner.
|
||||
</P>
|
||||
<PRE>
|
||||
NoNum : Num ;
|
||||
NoOrd : Ord ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<CODE>Num</CODE> consists of either digits or numeral words.
|
||||
</P>
|
||||
<PRE>
|
||||
NumInt : Int -> Num ; -- 51
|
||||
NumNumeral : Numeral -> Num ; -- fifty-one
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The construction of numerals is defined in <A HREF="Numeral.html">Numeral</A>.
|
||||
<CODE>Num</CODE> can be modified by certain adverbs.
|
||||
</P>
|
||||
<PRE>
|
||||
AdNum : AdN -> Num -> Num ; -- almost 51
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<CODE>Ord</CODE> consists of either digits or numeral words.
|
||||
</P>
|
||||
<PRE>
|
||||
OrdInt : Int -> Ord ; -- 51st
|
||||
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Superlative forms of adjectives behave syntactically in the same way as
|
||||
ordinals.
|
||||
</P>
|
||||
<PRE>
|
||||
OrdSuperl : A -> Ord ; -- largest
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Definite and indefinite constructions are sometimes realized as
|
||||
neatly distinct words (Spanish <I>un, unos ; el, los</I>) but also without
|
||||
any particular word (Finnish; Swedish definites).
|
||||
</P>
|
||||
<PRE>
|
||||
DefArt : Quant ; -- the (house), the (houses)
|
||||
IndefArt : Quant ; -- a (house), (houses)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns can be used without an article as mass nouns. The resource does
|
||||
not distinguish mass nouns from other common nouns, which can result
|
||||
in semantically odd expressions.
|
||||
</P>
|
||||
<PRE>
|
||||
MassDet : QuantSg ; -- (beer)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Other determiners are defined in <A HREF="Structural.html">Structural</A>.
|
||||
</P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Common nouns</H2>
|
||||
<P>
|
||||
Simple nouns can be used as nouns outright.
|
||||
</P>
|
||||
<PRE>
|
||||
UseN : N -> CN ; -- house
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Relational nouns take one or two arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
ComplN2 : N2 -> NP -> CN ; -- son of the king
|
||||
ComplN3 : N3 -> NP -> N2 ; -- flight from Moscow (to Paris)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Relational nouns can also be used without their arguments.
|
||||
The semantics is typically derivative of the relational meaning.
|
||||
</P>
|
||||
<PRE>
|
||||
UseN2 : N2 -> CN ; -- son
|
||||
UseN3 : N3 -> CN ; -- flight
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns can be modified by adjectives, relative clauses, and adverbs
|
||||
(the last rule will give rise to many 'PP attachment' ambiguities
|
||||
when used in connection with verb phrases).
|
||||
</P>
|
||||
<PRE>
|
||||
AdjCN : AP -> CN -> CN ; -- big house
|
||||
RelCN : CN -> RS -> CN ; -- house that John owns
|
||||
AdvCN : CN -> Adv -> CN ; -- house on the hill
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns can also be modified by embedded sentences and questions.
|
||||
For some nouns this makes little sense, but we leave this for applications
|
||||
to decide. Sentential complements are defined in <A HREF="Verb.html">Verb</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
SentCN : CN -> SC -> CN ; -- fact that John smokes, question if he does
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Apposition</H2>
|
||||
<P>
|
||||
This is certainly overgenerating.
|
||||
</P>
|
||||
<PRE>
|
||||
ApposCN : CN -> NP -> CN ; -- number x, numbers x and y
|
||||
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Noun.txt -->
|
||||
</BODY></HTML>
|
||||
79
lib/resource/doc/gfdoc/Numeral.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Numerals</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Numerals</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This grammar defines numerals from 1 to 999999.
|
||||
The implementations are adapted from the
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/GF/examples/numerals/">numerals library</A>
|
||||
which defines numerals for 88 languages.
|
||||
The resource grammar implementations add to this inflection (if needed)
|
||||
and ordinal numbers.
|
||||
</P>
|
||||
<P>
|
||||
<B>Note</B> 1. Number 1 as defined
|
||||
in the category <CODE>Numeral</CODE> here should not be used in the formation of
|
||||
noun phrases, and should therefore be removed. Instead, one should use
|
||||
<A HREF="Structural.html">Structural</A><CODE>.one_Quant</CODE>. This makes the grammar simpler
|
||||
because we can assume that numbers form plural noun phrases.
|
||||
</P>
|
||||
<P>
|
||||
<B>Note</B> 2. The implementations introduce spaces between
|
||||
parts of a numeral, which is often incorrect - more work on
|
||||
(un)lexing is needed to solve this problem.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Numeral = Cat ** {
|
||||
|
||||
cat
|
||||
Digit ; -- 2..9
|
||||
Sub10 ; -- 1..9
|
||||
Sub100 ; -- 1..99
|
||||
Sub1000 ; -- 1..999
|
||||
Sub1000000 ; -- 1..999999
|
||||
|
||||
fun
|
||||
num : Sub1000000 -> Numeral ;
|
||||
|
||||
n2, n3, n4, n5, n6, n7, n8, n9 : Digit ;
|
||||
|
||||
pot01 : Sub10 ; -- 1
|
||||
pot0 : Digit -> Sub10 ; -- d * 1
|
||||
pot110 : Sub100 ; -- 10
|
||||
pot111 : Sub100 ; -- 11
|
||||
pot1to19 : Digit -> Sub100 ; -- 10 + d
|
||||
pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9
|
||||
pot1 : Digit -> Sub100 ; -- d * 10
|
||||
pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
|
||||
pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99
|
||||
pot2 : Sub10 -> Sub1000 ; -- m * 100
|
||||
pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
|
||||
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Numeral.txt -->
|
||||
</BODY></HTML>
|
||||
410
lib/resource/doc/gfdoc/ParadigmsDan.html
Normal file
@@ -0,0 +1,410 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Danish Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Danish Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 10:12:24 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Compound nouns</A>
|
||||
<LI><A HREF="#toc4">Relational nouns</A>
|
||||
<LI><A HREF="#toc5">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc6">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc7">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc8">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc9">Adverbs</A>
|
||||
<LI><A HREF="#toc10">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc11">Verbs with a particle.</A>
|
||||
<LI><A HREF="#toc12">Verbs with 'være' as auxiliary</A>
|
||||
<LI><A HREF="#toc13">Deponent verbs</A>
|
||||
<LI><A HREF="#toc14">Two-place verbs</A>
|
||||
<LI><A HREF="#toc15">Three-place verbs</A>
|
||||
<LI><A HREF="#toc16">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2005 - 2006
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoDan.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed: we have a
|
||||
separate module <A HREF="../../danish/IrregDan.gf"><CODE>IrregDan</CODE></A>,
|
||||
which haves a list of irregular verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsDan =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonScand,
|
||||
ResDan,
|
||||
MorphoDan,
|
||||
CatDan in {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
utrum : Gender ;
|
||||
neutrum : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions are just strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ; -- empty string
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function takes the singular indefinite form
|
||||
and computes the other forms and the gender by a heuristic.
|
||||
The heuristic is that all nouns are <CODE>utrum</CODE> with the
|
||||
plural ending <I>er</I> or <I>r</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (bil : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Giving gender manually makes the heuristic more reliable.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (hus : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This function takes the singular indefinite and definite forms; the
|
||||
gender is computed from the definite form.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (bil,bilen : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This function takes the singular indefinite and definite and the plural
|
||||
indefinite
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (bil,bilen,biler : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Worst case: give all four forms. The gender is computed from the
|
||||
last letter of the second form (if <I>n</I>, then <CODE>utrum</CODE>, otherwise <CODE>neutrum</CODE>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (dreng,drengen,drenge,drengene : Str) -> N ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Compound nouns</H3>
|
||||
<P>
|
||||
All the functions above work quite as well to form compound nouns,
|
||||
such as <I>fodbold</I>.
|
||||
</P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>datter til x</I>) need a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The most common preposition is <I>af</I>, and the following is a
|
||||
shortcut for regular relational nouns with <I>af</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
regN2 : Str -> Gender -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Use the function <CODE>mkPrep</CODE> or see the section on prepositions below to
|
||||
form other prepositions.
|
||||
</P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>forbindelse fra x til y</I>)
|
||||
need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>tidligere kone til</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names, with a regular genitive, are formed as follows
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- utrum
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
mkPN : N -> PN ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<P>
|
||||
The regular pattern works for many adjectives, e.g. those ending
|
||||
with <I>ig</I>. Two, five, or at worst five forms are sometimes needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
mkA : (fin : Str) -> A ;
|
||||
mkA : (fin,fint : Str) -> A ;
|
||||
mkA : (galen,galet,galne : Str) -> A ;
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
If comparison is formed by <I>mer</I>, <I>mest</I>, as in general for
|
||||
long adjective, the following pattern is used:
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : A -> A ; -- -/mer/mest norsk
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb. Some can be close to the verb like the negation
|
||||
<I>ikke</I> (e.g. <I>altid</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H2>Verbs</H2>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The 'regular verb' function is the first conjugation.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (snakke : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The almost regular verb function needs the infinitive and the preteritum.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (leve,levde : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
There is an extensive list of irregular verbs in the module <CODE>IrregDan</CODE>.
|
||||
In practice, it is enough to give three forms, as in school books.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The worst case needs six forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Verbs with a particle.</H3>
|
||||
<P>
|
||||
The particle, such as in <I>lukke op</I>, is given as a string.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : V -> Str -> V ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Verbs with 'være' as auxiliary</H3>
|
||||
<P>
|
||||
By default, the auxiliary is <I>have</I>. This function changes it to <I>være</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
vaereV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Deponent verbs</H3>
|
||||
<P>
|
||||
Some words are used in passive forms only, e.g. <I>undres</I>, some as
|
||||
reflexive e.g. <I>forestille sig</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc14"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs). Notice that, if a particle is needed, it comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc15"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om
|
||||
dirV3 : V -> Prep -> V3 ; -- give,_,til
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc16"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc danish/ParadigmsDan.txt -->
|
||||
</BODY></HTML>
|
||||
595
lib/resource/doc/gfdoc/ParadigmsDut.html
Normal file
@@ -0,0 +1,595 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Author:
|
||||
Last update: Tue Jan 17 15:24:36 2006
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
==
|
||||
</P>
|
||||
<P>
|
||||
--# -path=.:../abstract:../../prelude
|
||||
</P>
|
||||
<P>
|
||||
--1 Dutlish Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003--2005
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
--
|
||||
-- The main difference with <CODE>MorphoDut.gf</CODE> is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
-- escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module <CODE>IrregularDut</CODE>, which covers all irregularly inflected
|
||||
-- words.
|
||||
--
|
||||
-- The following modules are presupposed:
|
||||
</P>
|
||||
<P>
|
||||
resource ParadigmsDut = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoDut,
|
||||
CatDut
|
||||
in {
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<P>
|
||||
oper
|
||||
Gender : Type ;
|
||||
</P>
|
||||
<P>
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
masculine : Gender ;
|
||||
feminite : Gender ;
|
||||
</P>
|
||||
<P>
|
||||
-- To abstract over number names, we define the following.
|
||||
</P>
|
||||
<P>
|
||||
Number : Type ;
|
||||
</P>
|
||||
<P>
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</P>
|
||||
<P>
|
||||
-- To abstract over case names, we define the following.
|
||||
</P>
|
||||
<P>
|
||||
Case : Type ;
|
||||
</P>
|
||||
<P>
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
</P>
|
||||
<P>
|
||||
-- Prepositions are used in many-argument functions for rection.
|
||||
</P>
|
||||
<P>
|
||||
Preposition : Type ;
|
||||
</P>
|
||||
<P>
|
||||
--2 Nouns
|
||||
</P>
|
||||
<P>
|
||||
-- Worst case: give all four forms and the semantic gender.
|
||||
</P>
|
||||
<P>
|
||||
mkN : (man,men,man's,men's : Str) -> N ;
|
||||
</P>
|
||||
<P>
|
||||
-- The regular function captures the variants for nouns ending with
|
||||
-- <I>s</I>,<I>sh</I>,<I>x</I>,<I>z</I> or <I>y</I>: <I>kiss - kisses</I>, <I>flash - flashes</I>;
|
||||
-- <I>fly - flies</I> (but <I>toy - toys</I>),
|
||||
</P>
|
||||
<P>
|
||||
regN : Str -> N ;
|
||||
</P>
|
||||
<P>
|
||||
-- In practice the worst case is just: give singular and plural nominative.
|
||||
</P>
|
||||
<P>
|
||||
mk2N : (man,men : Str) -> N ;
|
||||
</P>
|
||||
<P>
|
||||
-- All nouns created by the previous functions are marked as
|
||||
-- <CODE>nonhuman</CODE>. If you want a <CODE>human</CODE> noun, wrap it with the following
|
||||
-- function:
|
||||
</P>
|
||||
<P>
|
||||
genderN : Gender -> N -> N ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Compound nouns
|
||||
--
|
||||
-- All the functions above work quite as well to form compound nouns,
|
||||
-- such as <I>baby boom</I>.
|
||||
</P>
|
||||
<P>
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns (<I>daughter of x</I>) need a preposition.
|
||||
</P>
|
||||
<P>
|
||||
mkN2 : N -> Preposition -> N2 ;
|
||||
</P>
|
||||
<P>
|
||||
-- The most common preposition is <I>of</I>, and the following is a
|
||||
-- shortcut for regular, <CODE>nonhuman</CODE> relational nouns with <I>of</I>.
|
||||
</P>
|
||||
<P>
|
||||
regN2 : Str -> N2 ;
|
||||
</P>
|
||||
<P>
|
||||
-- Use the function <CODE>mkPreposition</CODE> or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
--
|
||||
-- Three-place relational nouns (<I>the connection from x to y</I>) need two prepositions.
|
||||
</P>
|
||||
<P>
|
||||
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Relational common noun phrases
|
||||
--
|
||||
-- In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
-- relational noun (e.g. <I>the old town hall of</I>).
|
||||
</P>
|
||||
<P>
|
||||
cnN2 : CN -> Preposition -> N2 ;
|
||||
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
||||
</P>
|
||||
<P>
|
||||
--
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed as follows
|
||||
</P>
|
||||
<P>
|
||||
regPN : Str -> Gender -> PN ; -- John, John's
|
||||
</P>
|
||||
<P>
|
||||
-- Sometimes you can reuse a common noun as a proper name, e.g. <I>Bank</I>.
|
||||
</P>
|
||||
<P>
|
||||
nounPN : N -> PN ;
|
||||
</P>
|
||||
<P>
|
||||
-- To form a noun phrase that can also be plural and have an irregular
|
||||
-- genitive, you can use the worst-case function.
|
||||
</P>
|
||||
<P>
|
||||
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
||||
</P>
|
||||
<P>
|
||||
--2 Adjectives
|
||||
</P>
|
||||
<P>
|
||||
-- Non-comparison one-place adjectives need two forms: one for
|
||||
-- the adjectival and one for the adverbial form (<I>free - freely</I>)
|
||||
</P>
|
||||
<P>
|
||||
mkA : (free,freely : Str) -> A ;
|
||||
</P>
|
||||
<P>
|
||||
-- For regular adjectives, the adverbial form is derived. This holds
|
||||
-- even for cases with the variation <I>happy - happily</I>.
|
||||
</P>
|
||||
<P>
|
||||
regA : Str -> A ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<P>
|
||||
mkA2 : A -> Preposition -> A2 ;
|
||||
</P>
|
||||
<P>
|
||||
-- Comparison adjectives may two more forms.
|
||||
</P>
|
||||
<P>
|
||||
ADeg : Type ;
|
||||
</P>
|
||||
<P>
|
||||
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||
</P>
|
||||
<P>
|
||||
-- The regular pattern recognizes two common variations:
|
||||
-- <I>-e</I> (<I>rude</I> - <I>ruder</I> - <I>rudest</I>) and
|
||||
-- <I>-y</I> (<I>happy - happier - happiest - happily</I>)
|
||||
</P>
|
||||
<P>
|
||||
regADeg : Str -> ADeg ; -- long, longer, longest
|
||||
</P>
|
||||
<P>
|
||||
-- However, the duplication of the final consonant is nor predicted,
|
||||
-- but a separate pattern is used:
|
||||
</P>
|
||||
<P>
|
||||
duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||
</P>
|
||||
<P>
|
||||
-- If comparison is formed by <I>more, //most</I>, as in general for//
|
||||
-- long adjective, the following pattern is used:
|
||||
</P>
|
||||
<P>
|
||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||
</P>
|
||||
<P>
|
||||
-- From a given <CODE>ADeg</CODE>, it is possible to get back to <CODE>A</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
adegA : ADeg -> A ;
|
||||
</P>
|
||||
<P>
|
||||
--2 Adverbs
|
||||
</P>
|
||||
<P>
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb. Some can be preverbal (e.g. <I>always</I>).
|
||||
</P>
|
||||
<P>
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
</P>
|
||||
<P>
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<P>
|
||||
mkAdA : Str -> AdA ;
|
||||
</P>
|
||||
<P>
|
||||
--2 Prepositions
|
||||
--
|
||||
-- A preposition as used for rection in the lexicon, as well as to
|
||||
-- build <CODE>PP</CODE>s in the resource API, just requires a string.
|
||||
</P>
|
||||
<P>
|
||||
mkPreposition : Str -> Preposition ;
|
||||
mkPrep : Str -> Prep ;
|
||||
</P>
|
||||
<P>
|
||||
-- (These two functions are synonyms.)
|
||||
</P>
|
||||
<P>
|
||||
--2 Verbs
|
||||
--
|
||||
-- Except for <I>be</I>, the worst case needs five forms: the infinitive and
|
||||
-- the third person singular present, the past indicative, and the
|
||||
-- past and present participles.
|
||||
</P>
|
||||
<P>
|
||||
mkV : (go, goes, went, gone, going : Str) -> V ;
|
||||
</P>
|
||||
<P>
|
||||
-- The regular verb function recognizes the special cases where the last
|
||||
-- character is <I>y</I> (<I>cry - cries</I> but <I>buy - buys</I>) or <I>s</I>, <I>sh</I>, <I>x</I>, <I>z</I>
|
||||
-- (<I>fix - fixes</I>, etc).
|
||||
</P>
|
||||
<P>
|
||||
regV : Str -> V ;
|
||||
</P>
|
||||
<P>
|
||||
-- The following variant duplicates the last letter in the forms like
|
||||
-- <I>rip - ripped - ripping</I>.
|
||||
</P>
|
||||
<P>
|
||||
regDuplV : Str -> V ;
|
||||
</P>
|
||||
<P>
|
||||
-- There is an extensive list of irregular verbs in the module <CODE>IrregularDut</CODE>.
|
||||
-- In practice, it is enough to give three forms,
|
||||
-- e.g. <I>drink - drank - drunk</I>, with a variant indicating consonant
|
||||
-- duplication in the present participle.
|
||||
</P>
|
||||
<P>
|
||||
irregV : (drink, drank, drunk : Str) -> V ;
|
||||
irregDuplV : (get, got, gotten : Str) -> V ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Verbs with a particle.
|
||||
--
|
||||
-- The particle, such as in <I>switch on</I>, is given as a string.
|
||||
</P>
|
||||
<P>
|
||||
partV : V -> Str -> V ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
mkV2 : V -> Preposition -> V2 ;
|
||||
</P>
|
||||
<P>
|
||||
dirV2 : V -> V2 ;
|
||||
</P>
|
||||
<P>
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
</P>
|
||||
<P>
|
||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
</P>
|
||||
<P>
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<P>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Str -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Str -> Str -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Str -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Str -> V2Q ;
|
||||
</P>
|
||||
<P>
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Str -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Str -> A2V ;
|
||||
</P>
|
||||
<P>
|
||||
-- Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
|
||||
-- just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
-- as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
-- <CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</P>
|
||||
<P>
|
||||
--2 Definitions of paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
--.
|
||||
</P>
|
||||
<P>
|
||||
Gender = MorphoDut.Gender ;
|
||||
Number = MorphoDut.Number ;
|
||||
Case = MorphoDut.Case ;
|
||||
human = Masc ;
|
||||
nonhuman = Neutr ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
</P>
|
||||
<P>
|
||||
Preposition = Str ;
|
||||
</P>
|
||||
<P>
|
||||
regN = \ray ->
|
||||
let
|
||||
ra = Predef.tk 1 ray ;
|
||||
y = Predef.dp 1 ray ;
|
||||
r = Predef.tk 2 ray ;
|
||||
ay = Predef.dp 2 ray ;
|
||||
rays =
|
||||
case y of {
|
||||
<I>y</I> => y2ie ray <I>s</I> ;
|
||||
<I>s</I> => ray + <I>es</I> ;
|
||||
<I>z</I> => ray + <I>es</I> ;
|
||||
<I>x</I> => ray + <I>es</I> ;
|
||||
_ => case ay of {
|
||||
<I>sh</I> => ray + <I>es</I> ;
|
||||
<I>ch</I> => ray + <I>es</I> ;
|
||||
_ => ray + <I>s</I>
|
||||
}
|
||||
}
|
||||
in
|
||||
mk2N ray rays ;
|
||||
</P>
|
||||
<P>
|
||||
mk2N = \man,men ->
|
||||
let mens = case last men of {
|
||||
<I>s</I> => men + <I>'</I> ;
|
||||
_ => men + <I>'s</I>
|
||||
}
|
||||
in
|
||||
mkN man men (man + <I>'s</I>) mens ;
|
||||
</P>
|
||||
<P>
|
||||
mkN = \man,men,man's,men's ->
|
||||
mkNoun man men man's men's **** {g = Neutr ; lock_N = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkN2 = \n,p -> n **** {lock_N2 = <> ; c2 = p} ;
|
||||
regN2 n = mkN2 (regN n) (mkPreposition <I>of</I>) ;
|
||||
mkN3 = \n,p,q -> n **** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
cnN2 = \n,p -> n **** {lock_N2 = <> ; c2 = p} ;
|
||||
cnN3 = \n,p,q -> n **** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
</P>
|
||||
<P>
|
||||
regPN n g = nameReg n g **** {lock_PN = <>} ;
|
||||
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||
mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = (agrP3 n).a ;
|
||||
lock_NP = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkA a b = mkAdjective a a a b **** {lock_A = <>} ;
|
||||
regA a = regAdjective a **** {lock_A = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkA2 a p = a **** {c2 = p ; lock_A2 = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
ADeg = A ; ----
|
||||
</P>
|
||||
<P>
|
||||
mkADeg a b c d = mkAdjective a b c d **** {lock_A = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
regADeg happy =
|
||||
let
|
||||
happ = init happy ;
|
||||
y = last happy ;
|
||||
happie = case y of {
|
||||
<I>y</I> => happ + <I>ie</I> ;
|
||||
<I>e</I> => happy ;
|
||||
_ => happy + <I>e</I>
|
||||
} ;
|
||||
happily = case y of {
|
||||
<I>y</I> => happ + <I>ily</I> ;
|
||||
_ => happy + <I>ly</I>
|
||||
} ;
|
||||
in mkADeg happy (happie + <I>r</I>) (happie + <I>st</I>) happily ;
|
||||
</P>
|
||||
<P>
|
||||
duplADeg fat =
|
||||
mkADeg fat
|
||||
(fat + last fat + <I>er</I>) (fat + last fat + <I>est</I>) (fat + <I>ly</I>) ;
|
||||
</P>
|
||||
<P>
|
||||
compoundADeg a =
|
||||
let ad = (a.s ! AAdj Posit)
|
||||
in mkADeg ad (<I>more</I> ++ ad) (<I>most</I> ++ ad) (a.s ! AAdv) ;
|
||||
</P>
|
||||
<P>
|
||||
adegA a = a ;
|
||||
</P>
|
||||
<P>
|
||||
mkAdv x = ss x **** {lock_Adv = <>} ;
|
||||
mkAdV x = ss x **** {lock_AdV = <>} ;
|
||||
mkAdA x = ss x **** {lock_AdA = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkPreposition p = p ;
|
||||
mkPrep p = ss p **** {lock_Prep = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkV a b c d e = mkVerbWorst a b c d e **** {s1 = [] ; lock_V = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
regV cry =
|
||||
let
|
||||
cr = init cry ;
|
||||
y = last cry ;
|
||||
cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||
crie = init cries ;
|
||||
cried = case last crie of {
|
||||
<I>e</I> => crie + <I>d</I> ;
|
||||
_ => crie + <I>ed</I>
|
||||
} ;
|
||||
crying = case y of {
|
||||
<I>e</I> => case last cr of {
|
||||
<I>e</I> => cry + <I>ing</I> ;
|
||||
_ => cr + <I>ing</I>
|
||||
} ;
|
||||
_ => cry + <I>ing</I>
|
||||
}
|
||||
in mkV cry cries cried cried crying ;
|
||||
</P>
|
||||
<P>
|
||||
regDuplV fit =
|
||||
let fitt = fit + last fit in
|
||||
mkV fit (fit + <I>s</I>) (fitt + <I>ed</I>) (fitt + <I>ed</I>) (fitt + <I>ing</I>) ;
|
||||
</P>
|
||||
<P>
|
||||
irregV x y z = let reg = (regV x).s in
|
||||
mkV x (reg ! VPres) y z (reg ! VPresPart) **** {s1 = [] ; lock_V = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
irregDuplV fit y z =
|
||||
let
|
||||
fitting = (regDuplV fit).s ! VPresPart
|
||||
in
|
||||
mkV fit (fit + <I>s</I>) y z fitting ;
|
||||
</P>
|
||||
<P>
|
||||
partV v p = verbPart v p **** {lock_V = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkV2 v p = v **** {s = v.s ; s1 = v.s1 ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v [] ;
|
||||
</P>
|
||||
<P>
|
||||
mkV3 v p q = v **** {s = v.s ; s1 = v.s1 ; c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v [] p ;
|
||||
dirdirV3 v = dirV3 v [] ;
|
||||
</P>
|
||||
<P>
|
||||
mkVS v = v **** {lock_VS = <>} ;
|
||||
mkVV v = v **** {c2 = <I>to</I> ; lock_VV = <>} ;
|
||||
mkVQ v = v **** {lock_VQ = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
V0 : Type = V ;
|
||||
V2S, V2V, V2Q, V2A : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
A2V : Type = A2 ;
|
||||
</P>
|
||||
<P>
|
||||
mkV0 v = v **** {lock_V = <>} ;
|
||||
mkV2S v p = mkV2 v p **** {lock_V2 = <>} ;
|
||||
mkV2V v p t = mkV2 v p **** {s4 = t ; lock_V2 = <>} ;
|
||||
mkVA v = v **** {lock_VA = <>} ;
|
||||
mkV2A v p = mkV2 v p **** {lock_V2A = <>} ;
|
||||
mkV2Q v p = mkV2 v p **** {lock_V2 = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
mkAS v = v **** {lock_A = <>} ;
|
||||
mkA2S v p = mkA2 v p **** {lock_A = <>} ;
|
||||
mkAV v = v **** {lock_A = <>} ;
|
||||
mkA2V v p = mkA2 v p **** {lock_A2 = <>} ;
|
||||
</P>
|
||||
<P>
|
||||
} ;
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc dutch/ParadigmsDut.txt -->
|
||||
</BODY></HTML>
|
||||
423
lib/resource/doc/gfdoc/ParadigmsEng.html
Normal file
@@ -0,0 +1,423 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> English Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> English Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-06-25 18:09:50 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Compound nouns</A>
|
||||
<LI><A HREF="#toc4">Relational nouns</A>
|
||||
<LI><A HREF="#toc5">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc6">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc7">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc8">Adverbs</A>
|
||||
<LI><A HREF="#toc9">Prepositions</A>
|
||||
<LI><A HREF="#toc10">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc11">Two-place verbs</A>
|
||||
<LI><A HREF="#toc12">Three-place verbs</A>
|
||||
<LI><A HREF="#toc13">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2003--2005
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoEng.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed: we have a
|
||||
separate module <A HREF="../../english/IrregEng.gf"><CODE>IrregEng</CODE></A>,
|
||||
which covers irregular verbss.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsEng = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoEng,
|
||||
CatEng
|
||||
in {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
masculine : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions are used in many-argument functions for rection.
|
||||
The resource category <CODE>Prep</CODE> is used.
|
||||
</P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<P>
|
||||
Nouns are constructed by the function <CODE>mkN</CODE>, which takes a varying
|
||||
number of arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function captures the variants for nouns ending with
|
||||
<I>s</I>,<I>sh</I>,<I>x</I>,<I>z</I> or <I>y</I>: <I>kiss - kisses</I>, <I>flash - flashes</I>;
|
||||
<I>fly - flies</I> (but <I>toy - toys</I>),
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (flash : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In practice the worst case is to give singular and plural nominative.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (man,men : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The theoretical worst case: give all four forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (man,men,man's,men's : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Compound nouns</H3>
|
||||
<P>
|
||||
A compound noun is an uninflected string attached to an inflected noun,
|
||||
such as <I>baby boom</I>, <I>chief executive officer</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : Str -> N -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>daughter of x</I>) need a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The most common preposition is <I>of</I>, and the following is a
|
||||
shortcut for regular relational nouns with <I>of</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
regN2 : Str -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Use the function <CODE>mkPrep</CODE> or see the section on prepositions below to
|
||||
form other prepositions.
|
||||
</P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>the connection from x to y</I>) need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names, with a regular genitive, are formed from strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
|
||||
mkPN : Str -> PN ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Sometimes a common noun can be reused as a proper name, e.g. <I>Bank</I>
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : N -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
For regular adjectives, the adverbial and comparison forms are derived. This holds
|
||||
even for cases with the variations <I>happy - happily - happier - happiest</I>,
|
||||
<I>free - freely - freer - freest</I>, and <I>rude - rudest</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (happy : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
However, the duplication of the final consonant cannot be predicted,
|
||||
but a separate case is used to give the comparative
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (fat,fatter : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
As many as four forms may be needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (good,better,best,well : Str) -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To force comparison to be formed by <I>more - most</I>,
|
||||
the following function is used:
|
||||
</P>
|
||||
<PRE>
|
||||
compoundA : A -> A ; -- -/more/most ridiculous
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb. Some can be preverbal (e.g. <I>always</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Prepositions</H2>
|
||||
<P>
|
||||
A preposition as used for rection in the lexicon, as well as to
|
||||
build <CODE>PP</CODE>s in the resource API, just requires a string.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
(These two functions are synonyms.)
|
||||
</P>
|
||||
<A NAME="toc10"></A>
|
||||
<H2>Verbs</H2>
|
||||
<P>
|
||||
Verbs are constructed by the function <CODE>mkV</CODE>, which takes a varying
|
||||
number of arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular verb function recognizes the special cases where the last
|
||||
character is <I>y</I> (<I>cry-cries</I> but <I>buy-buys</I>) or a sibilant
|
||||
(<I>kiss-</I>kisses<I>, //jazz-jazzes</I>, <I>rush-rushes</I>, <I>munch - munches</I>, //
|
||||
<I>fix - fixes</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (cry : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Give the present and past forms for regular verbs where
|
||||
the last letter is duplicated in some forms,
|
||||
e.g. <I>rip - ripped - ripping</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (stop, stopped : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
There is an extensive list of irregular verbs in the module <CODE>IrregularEng</CODE>.
|
||||
In practice, it is enough to give three forms,
|
||||
e.g. <I>drink - drank - drunk</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (drink, drank, drunk : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Irregular verbs with duplicated consonant in the present participle.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (run, ran, run, running : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Except for <I>be</I>, the worst case needs five forms: the infinitive and
|
||||
the third person singular present, the past indicative, and the
|
||||
past and present participles.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (go, goes, went, gone, going : Str) -> V
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Verbs with a particle.
|
||||
The particle, such as in <I>switch on</I>, is given as a string.
|
||||
</P>
|
||||
<PRE>
|
||||
partV : V -> Str -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Reflexive verbs.
|
||||
By default, verbs are not reflexive; this function makes them that.
|
||||
</P>
|
||||
<PRE>
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs). Notice that a particle comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : V -> Prep -> V2 ; -- believe in
|
||||
mkV2 : V -> V2 -- kill
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Prep -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc english/ParadigmsEng.txt -->
|
||||
</BODY></HTML>
|
||||
484
lib/resource/doc/gfdoc/ParadigmsFin.html
Normal file
@@ -0,0 +1,484 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Finnish Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Finnish Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-08 15:18:54 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<LI><A HREF="#toc3">Adjectives</A>
|
||||
<LI><A HREF="#toc4">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc5">Two-place verbs</A>
|
||||
<LI><A HREF="#toc6">Three-place verbs</A>
|
||||
<LI><A HREF="#toc7">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2003--2005
|
||||
</P>
|
||||
<P>
|
||||
This is an API to the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoFin.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsFin = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoFin,
|
||||
CatFin
|
||||
in {
|
||||
|
||||
flags optimize=noexpand ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender, number, and (some) case names,
|
||||
we define the following identifiers. The application programmer
|
||||
should always use these constants instead of the constructors
|
||||
defined in <CODE>ResFin</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
Case : Type ;
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
partitive : Case ;
|
||||
translative : Case ;
|
||||
inessive : Case ;
|
||||
elative : Case ;
|
||||
illative : Case ;
|
||||
adessive : Case ;
|
||||
ablative : Case ;
|
||||
allative : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following type is used for defining <B>rection</B>, i.e. complements
|
||||
of many-place verbs and adjective. A complement can be defined by
|
||||
just a case, or a pre/postposition and a case.
|
||||
</P>
|
||||
<PRE>
|
||||
prePrep : Case -> Str -> Prep ; -- ilman, partitive
|
||||
postPrep : Case -> Str -> Prep ; -- takana, genitive
|
||||
postGenPrep : Str -> Prep ; -- takana
|
||||
casePrep : Case -> Prep ; -- adessive
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<P>
|
||||
The worst case gives ten forms.
|
||||
In practice just a couple of forms are needed to define the different
|
||||
stems, vowel alternation, and vowel harmony.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular noun heuristic takes just one form (singular
|
||||
nominative) and analyses it to pick the correct paradigm.
|
||||
It does automatic grade alternation, and is hence not usable
|
||||
for words like <I>auto</I> (whose genitive would become <I>audon</I>).
|
||||
</P>
|
||||
<P>
|
||||
If the one-argument paradigm does not give the correct result, one can try and give
|
||||
two or three forms. Most notably, the two-argument variant is used
|
||||
for nouns like <I>kivi - kiviä</I>, which would otherwise become like
|
||||
<I>rivi - rivejä</I>. Three arguments are used e.g. for
|
||||
<I>sydän - sydämen - sydämiä</I>, which would otherwise become
|
||||
<I>sydän - sytämen</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
mkN : (talo : Str) -> N ;
|
||||
mkN : (savi,savia : Str) -> N ;
|
||||
mkN : (vesi,veden,vesiä : Str) -> N ;
|
||||
mkN : (olo,oln,olona,oloa,oloon,oloina,oloissa,olojen,oloja,oloihin : Str) -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some nouns have an unexpected singular partitive, e.g. <I>meri</I>, <I>lumi</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
sgpartN : (meri : N) -> (merta : Str) -> N ;
|
||||
nMeri : (meri : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The rest of the noun paradigms are mostly covered by the three
|
||||
heuristics.
|
||||
</P>
|
||||
<P>
|
||||
Nouns with partitive <I>a</I>,<I>ä</I> are a large group.
|
||||
To determine for grade and vowel alternation, three forms are usually needed:
|
||||
singular nominative and genitive, and plural partitive.
|
||||
Examples: <I>talo</I>, <I>kukko</I>, <I>huippu</I>, <I>koira</I>, <I>kukka</I>, <I>syylä</I>, <I>särki</I>...
|
||||
</P>
|
||||
<PRE>
|
||||
nKukko : (kukko,kukon,kukkoja : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A special case:
|
||||
the vowel harmony is inferred from the last letter,
|
||||
which must be one of <I>o</I>, <I>u</I>, <I>ö</I>, <I>y</I>. Regular weak-grade alternation
|
||||
is performed.
|
||||
</P>
|
||||
<PRE>
|
||||
nTalo : (talo : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Another special case are nouns where the last two consonants
|
||||
undergo regular weak-grade alternation:
|
||||
<I>kukko - kukon</I>, <I>rutto - ruton</I>, <I>hyppy - hypyn</I>, <I>sampo - sammon</I>,
|
||||
<I>kunto - kunnon</I>, <I>sisältö - sisällön</I>, .
|
||||
</P>
|
||||
<PRE>
|
||||
nLukko : (lukko : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<I>arpi - arven</I>, <I>sappi - sapen</I>, <I>kampi - kammen</I>;<I>sylki - syljen</I>
|
||||
</P>
|
||||
<PRE>
|
||||
nArpi : (arpi : Str) -> N ;
|
||||
nSylki : (sylki : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Foreign words ending in consonants are actually similar to words like
|
||||
<I>malli</I>-<I>mallin</I>-<I>malleja</I>, with the exception that the <I>i</I> is not attached
|
||||
to the singular nominative. Examples: <I>linux</I>, <I>savett</I>, <I>screen</I>.
|
||||
The singular partitive form is used to get the vowel harmony.
|
||||
(N.B. more than 1-syllabic words ending in <I>n</I> would have variant
|
||||
plural genitive and partitive forms, like
|
||||
<I>sultanien</I>, <I>sultaneiden</I>, which are not covered.)
|
||||
</P>
|
||||
<PRE>
|
||||
nLinux : (linuxia : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns of at least 3 syllables ending with <I>a</I> or <I>ä</I>, like <I>peruna</I>, <I>tavara</I>,
|
||||
<I>rytinä</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
nPeruna : (peruna : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following paradigm covers both nouns ending in an aspirated <I>e</I>, such as
|
||||
<I>rae</I>, <I>perhe</I>, <I>savuke</I>, and also many ones ending in a consonant
|
||||
(<I>rengas</I>, <I>kätkyt</I>). The singular nominative and essive are given.
|
||||
</P>
|
||||
<PRE>
|
||||
nRae : (rae, rakeena : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following covers nouns with partitive <I>ta</I>,<I>tä</I>, such as
|
||||
<I>susi</I>, <I>vesi</I>, <I>pieni</I>. To get all stems and the vowel harmony, it takes
|
||||
the singular nominative, genitive, and essive.
|
||||
</P>
|
||||
<PRE>
|
||||
nSusi : (susi,suden,sutta : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns ending with a long vowel, such as <I>puu</I>, <I>pää</I>, <I>pii</I>, <I>leikkuu</I>,
|
||||
are inflected according to the following.
|
||||
</P>
|
||||
<PRE>
|
||||
nPuu : (puu : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
One-syllable diphthong nouns, such as <I>suo</I>, <I>tie</I>, <I>työ</I>, are inflected by
|
||||
the following.
|
||||
</P>
|
||||
<PRE>
|
||||
nSuo : (suo : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Many adjectives but also nouns have the nominative ending <I>nen</I> which in other
|
||||
cases becomes <I>s</I>: <I>nainen</I>, <I>ihminen</I>, <I>keltainen</I>.
|
||||
To capture the vowel harmony, we use the partitive form as the argument.
|
||||
</P>
|
||||
<PRE>
|
||||
nNainen : (naista : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following covers some nouns ending with a consonant, e.g.
|
||||
<I>tilaus</I>, <I>kaulin</I>, <I>paimen</I>, <I>laidun</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
nTilaus : (tilaus,tilauksena : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Special case:
|
||||
</P>
|
||||
<PRE>
|
||||
nKulaus : (kulaus : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following covers nouns like <I>nauris</I> and adjectives like <I>kallis</I>, <I>tyyris</I>.
|
||||
The partitive form is taken to get the vowel harmony.
|
||||
</P>
|
||||
<PRE>
|
||||
nNauris : (naurista : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Separately-written compound nouns, like <I>sambal oelek</I>, <I>Urho Kekkonen</I>,
|
||||
have only their last part inflected.
|
||||
</P>
|
||||
<PRE>
|
||||
compN : Str -> N -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns used as functions need a case, of which the default is
|
||||
the genitive.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 = overload {
|
||||
mkN2 : N -> N2 = genN2 ;
|
||||
mkN2 : N -> Prep -> N2 = mmkN2
|
||||
} ;
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Proper names can be formed by using declensions for nouns.
|
||||
The plural forms are filtered away by the compiler.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : N -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<P>
|
||||
Non-comparison one-place adjectives are just like nouns.
|
||||
The regular adjectives are based on <CODE>regN</CODE> in the positive.
|
||||
Comparison adjectives have three forms.
|
||||
The comparative and the superlative
|
||||
are always inflected in the same way, so the nominative of them is actually
|
||||
enough (except for the superlative <I>paras</I> of <I>hyvä</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
mkA : Str -> A ;
|
||||
mkA : N -> A ;
|
||||
mkA : N -> (kivempaa,kivinta : Str) -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place adjectives need a case for the second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Verbs</H2>
|
||||
<P>
|
||||
The grammar does not cover the potential mood and some nominal
|
||||
forms. One way to see the coverage is to linearize a verb to
|
||||
a table.
|
||||
The worst case needs twelve forms, as shown in the following.
|
||||
The following heuristics cover more and more verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
mkV : (soutaa : Str) -> V ;
|
||||
mkV : (soutaa,souti : Str) -> V ;
|
||||
mkV : (soutaa,soudan,souti : Str) -> V ;
|
||||
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The subject case of verbs is by default nominative. This function can change it.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : V -> Case -> V
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The rest of the paradigms are special cases mostly covered by the heuristics.
|
||||
A simple special case is the one with just one stem and without grade alternation.
|
||||
</P>
|
||||
<PRE>
|
||||
vValua : (valua : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
With two forms, the following function covers a variety of verbs, such as
|
||||
<I>ottaa</I>, <I>käyttää</I>, <I>löytää</I>, <I>huoltaa</I>, <I>hiihtää</I>, <I>siirtää</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
vKattaa : (kattaa, katan : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
When grade alternation is not present, just a one-form special case is needed
|
||||
(<I>poistaa</I>, <I>ryystää</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
vOstaa : (ostaa : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following covers
|
||||
<I>juosta</I>, <I>piestä</I>, <I>nousta</I>, <I>rangaista</I>, <I>kävellä</I>, <I>surra</I>, <I>panna</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
vNousta : (nousta, nousen : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This is for one-syllable diphthong verbs like <I>juoda</I>, <I>syödä</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
vTuoda : (tuoda : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
All the patterns above have <CODE>nominative</CODE> as subject case.
|
||||
If another case is wanted, use the following.
|
||||
</P>
|
||||
<PRE>
|
||||
caseV : Case -> V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The verbs <I>be</I> is special.
|
||||
</P>
|
||||
<PRE>
|
||||
vOlla : V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need an object case, and can have a pre- or postposition.
|
||||
The default is direct (accusative) object. There is also a special case
|
||||
with case only. The string-only argument case yields a regular verb with
|
||||
accusative object.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Case -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- puhua, allative, elative
|
||||
dirV3 : V -> Case -> V3 ; -- siirtää, (accusative), illative
|
||||
dirdirV3 : V -> V3 ; -- antaa, (accusative), (allative)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> V2V ;
|
||||
mkVA : V -> Prep -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc finnish/ParadigmsFin.txt -->
|
||||
</BODY></HTML>
|
||||
414
lib/resource/doc/gfdoc/ParadigmsFre.html
Normal file
@@ -0,0 +1,414 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> French Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> French Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 09:17:50 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Compound nouns</A>
|
||||
<LI><A HREF="#toc4">Relational nouns</A>
|
||||
<LI><A HREF="#toc5">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc6">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc7">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc8">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc9">Adverbs</A>
|
||||
<LI><A HREF="#toc10">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc11">Two-place verbs</A>
|
||||
<LI><A HREF="#toc12">Three-place verbs</A>
|
||||
<LI><A HREF="#toc13">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2001 - 2006
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoFre.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed: we have a
|
||||
separate module <A HREF="../../french/IrregFre.gf"><CODE>IrregFre</CODE></A>,
|
||||
which covers all irregularly inflected verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsFre =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonRomance,
|
||||
ResFre,
|
||||
MorphoFre,
|
||||
CatFre in {
|
||||
|
||||
flags optimize=all ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions are either strings
|
||||
(including the 'accusative' empty string) or strings that
|
||||
amalgamate with the following word (the 'genitive' <I>de</I> and the
|
||||
'dative' <I>à</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function uses heuristics to compute the
|
||||
plural and the gender from the singular. The plural
|
||||
heuristic currently
|
||||
covers the cases <I>pas-pas</I>, <I>prix-prix</I>, <I>nez-nez</I>,
|
||||
<I>bijou-bijoux</I>, <I>cheveu-cheveux</I>, <I>plateau-plateaux</I>, <I>cheval-chevaux</I>.
|
||||
The gender heuristic is less reliable: it treats as feminine all
|
||||
nouns ending with <I>e</I> and <I>ion</I>, all others as masculine.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (cheval : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adding gender information widens the scope of the regular pattern.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (foie : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, both singular and plural forms and the gender are needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (oeil,yeux : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Compound nouns</H3>
|
||||
<P>
|
||||
Some nouns are ones where the first part is inflected as a noun but
|
||||
the second part is not inflected. e.g. <I>numéro de téléphone</I>.
|
||||
They could be formed in syntax, but we give a shortcut here since
|
||||
they are frequent in lexica.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : N -> Str -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>fille de x</I>) need a case and a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The most common cases are the genitive <I>de</I> and the dative <I>à</I>,
|
||||
with the empty preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>la connection de x à y</I>) need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>la vieille église de</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names need a string and a gender. If no gender is given, the
|
||||
feminine is used for strings ending with <I>e</I>, the masculine for other strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : Str -> Gender -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
For regular adjectives, all forms are derived from the
|
||||
masculine singular. The heuristic takes into account certain
|
||||
deviant endings: <I>banal-banale-banaux</I>, <I>chinois-chinoise-chinois</I>,
|
||||
<I>heureux-heureuse-heureux</I>, <I>italien-italienne</I>, <I>jeune-jeune</I>,
|
||||
<I>amer-amère</I>, <I>carré- - -carrément</I>, <I>joli- - -joliment</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (cher : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Often just the feminine singular is deviant.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (sec,seche : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This is the worst-case paradigm for the positive forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (banal,banale,banaux,banalement : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
If comparison forms are irregular (i.e. not formed by <I>plus</I>, e.g.
|
||||
<I>bon-meilleur</I>), the positive and comparative can be given as separate
|
||||
adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : A -> A -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The functions create by default postfix adjectives. To switch
|
||||
them to prefix ones (i.e. ones placed before the noun in
|
||||
modification, as in <I>petite maison</I>), the following function is
|
||||
provided.
|
||||
</P>
|
||||
<PRE>
|
||||
prefixA : A -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some appear next to the verb (e.g. <I>toujours</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdV : Str -> AdV ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H2>Verbs</H2>
|
||||
<P>
|
||||
Irregular verbs are given in the module <CODE>IrregFre</CODE>.
|
||||
If a verb should be missing in that list, the module
|
||||
<CODE>BeschFre</CODE> gives all the patterns of the <I>Bescherelle</I> book.
|
||||
</P>
|
||||
<P>
|
||||
Regular verbs are ones with the infinitive <I>er</I> or <I>ir</I>, the
|
||||
latter with plural present indicative forms as <I>finissons</I>.
|
||||
The regular verb function in the first conjugation recognizes
|
||||
these endings, as well as the variations among
|
||||
<I>aimer, céder, placer, peser, jeter, placer, manger, assiéger, payer</I>.
|
||||
</P>
|
||||
<P>
|
||||
Sometimes, however, it is not predictable which variant of the <I>er</I>
|
||||
conjugation is to be selected. Then it is better to use the function
|
||||
that gives the third person singular present indicative and future
|
||||
((<I>il</I>) <I>jette</I>, <I>jettera</I>) as second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
mkV : (finir : Str) -> V ;
|
||||
mkV : (jeter,jette,jettera : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The <CODE>IrregFre</CODE> list gives some verbs as two-place. These verbs can be
|
||||
reused as one-place verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : V2 -> V
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The function <CODE>mkV</CODE> gives the default compound auxiliary <I>avoir</I>.
|
||||
To change it to <I>être</I>, use the following function.
|
||||
</P>
|
||||
<PRE>
|
||||
etreV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This function turns a verb into reflexive, which implies the auxiliary <I>être</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs).
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 = overload {
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : V -> Prep -> V2 = mmkV2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> V3 ; -- donner,_,_
|
||||
mkV3 : V -> Prep -> V3 ; -- placer,_,dans
|
||||
mkV3 : V -> Prep -> Prep -> V3 -- parler, à, de
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "je veux parler"
|
||||
deVV : V -> VV ; -- "j'essaie de parler"
|
||||
aVV : V -> VV ; -- "j'arrive à parler"
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc french/ParadigmsFre.txt -->
|
||||
</BODY></HTML>
|
||||
410
lib/resource/doc/gfdoc/ParadigmsGer.html
Normal file
@@ -0,0 +1,410 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> German Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> German Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-06-08 17:51:31 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc4">Adjectives</A>
|
||||
<LI><A HREF="#toc5">Adverbs</A>
|
||||
<LI><A HREF="#toc6">Prepositions</A>
|
||||
<LI><A HREF="#toc7">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc8">Two-place verbs</A>
|
||||
<LI><A HREF="#toc9">Three-place verbs</A>
|
||||
<LI><A HREF="#toc10">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta, Harald Hammarström and Björn Bringert2003--2007
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
cases, from the most regular (with just one argument) to the worst.
|
||||
The name of this function is <CODE>mkC</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
There is also a module <A HREF="../../german/IrregGer.gf"><CODE>IrregGer</CODE></A>
|
||||
which covers irregular verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsGer = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoGer,
|
||||
CatGer
|
||||
in {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
neuter : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
accusative : Case ;
|
||||
dative : Case ;
|
||||
genitive : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular heuristics recognizes some suffixes, from which it
|
||||
guesses the gender and the declension: <I>e, ung, ion</I> give the
|
||||
feminine with plural ending <I>-n, -en</I>, and the rest are masculines
|
||||
with the plural <I>-e</I> (without Umlaut).
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (Stufe : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The 'almost regular' case is much like the information given in an ordinary
|
||||
dictionary. It takes the singular and plural nominative and the
|
||||
gender, and infers the other forms from these.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (Bild,Bilder : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Worst case: give all four singular forms, two plural forms (others + dative),
|
||||
and the gender.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N
|
||||
-- mann, mann, manne, mannes, männer, männern
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Relational nouns need a preposition. The most common is <I>von</I> with
|
||||
the dative, and there is a special case for regular nouns.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : overload {
|
||||
mkN2 : Str -> N2 ;
|
||||
mkN2 : N -> N2 ;
|
||||
mkN2 : N -> Prep -> N2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Use the function <CODE>mkPrep</CODE> or see the section on prepositions below to
|
||||
form other prepositions.
|
||||
Some prepositions are moreover constructed in <A HREF="StructuralGer.html">StructuralGer</A>.
|
||||
</P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>die Verbindung von x nach y</I>) need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names, with an <I>s</I> genitive and other cases like the
|
||||
nominative, are formed from a string. Final <I>s</I> (<I>Johannes-Johannes</I>) is
|
||||
taken into account.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
If only the genitive differs, two strings are needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : (nom,gen : Str) -> PN ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, all four forms are needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : (nom,acc,dat,gen : Str) -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular adjective formation works for most cases, and includes
|
||||
variations such as <I>teuer - teurer</I>, <I>böse - böser</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : Str -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, adjectives need three forms - one for each degree.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (gut,besser,beste : Str) -> A -- gut,besser,beste
|
||||
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Invariable adjective are a special case.
|
||||
</P>
|
||||
<PRE>
|
||||
invarA : Str -> A ; -- prima
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place adjectives are formed by adding a preposition to an adjective.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are formed from strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Prepositions</H2>
|
||||
<P>
|
||||
A preposition is formed from a string and a case.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPrep : Str -> Case -> Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Often just a case with the empty string is enough.
|
||||
</P>
|
||||
<PRE>
|
||||
accPrep : Prep ;
|
||||
datPrep : Prep ;
|
||||
genPrep : Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A couple of common prepositions (always with the dative).
|
||||
</P>
|
||||
<PRE>
|
||||
von_Prep : Prep ;
|
||||
zu_Prep : Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Verbs</H2>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Regular verbs (<I>weak verbs</I>) need just the infinitive form.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (führen : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Irregular verbs use Ablaut and, in the worst cases, also Umlaut.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (sehen,sieht,sah,sähe,gesehen : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The worst-case constructor needs six forms:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Infinitive,
|
||||
<LI>3p sg pres. indicative,
|
||||
<LI>2p sg imperative,
|
||||
<LI>1/3p sg imperfect indicative,
|
||||
<LI>1/3p sg imperfect subjunctive (because this uncommon form can have umlaut)
|
||||
<LI>the perfect participle
|
||||
</UL>
|
||||
|
||||
<PRE>
|
||||
mkV : (geben, gibt, gib, gab, gäbe, gegeben : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To add a movable suffix e.g. <I>auf(fassen)</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : Str -> V -> V
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To remove the past participle prefix <I>ge</I>, e.g. for the verbs
|
||||
prefixed by <I>be-, ver-</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
no_geV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To change the auxiliary from <I>haben</I> (default) to <I>sein</I> and
|
||||
vice-versa.
|
||||
</P>
|
||||
<PRE>
|
||||
seinV : V -> V ;
|
||||
habenV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Reflexive verbs can take reflexive pronouns of different cases.
|
||||
</P>
|
||||
<PRE>
|
||||
reflV : V -> Case -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place verbs with a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place verbs with direct object (accusative, transitive verbs).
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : V -> V2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place verbs with object in the given case.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : V -> Case -> V2
|
||||
};
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen, mit, über
|
||||
dirV3 : V -> Prep -> V3 ; -- senden,(accusative),nach
|
||||
accdatV3 : V -> V3 ; -- give,accusative,dative
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc german/ParadigmsGer.txt -->
|
||||
</BODY></HTML>
|
||||
405
lib/resource/doc/gfdoc/ParadigmsIta.html
Normal file
@@ -0,0 +1,405 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Italian Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Italian Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 09:18:06 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Relational nouns</A>
|
||||
<LI><A HREF="#toc4">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc5">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc6">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc7">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc8">Adverbs</A>
|
||||
<LI><A HREF="#toc9">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc10">Two-place verbs</A>
|
||||
<LI><A HREF="#toc11">Three-place verbs</A>
|
||||
<LI><A HREF="#toc12">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2003
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoIta.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed. For verbs, we have a
|
||||
separate module <A HREF="../../italian/BeschIta.gf"><CODE>BeschIta</CODE></A>,
|
||||
which covers the <I>Bescherelle</I> verb conjugations.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsIta =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonRomance,
|
||||
ResIta,
|
||||
MorphoIta,
|
||||
BeschIta,
|
||||
CatIta in {
|
||||
|
||||
flags optimize=all ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions are either strings
|
||||
(including the 'accusative' empty string) or strings that
|
||||
amalgamate with the following word (the 'genitive' <I>di</I> and the
|
||||
'dative' <I>a</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
Prep : Type ;
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The following prepositions also have special contracted forms.
|
||||
</P>
|
||||
<PRE>
|
||||
con_Prep, da_Prep, in_Prep, su_Prep : Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function takes the singular form and the gender,
|
||||
and computes the plural and the gender by a heuristic.
|
||||
The heuristic says that the gender is feminine for nouns
|
||||
ending with <I>a</I>, and masculine for all other words.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (cane : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To force a different gender, give it explicitly.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (carne : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Worst case: give both two forms and the gender.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (uomo,uomini : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In <B>compound nouns</B>, the first part is inflected as a noun but
|
||||
the second part is not inflected. e.g. <I>numero di telefono</I>.
|
||||
They could be formed in syntax, but we give a shortcut here since
|
||||
they are frequent in lexica.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : N -> Str -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>figlio di x</I>) need a case and a preposition.
|
||||
The default is regular nouns with the genitive <I>di</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : overload {
|
||||
mkN2 : Str -> N2 ;
|
||||
mkN2 : N -> Prep -> N2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>la connessione di x a y</I>) need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>la vecchia chiesa di</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names need a string and a gender. The gender is by default feminine if
|
||||
the name ends with an <I>a</I>, and masculine otherwise.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : Str -> Gender -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
For regular adjectives, all forms are derived from the
|
||||
masculine singular. Comparison is formed by <I>più</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (bianco : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Five forms are needed in the worst
|
||||
case (masc and fem singular, masc plural, adverbial), given that
|
||||
comparison is formed by <I>più</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (solo,sola,soli,sole,solamente : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
With irregular comparison, there are as it were two adjectives:
|
||||
the positive (<I>buono</I>) and the comparative (<I>migliore</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : A -> A -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
All the functions above create postfix adjectives. To switch
|
||||
them to prefix ones (i.e. ones placed before the noun in
|
||||
modification, as in <I>vecchia chiesa</I>), the following function is
|
||||
provided.
|
||||
</P>
|
||||
<PRE>
|
||||
prefixA : A -> A = prefA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some appear next to the verb (e.g. <I>sempre</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdV : Str -> AdV ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Verbs</H2>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Regular verbs are ones with the infinitive <I>are</I> or <I>ire</I>, the
|
||||
latter with singular present indicative forms as <I>finisco</I>.
|
||||
The regular verb function is the first conjugation recognizes
|
||||
these endings, as well as the variations among
|
||||
<I>amare, cominciare, mangiare, legare, cercare</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : Str -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The module <CODE>BeschIta</CODE> gives (almost) all the patterns of the <I>Bescherelle</I>
|
||||
book. To use them in the category <CODE>V</CODE>, wrap them with the function
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : Verbo -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
If <CODE>BeschIta</CODE> does not give the desired result or feels difficult
|
||||
to consult, here is a worst-case function for <I>-ire</I> and <I>-ere</I> verbs,
|
||||
taking 11 arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The function <CODE>regV</CODE> gives all verbs the compound auxiliary <I>avere</I>.
|
||||
To change it to <I>essere</I>, use the following function.
|
||||
Reflexive implies <I>essere</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
essereV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs). Notice that a particle comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
You can reuse a <CODE>V2</CODE> verb in <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
v2V : V2 -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- parlare, a, di
|
||||
dirV3 : V -> Prep -> V3 ; -- dare,_,a
|
||||
dirdirV3 : V -> V3 ; -- dare,_,_
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "voglio parlare"
|
||||
deVV : V -> VV ; -- "cerco di parlare"
|
||||
aVV : V -> VV ; -- "arrivo a parlare"
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc italian/ParadigmsIta.txt -->
|
||||
</BODY></HTML>
|
||||
387
lib/resource/doc/gfdoc/ParadigmsNor.html
Normal file
@@ -0,0 +1,387 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Norwegian Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Norwegian Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 10:10:01 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Compound nouns</A>
|
||||
<LI><A HREF="#toc4">Relational nouns</A>
|
||||
<LI><A HREF="#toc5">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc6">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc7">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc8">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc9">Adverbs</A>
|
||||
<LI><A HREF="#toc10">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc11">Verbs with a particle.</A>
|
||||
<LI><A HREF="#toc12">Verbs with 'være' as auxiliary</A>
|
||||
<LI><A HREF="#toc13">Deponent verbs.</A>
|
||||
<LI><A HREF="#toc14">Two-place verbs</A>
|
||||
<LI><A HREF="#toc15">Three-place verbs</A>
|
||||
<LI><A HREF="#toc16">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2003
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
It covers the <I>bokmål</I> variant of Norwegian.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoNor.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed: we have a
|
||||
separate module <A HREF="../../norwegian/IrregNor"><CODE>IrregNor</CODE></A>,
|
||||
which covers irregularly inflected verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsNor =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonScand,
|
||||
ResNor,
|
||||
MorphoNor,
|
||||
CatNor in {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
neutrum : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions are just strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ; -- empty string
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<P>
|
||||
The regular function takes the singular indefinite form
|
||||
and computes the other forms and the gender by a heuristic.
|
||||
The heuristic is that nouns ending <I>e</I> are feminine like <I>kvinne</I>,
|
||||
all others are masculine like <I>bil</I>.
|
||||
Giving gender manually makes the heuristic more reliable.
|
||||
One can also compute the gender from the definite form.
|
||||
gender is computed from the definite form.
|
||||
If in doubt, use the <CODE>cc</CODE> command to test!
|
||||
In the worst case, give all four forms. The gender is computed from the
|
||||
last letter of the second form (if <I>n</I>, then <CODE>utrum</CODE>, otherwise <CODE>neutrum</CODE>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
mkN : Str -> N ;
|
||||
mkN : Str -> Gender -> N ;
|
||||
mkN : (bil,bilen : Str) -> N ;
|
||||
mkN : (dreng,drengen,drenger,drengene : Str) -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Compound nouns</H3>
|
||||
<P>
|
||||
All the functions above work quite as well to form compound nouns,
|
||||
such as <I>fotboll</I>.
|
||||
</P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>datter til x</I>) need a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The most common preposition is <I>av</I>, and the following is a
|
||||
shortcut for regular, <CODE>nonhuman</CODE> relational nouns with <I>av</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
regN2 : Str -> Gender -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Use the function <CODE>mkPrep</CODE> or see the section on prepositions below to
|
||||
form other prepositions.
|
||||
</P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>forbindelse fra x til y</I>)
|
||||
need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>den gamle kongen av</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names, with a regular genitive, are formed as follows
|
||||
Sometimes you can reuse a common noun as a proper name, e.g. <I>Bank</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- masculine
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
mkPN : N -> PN ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<P>
|
||||
The regular pattern works for many adjectives, e.g. those ending
|
||||
with <I>ig</I>. Two, five, or at worst five forms are sometimes needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
mkA : (fin : Str) -> A ;
|
||||
mkA : (fin,fint : Str) -> A ;
|
||||
mkA : (galen,galet,galne : Str) -> A ;
|
||||
mkA : (stor,stort,store,storre,storst : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
If comparison is formed by <I>mer</I>, <I>mest</I>, as in general for
|
||||
long adjective, the following pattern is used:
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : A -> A ; -- -/mer/mest norsk
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb. Some follow the verb (e.g. <I>altid</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ; -- e.g. her
|
||||
mkAdV : Str -> AdV ; -- e.g. altid
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H2>Verbs</H2>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The 'regular verb' function is the first conjugation.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (snakke : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The almost regular verb function needs the infinitive and the preteritum.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (leve,levde : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
There is an extensive list of irregular verbs in the module <CODE>IrregNor</CODE>.
|
||||
In practice, it is enough to give three forms, as in school books.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (drikke, drakk, drukket : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The worst case needs six forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Verbs with a particle.</H3>
|
||||
<P>
|
||||
The particle, such as in <I>lukke opp</I>, is given as a string.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : V -> Str -> V ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Verbs with 'være' as auxiliary</H3>
|
||||
<P>
|
||||
By default, the auxiliary is <I>have</I>. This function changes it to <I>være</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
vaereV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Deponent verbs.</H3>
|
||||
<P>
|
||||
Some words are used in passive forms only, e.g. <I>trives</I>, some as
|
||||
reflexive e.g. <I>forestille seg</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc14"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs). Notice that, if a particle is needed, it comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc15"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om
|
||||
dirV3 : V -> Prep -> V3 ; -- gi,_,til
|
||||
dirdirV3 : V -> V3 ; -- gi,_,_
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc16"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc norwegian/ParadigmsNor.txt -->
|
||||
</BODY></HTML>
|
||||
385
lib/resource/doc/gfdoc/ParadigmsRus.html
Normal file
@@ -0,0 +1,385 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Russian Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Russian Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 10:39:50 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<LI><A HREF="#toc3">Adjectives</A>
|
||||
<LI><A HREF="#toc4">Adverbs</A>
|
||||
<LI><A HREF="#toc5">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc6">Two-place verbs</A>
|
||||
<LI><A HREF="#toc7">Three-place verbs</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Janna Khegai 2003--2006
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoRus.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The following modules are presupposed:
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsRus = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoRus,
|
||||
CatRus,
|
||||
NounRus
|
||||
in {
|
||||
|
||||
flags coding=utf8 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
neuter : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
dative : Case ;
|
||||
accusative : Case ;
|
||||
instructive : Case ;
|
||||
prepositional : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In some (written in English) textbooks accusative case
|
||||
is put on the second place. However, we follow the case order
|
||||
standard for Russian textbooks.
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
Animacy: Type ;
|
||||
|
||||
animate: Animacy;
|
||||
inanimate: Animacy;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<P>
|
||||
Best case: indeclinabe nouns: <I>кофе</I>, <I>пальто</I>, <I>ВУЗ</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function captures the variants for some popular nouns
|
||||
endings below:
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : Str -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This function is for indeclinable nouns.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : Str -> Gender -> Animacy -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Worst case - give six singular forms:
|
||||
Nominative, Genetive, Dative, Accusative, Instructive and Prepositional;
|
||||
corresponding six plural forms and the gender.
|
||||
May be the number of forms needed can be reduced,
|
||||
but this requires a separate investigation.
|
||||
Animacy parameter (determining whether the Accusative form is equal
|
||||
to the Nominative or the Genetive one) is actually of no help,
|
||||
since there are a lot of exceptions and the gain is just one form less.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (nomSg,_,_,_,_,_,_,_,_,_,_,prepPl : Str) -> Gender -> Animacy -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
мужчина, мужчины, мужчине, мужчину, мужчиной, мужчине
|
||||
мужчины, мужчин, мужчинам, мужчин, мужчинами, мужчинах
|
||||
</P>
|
||||
<PRE>
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Here are some common patterns. The list is far from complete.
|
||||
Feminine patterns.
|
||||
</P>
|
||||
<PRE>
|
||||
nMashina : Str -> N ; -- feminine, inanimate, ending with "-а", Inst -"машин-ой"
|
||||
nEdinica : Str -> N ; -- feminine, inanimate, ending with "-а", Inst -"единиц-ей"
|
||||
nZhenchina : Str -> N ; -- feminine, animate, ending with "-a"
|
||||
nNoga : Str -> N ; -- feminine, inanimate, ending with "г_к_х-a"
|
||||
nMalyariya : Str -> N ; -- feminine, inanimate, ending with "-ия"
|
||||
nTetya : Str -> N ; -- feminine, animate, ending with "-я"
|
||||
nBol : Str -> N ; -- feminine, inanimate, ending with "-ь"(soft sign)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Neuter patterns.
|
||||
</P>
|
||||
<PRE>
|
||||
nObezbolivauchee : Str -> N ; -- neutral, inanimate, ending with "-ee"
|
||||
nProizvedenie : Str -> N ; -- neutral, inanimate, ending with "-e"
|
||||
nChislo : Str -> N ; -- neutral, inanimate, ending with "-o"
|
||||
nZhivotnoe : Str -> N ; -- masculine, inanimate, ending with "-ень"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Masculine patterns.
|
||||
Ending with consonant:
|
||||
</P>
|
||||
<PRE>
|
||||
nPepel : Str -> N ; -- masculine, inanimate, ending with "-ел"- "пеп-ла"
|
||||
|
||||
nBrat: Str -> N ; -- animate, брат-ья
|
||||
nStul: Str -> N ; -- same as above, but inanimate
|
||||
nMalush : Str -> N ; -- малышей
|
||||
nPotolok : Str -> N ; -- потол-ок - потол-ка
|
||||
|
||||
-- the next four differ in plural nominative and/or accusative form(s) :
|
||||
nBank: Str -> N ; -- банк-и (Nom=Acc)
|
||||
nStomatolog : Str -> N ; -- same as above, but animate
|
||||
nAdres : Str -> N ; -- адрес-а (Nom=Acc)
|
||||
nTelefon : Str -> N ; -- телефон-ы (Nom=Acc)
|
||||
|
||||
nNol : Str -> N ; -- masculine, inanimate, ending with "-ь" (soft sign)
|
||||
nUroven : Str -> N ; -- masculine, inanimate, ending with "-ень"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Nouns used as functions need a preposition. The most common is with Genitive.
|
||||
</P>
|
||||
<PRE>
|
||||
mkFun : N -> Prep -> N2 ;
|
||||
mkN2 : N -> N2 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Proper names.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : Str -> Gender -> Animacy -> PN ; -- "Иван", "Маша"
|
||||
mkPN : N -> PN ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<P>
|
||||
Non-comparison (only positive degree) one-place adjectives need 28 (4 by 7)
|
||||
forms in the worst case:
|
||||
(Masculine | Feminine | Neutral | Plural) **
|
||||
**
|
||||
(Nominative | Genitive | Dative | Accusative Inanimate | Accusative Animate |
|
||||
Instructive | Prepositional)
|
||||
Notice that 4 short forms, which exist for some adjectives are not included
|
||||
in the current description, otherwise there would be 32 forms for
|
||||
positive degree.
|
||||
The regular function captures the variants for some popular adjective
|
||||
endings below. The first string agrument is the masculine singular form,
|
||||
the second is comparative:
|
||||
Invariable adjective is a special case, with only on string needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
mkA : Str -> A ; -- khaki, mini, hindi, netto
|
||||
mkA : Str -> Str -> A ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some regular patterns depending on the ending.
|
||||
</P>
|
||||
<PRE>
|
||||
AStaruyj : Str -> Str -> A ; -- ending with "-ый"
|
||||
AMalenkij : Str -> Str -> A ; -- ending with "-ий", Gen - "маленьк-ого"
|
||||
AKhoroshij : Str -> Str -> A ; -- ending with "-ий", Gen - "хорош-его"
|
||||
AMolodoj : Str -> Str -> A ; -- ending with "-ой",
|
||||
-- plural - молод-ые"
|
||||
AKakoj_Nibud : Str -> Str -> Str -> A ; -- ending with "-ой",
|
||||
-- plural - "как-ие"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Two-place adjectives need a preposition and a case as extra arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Str -> Case -> A2 ; -- "делим на"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Comparison adjectives need a positive adjective
|
||||
(28 forms without short forms).
|
||||
Taking only one comparative form (non-syntactic) and
|
||||
only one superlative form (syntactic) we can produce the
|
||||
comparison adjective with only one extra argument -
|
||||
non-syntactic comparative form.
|
||||
Syntactic forms are based on the positive forms.
|
||||
</P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Verbs</H2>
|
||||
<P>
|
||||
In our lexicon description (<I>Verbum</I>) there are 62 forms:
|
||||
2 (Voice) by { 1 (infinitive) + [2(number) by 3 (person)](imperative) +
|
||||
[ [2(Number) by 3(Person)](present) + [2(Number) by 3(Person)](future) +
|
||||
4(GenNum)(past) ](indicative)+ 4 (GenNum) (subjunctive) }
|
||||
Participles (Present and Past) and Gerund forms are not included,
|
||||
since they fuction more like Adjectives and Adverbs correspondingly
|
||||
rather than verbs. Aspect is regarded as an inherent parameter of a verb.
|
||||
Notice, that some forms are never used for some verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
Voice: Type;
|
||||
Aspect: Type;
|
||||
Bool: Type;
|
||||
Conjugation: Type ;
|
||||
|
||||
first: Conjugation; -- "гуля-Ешь, гуля-Ем"
|
||||
firstE: Conjugation; -- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink)
|
||||
second: Conjugation; -- "вид-Ишь, вид-Им"
|
||||
mixed: Conjugation; -- "хоч-Ешь - хот-Им"
|
||||
dolzhen: Conjugation; -- irregular
|
||||
|
||||
true: Bool;
|
||||
false: Bool;
|
||||
|
||||
active: Voice ;
|
||||
passive: Voice ;
|
||||
imperfective: Aspect;
|
||||
perfective: Aspect ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Common conjugation patterns are two conjugations:
|
||||
first - verbs ending with <I>-ать/-ять</I> and second - <I>-ить/-еть</I>.
|
||||
Instead of 6 present forms of the worst case, we only need
|
||||
a present stem and one ending (singular, first person):
|
||||
<I>я люб-лю</I>, <I>я жд-у</I>, etc. To determine where the border
|
||||
between stem and ending lies it is sufficient to compare
|
||||
first person from with second person form:
|
||||
<I>я люб-лю</I>, <I>ты люб-ишь</I>. Stems shoud be the same.
|
||||
So the definition for verb <I>любить</I> looks like:
|
||||
regV Imperfective Second <I>люб</I> <I>лю</I> <I>любил</I> <I>люби</I> <I>любить</I>;
|
||||
</P>
|
||||
<P>
|
||||
There is no one-argument case.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
mkV : Aspect -> Conjugation -> (stemPrsSgP1,endPrsSgP1,pastSgP1,imp,inf : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The worst case need 6 forms of the present tense in indicative mood
|
||||
(<I>я бегу</I>, <I>ты бежишь</I>, <I>он бежит</I>, <I>мы бежим</I>, <I>вы бежите</I>, <I>они бегут</I>),
|
||||
a past form (singular, masculine: <I>я бежал</I>), an imperative form
|
||||
(singular, second person: <I>беги</I>), an infinitive (<I>бежать</I>).
|
||||
Inherent aspect should also be specified.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : Aspect -> (presSgP1,presSgP2,presSgP3,presPlP1,presPlP2,presPlP3,pastSgMasc,imp,inf: Str) -> V ;
|
||||
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs, and the special case with direct object. Notice that
|
||||
a particle can be included in a <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : V -> V2 ; -- "видеть", "любить"
|
||||
mkV2 : V -> Str -> Case -> V2 ; -- "войти в дом"; "в", accusative
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<PRE>
|
||||
tvDirDir : V -> V3 ;
|
||||
mkV3 : V -> Str -> Str -> Case -> Case -> V3 ; -- "сложить письмо в конверт"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The definitions should not bother the user of the API. So they are
|
||||
hidden from the document.
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc russian/ParadigmsRus.txt -->
|
||||
413
lib/resource/doc/gfdoc/ParadigmsSpa.html
Normal file
@@ -0,0 +1,413 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Spanish Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Spanish Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 09:19:56 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Compound nouns</A>
|
||||
<LI><A HREF="#toc4">Relational nouns</A>
|
||||
<LI><A HREF="#toc5">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc6">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc7">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc8">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc9">Adverbs</A>
|
||||
<LI><A HREF="#toc10">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc11">Two-place verbs</A>
|
||||
<LI><A HREF="#toc12">Three-place verbs</A>
|
||||
<LI><A HREF="#toc13">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2004 - 2006
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoSpa.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>. For
|
||||
verbs, there is a fairly complete list of irregular verbs in
|
||||
<A HREF="../../spanish/IrregSpa.gf"><CODE>IrregSpa</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsSpa =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonRomance,
|
||||
ResSpa,
|
||||
MorphoSpa,
|
||||
BeschSpa,
|
||||
CatSpa in {
|
||||
|
||||
flags optimize=all ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions are either strings
|
||||
(including the 'accusative' empty string) or strings that
|
||||
amalgamate with the following word (the 'genitive' <I>de</I> and the
|
||||
'dative' <I>a</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
Prep : Type ;
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The regular function takes the singular form and the gender,
|
||||
and computes the plural and the gender by a heuristic.
|
||||
The heuristic says that the gender is feminine for nouns
|
||||
ending with <I>a</I> or <I>z</I>, and masculine for all other words.
|
||||
Nouns ending with <I>a</I>, <I>o</I>, <I>e</I> have the plural with <I>s</I>,
|
||||
those ending with <I>z</I> have <I>ces</I> in plural; all other nouns
|
||||
have <I>es</I> as plural ending. The accent is not dealt with.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (luz : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A different gender can be forced.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : Str -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The worst case has two forms (singular + plural) and the gender.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (baston,bastones : Str) -> Gender -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Compound nouns</H3>
|
||||
<P>
|
||||
Some nouns are ones where the first part is inflected as a noun but
|
||||
the second part is not inflected. e.g. <I>número de teléfono</I>.
|
||||
They could be formed in syntax, but we give a shortcut here since
|
||||
they are frequent in lexica.
|
||||
</P>
|
||||
<PRE>
|
||||
compN : N -> Str -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>fille de x</I>) need a case and a preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The most common cases are the genitive <I>de</I> and the dative <I>a</I>,
|
||||
with the empty preposition.
|
||||
</P>
|
||||
<PRE>
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>la connessione di x a y</I>) need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>the old town hall of</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc6"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names need a string and a gender.
|
||||
The default gender is feminine for names ending with <I>a</I>, otherwise masculine.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : (Anna : Str) -> PN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
For regular adjectives, all forms are derived from the
|
||||
masculine singular. The types of adjectives that are recognized are
|
||||
<I>alto</I>, <I>fuerte</I>, <I>util</I>. Comparison is formed by <I>mas</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (util : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
One-place adjectives compared with <I>mas</I> need five forms in the worst
|
||||
case (masc and fem singular, masc plural, adverbial).
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (solo,sola,solos,solas,solamiento : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, two separate adjectives are given:
|
||||
the positive (<I>bueno</I>), and the comparative (<I>mejor</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (bueno : A) -> (mejor : A) -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The functions above create postfix adjectives. To switch
|
||||
them to prefix ones (i.e. ones placed before the noun in
|
||||
modification, as in <I>bueno vino</I>), the following function is
|
||||
provided.
|
||||
</P>
|
||||
<PRE>
|
||||
prefixA : A -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some appear next to the verb (e.g. <I>siempre</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdV : Str -> AdV ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H2>Verbs</H2>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Regular verbs are ones inflected like <I>cortar</I>, <I>deber</I>, or <I>vivir</I>.
|
||||
The regular verb function is the first conjugation (<I>ar</I>) recognizes
|
||||
the variations corresponding to the patterns
|
||||
<I>actuar, cazar, guiar, pagar, sacar</I>. The module <CODE>BeschSpa</CODE> gives
|
||||
the complete set of <I>Bescherelle</I> conjugations.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (pagar : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Verbs with vowel alternatition in the stem - easiest to give with
|
||||
two forms, e.g. <I>mostrar///</I>muestro//.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (mostrar,muestro : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Most irreguler verbs are found in <CODE>IrregSpa</CODE>. If this is not enough,
|
||||
the module <CODE>BeschSpa</CODE> gives all the patterns of the <I>Bescherelle</I>
|
||||
book. To use them in the category <CODE>V</CODE>, wrap them with the function
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : Verbum -> V
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To form reflexive verbs:
|
||||
</P>
|
||||
<PRE>
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Verbs with a deviant passive participle: just give the participle
|
||||
in masculine singular form as second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
special_ppV : V -> Str -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, except the special case with direct object.
|
||||
(transitive verbs).
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
You can reuse a <CODE>V2</CODE> verb in <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
v2V : V2 -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- hablar, a, di
|
||||
dirV3 : V -> Prep -> V3 ; -- dar,(accusative),a
|
||||
dirdirV3 : V -> V3 ; -- dar,(dative),(accusative)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "quiero hablar"
|
||||
deVV : V -> VV ; -- "terminar de hablar"
|
||||
aVV : V -> VV ; -- "aprender a hablar"
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc spanish/ParadigmsSpa.txt -->
|
||||
</BODY></HTML>
|
||||
432
lib/resource/doc/gfdoc/ParadigmsSwe.html
Normal file
@@ -0,0 +1,432 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Swedish Lexical Paradigms</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Swedish Lexical Paradigms</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2007-07-06 09:20:11 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Parameters</A>
|
||||
<LI><A HREF="#toc2">Nouns</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc3">Relational nouns</A>
|
||||
<LI><A HREF="#toc4">Relational common noun phrases</A>
|
||||
<LI><A HREF="#toc5">Proper names and noun phrases</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc6">Adjectives</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc7">Two-place adjectives</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc8">Adverbs</A>
|
||||
<LI><A HREF="#toc9">Verbs</A>
|
||||
<UL>
|
||||
<LI><A HREF="#toc10">Deponent verbs.</A>
|
||||
<LI><A HREF="#toc11">Two-place verbs</A>
|
||||
<LI><A HREF="#toc12">Three-place verbs</A>
|
||||
<LI><A HREF="#toc13">Other complement patterns</A>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Aarne Ranta 2001 - 2006
|
||||
</P>
|
||||
<P>
|
||||
This is an API for the user of the resource grammar
|
||||
for adding lexical items. It gives functions for forming
|
||||
expressions of open categories: nouns, adjectives, verbs.
|
||||
</P>
|
||||
<P>
|
||||
Closed categories (determiners, pronouns, conjunctions) are
|
||||
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
|
||||
</P>
|
||||
<P>
|
||||
The main difference with <CODE>MorphoSwe.gf</CODE> is that the types
|
||||
referred to are compiled resource grammar types. We have moreover
|
||||
had the design principle of always having existing forms, rather
|
||||
than stems, as string arguments of the paradigms.
|
||||
</P>
|
||||
<P>
|
||||
The structure of functions for each word class <CODE>C</CODE> is the following:
|
||||
first we give a handful of patterns that aim to cover all
|
||||
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
|
||||
escape to construct the most irregular words of type <CODE>C</CODE>.
|
||||
However, this function should only seldom be needed: we have a
|
||||
separate module <A HREF="../../swedish/IrregSwe"><CODE>IrregSwe</CODE></A>,
|
||||
which covers many irregular verbs.
|
||||
</P>
|
||||
<PRE>
|
||||
resource ParadigmsSwe =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonScand,
|
||||
ResSwe,
|
||||
MorphoSwe,
|
||||
CatSwe in {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Parameters</H2>
|
||||
<P>
|
||||
To abstract over gender names, we define the following identifiers.
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
utrum : Gender ;
|
||||
neutrum : Gender ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over number names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
To abstract over case names, we define the following.
|
||||
</P>
|
||||
<PRE>
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Prepositions used in many-argument functions can be constructed from strings.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ; -- empty string
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Nouns</H2>
|
||||
<P>
|
||||
The following overloaded paradigm takes care of all noun formation.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The one-argument case takes the singular indefinite form and computes
|
||||
the other forms and the gender by a simple heuristic. The heuristic is currently
|
||||
to treat all words ending with <I>a</I> like <I>apa-apor</I>, with <I>e</I> like <I>rike-riken</I>,
|
||||
and otherwise like <I>bil-bilar</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (apa : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The case with a string and gender makes it possible to treat
|
||||
<I>lik</I> (neutrum) and <I>pojke</I> (utrum).
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (lik : Str) -> Gender -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Giving two forms - the singular and plural indefinite - is sufficient for
|
||||
most nouns. The paradigm deals correctly with the vowel contractions in
|
||||
<I>nyckel - nycklar</I> such as <I>pojke - pojkar</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (nyckel,nycklar : Str) -> N ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, four forms are needed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN : (museum,museet,museer,museerna : Str) -> N
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
All the functions above work quite as well to form <B>compound nouns</B>,
|
||||
such as <I>fotboll</I>.
|
||||
</P>
|
||||
<A NAME="toc3"></A>
|
||||
<H3>Relational nouns</H3>
|
||||
<P>
|
||||
Relational nouns (<I>kung av x</I>) are nouns with a preposition.
|
||||
As a special case, we provide regular nouns (formed with one-argument <CODE>mkN</CODE>)
|
||||
with the preposition <I>av</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN2 : overload {
|
||||
mkN2 : Str -> N2 ;
|
||||
mkN2 : N -> Prep -> N2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Three-place relational nouns (<I>förbindelse från x till y</I>)
|
||||
need two prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H3>Relational common noun phrases</H3>
|
||||
<P>
|
||||
In some cases, you may want to make a complex <CODE>CN</CODE> into a
|
||||
relational noun (e.g. <I>den före detta maken till</I>). However, <CODE>N2</CODE> and
|
||||
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
|
||||
and <CODE>PrepNP</CODE> constructions to build phrases like this.
|
||||
</P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>Proper names and noun phrases</H3>
|
||||
<P>
|
||||
Proper names, with a regular genitive, are formed from strings and
|
||||
have the default gender utrum.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ;
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, the genitive form is irregular.
|
||||
</P>
|
||||
<PRE>
|
||||
mkPN : (jesus,jesu : Str) -> Gender -> PN
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Adjectives</H2>
|
||||
<P>
|
||||
Adjectives need one to seven forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Most adjectives are formed simply by adding endings to a stem.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (billig : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Some adjectives have a deviant neuter form. The following pattern
|
||||
also recognizes the neuter formation <I>galen-galet</I> and forms the
|
||||
proper plural and comparison forms <I>galna-galnare-galnast</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (bred,brett : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Umlaut in comparison forms is
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (tung,tyngre,tyngst : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A few adjectives need 5 forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (god,gott,goda,battre,bast : Str) -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Hardly any other adjective than <I>liten</I> needs the full 7 forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA : (liten,litet,lilla,sma,mindre,minst,minsta : Str) -> A
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Comparison forms may be compound (<I>mera svensk</I> - <I>mest svensk</I>);
|
||||
this behaviour can be forced on any adjective.
|
||||
</P>
|
||||
<PRE>
|
||||
compoundA : A -> A ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H3>Two-place adjectives</H3>
|
||||
<P>
|
||||
Two-place adjectives need a preposition for their second argument.
|
||||
</P>
|
||||
<PRE>
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc8"></A>
|
||||
<H2>Adverbs</H2>
|
||||
<P>
|
||||
Adverbs are not inflected. Most lexical ones have position
|
||||
after the verb. Some can be preverbal in subordinate position
|
||||
(e.g. <I>alltid</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdv : Str -> Adv ; -- här
|
||||
mkAdV : Str -> AdV ; -- alltid
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs modifying adjectives and sentences can also be formed.
|
||||
</P>
|
||||
<PRE>
|
||||
mkAdA : Str -> AdA ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc9"></A>
|
||||
<H2>Verbs</H2>
|
||||
<P>
|
||||
All verbs can be defined by the overloaded paradigm <CODE>mkV</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : overload {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The 'regular verb' (= one-place) case is inspired by Lexin. It uses the
|
||||
present tense indicative form. The value is the first conjugation if the
|
||||
argument ends with <I>ar</I> (<I>tala</I> - <I>talar</I> - <I>talade</I> - <I>talat</I>),
|
||||
the second with <I>er</I> (<I>leka</I> - <I>leker</I> - <I>lekte</I> - <I>lekt</I>, with the
|
||||
variations like in <I>gräva</I>, <I>vända</I>, <I>tyda</I>, <I>hyra</I>), and
|
||||
the third in other cases (<I>bo</I> - <I>bor</I> - <I>bodde</I> - <I>bott</I>).
|
||||
It is also possible to give the infinite form to it; they are treated
|
||||
as if they were implicitly suffixed by <I>r</I>. Moreover, deponent verbs
|
||||
are recognized from the final <I>s</I> (<I>hoppas</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (stämmer : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Most irregular verbs need just the conventional three forms.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (dricka,drack,druckit : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
In the worst case, six forms are given.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : (gå,går,gå,gick,gått,gången : Str) -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Particle verbs, such as <I>passa på</I>, are formed by adding a string to a verb.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV : V -> Str -> V
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc10"></A>
|
||||
<H3>Deponent verbs.</H3>
|
||||
<P>
|
||||
Some words are used in passive forms only, e.g. <I>hoppas</I>, some as
|
||||
reflexive e.g. <I>ångra sig</I>. Regular deponent verbs are also
|
||||
handled by <CODE>mkV</CODE> and recognized from the ending <I>s</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
depV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc11"></A>
|
||||
<H3>Two-place verbs</H3>
|
||||
<P>
|
||||
Two-place verbs need a preposition, which default to the 'empty preposition'
|
||||
i.e. direct object. (transitive verbs). The simplest case is a regular
|
||||
verb (as in <CODE>mkV</CODE>) with a direct object.
|
||||
Notice that, if a particle is needed, it comes from the <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc12"></A>
|
||||
<H3>Three-place verbs</H3>
|
||||
<P>
|
||||
Three-place (ditransitive) verbs need two prepositions, of which
|
||||
the first one or both can be absent. The simplest case is a regular
|
||||
verb (as in <CODE>mkV</CODE>) with no prepositions.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV3 : overload {
|
||||
mkV3 : Str -> V3 ;
|
||||
mkV3 : V -> V3 ;
|
||||
mkV3 : V -> Prep -> V3 ;
|
||||
mkV3 : V -> Prep -> Prep -> V3
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc13"></A>
|
||||
<H3>Other complement patterns</H3>
|
||||
<P>
|
||||
Verbs and adjectives can take complements such as sentences,
|
||||
questions, verb phrases, and adjectives.
|
||||
</P>
|
||||
<PRE>
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
|
||||
just as synonyms of <CODE>V2</CODE>, and the second argument is given
|
||||
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
|
||||
<CODE>V0</CODE> is just <CODE>V</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc swedish/ParadigmsSwe.txt -->
|
||||
</BODY></HTML>
|
||||
86
lib/resource/doc/gfdoc/Phrase.html
Normal file
@@ -0,0 +1,86 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Phrase: Phrases and Utterances</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Phrase: Phrases and Utterances</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-12-13 09:36:48 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Phrase = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
When a phrase is built from an utterance it can be prefixed
|
||||
with a phrasal conjunction (such as <I>but</I>, <I>therefore</I>)
|
||||
and suffixing with a vocative (typically a noun phrase).
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
PhrUtt : PConj -> Utt -> Voc -> Phr ; -- But go home my friend.
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Utterances are formed from sentences, questions, and imperatives.
|
||||
</P>
|
||||
<PRE>
|
||||
UttS : S -> Utt ; -- John walks
|
||||
UttQS : QS -> Utt ; -- is it good
|
||||
UttImpSg : Pol -> Imp -> Utt; -- (don't) help yourself
|
||||
UttImpPl : Pol -> Imp -> Utt; -- (don't) help yourselves
|
||||
UttImpPol : Pol -> Imp -> Utt ; -- (don't) help (polite)
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
There are also 'one-word utterances'. A typical use of them is
|
||||
as answers to questions.
|
||||
<B>Note</B>. This list is incomplete. More categories could be covered.
|
||||
Moreover, in many languages e.g. noun phrases in different cases
|
||||
can be used.
|
||||
</P>
|
||||
<PRE>
|
||||
UttIP : IP -> Utt ; -- who
|
||||
UttIAdv : IAdv -> Utt ; -- why
|
||||
UttNP : NP -> Utt ; -- this man
|
||||
UttAdv : Adv -> Utt ; -- here
|
||||
UttVP : VP -> Utt ; -- to sleep
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The phrasal conjunction is optional. A sentence conjunction
|
||||
can also used to prefix an utterance.
|
||||
</P>
|
||||
<PRE>
|
||||
NoPConj : PConj ;
|
||||
PConjConj : Conj -> PConj ; -- and
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The vocative is optional. Any noun phrase can be made into vocative,
|
||||
which may be overgenerating (e.g. <I>I</I>).
|
||||
</P>
|
||||
<PRE>
|
||||
NoVoc : Voc ;
|
||||
VocNP : NP -> Voc ; -- my friend
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Phrase.txt -->
|
||||
</BODY></HTML>
|
||||
180
lib/resource/doc/gfdoc/Precedence.html
Normal file
@@ -0,0 +1,180 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Last update: 2005-11-23 09:16:18 CET
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
operations for precedence-dependent strings.
|
||||
five levels:
|
||||
p4 (constants), p3 (applications), p2 (products), p1 (sums), p0 (arrows)
|
||||
</P>
|
||||
<PRE>
|
||||
resource Precedence = open Prelude in {
|
||||
|
||||
param
|
||||
Prec = p4 | p3 | p2 | p1 | p0 ;
|
||||
|
||||
lintype
|
||||
PrecTerm = Prec => Str ;
|
||||
|
||||
oper
|
||||
pss : PrecTerm -> {s : PrecTerm} = \s -> {s = s} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
change this if you want some other type of parentheses
|
||||
</P>
|
||||
<PRE>
|
||||
mkParenth : Str -> Str = \str -> "(" ++ str ++ ")" ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
define ordering of precedences
|
||||
</P>
|
||||
<PRE>
|
||||
nextPrec : Prec => Prec =
|
||||
table {p0 => p1 ; p1 => p2 ; p2 => p3 ; _ => p4} ;
|
||||
prevPrec : Prec => Prec =
|
||||
table {p4 => p3 ; p3 => p2 ; p2 => p1 ; _ => p0} ;
|
||||
|
||||
mkPrec : Str -> Prec => Prec => Str = \str ->
|
||||
table {
|
||||
p4 => table { -- use the term of precedence p4...
|
||||
_ => str} ; -- ...always without parentheses
|
||||
p3 => table { -- use the term of precedence p3...
|
||||
p4 => mkParenth str ; -- ...in parentheses if p4 is required...
|
||||
_ => str} ; -- ...otherwise without parentheses
|
||||
p2 => table {
|
||||
p4 => mkParenth str ;
|
||||
p3 => mkParenth str ;
|
||||
_ => str} ;
|
||||
p1 => table {
|
||||
p1 => str ;
|
||||
p0 => str ;
|
||||
_ => mkParenth str} ;
|
||||
p0 => table {
|
||||
p0 => str ;
|
||||
_ => mkParenth str}
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string into a constant, of precedence p4
|
||||
</P>
|
||||
<PRE>
|
||||
mkConst : Str -> PrecTerm =
|
||||
\f ->
|
||||
mkPrec f ! p4 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string into a 1/2/3 -place prefix operator, of precedence p3
|
||||
</P>
|
||||
<PRE>
|
||||
mkFun1 : Str -> PrecTerm -> PrecTerm =
|
||||
\f -> \x ->
|
||||
table {k => mkPrec (f ++ x ! p4) ! p3 ! k} ;
|
||||
mkFun2 : Str -> PrecTerm -> PrecTerm -> PrecTerm =
|
||||
\f -> \x -> \y ->
|
||||
table {k => mkPrec (f ++ x ! p4 ++ y ! p4) ! p3 ! k} ;
|
||||
mkFun3 : Str -> PrecTerm -> PrecTerm -> PrecTerm -> PrecTerm =
|
||||
\f -> \x -> \y -> \z ->
|
||||
table {k => mkPrec (f ++ x ! p4 ++ y ! p4 ++ z ! p4) ! p3 ! k} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string into a non/left/right -associative infix operator, of precedence p
|
||||
</P>
|
||||
<PRE>
|
||||
mkInfix : Str -> Prec -> PrecTerm -> PrecTerm -> PrecTerm =
|
||||
\f -> \p -> \x -> \y ->
|
||||
table {k => mkPrec (x ! (nextPrec ! p) ++ f ++ y ! (nextPrec ! p)) ! p ! k} ;
|
||||
mkInfixL : Str -> Prec -> PrecTerm -> PrecTerm -> PrecTerm =
|
||||
\f -> \p -> \x -> \y ->
|
||||
table {k => mkPrec (x ! p ++ f ++ y ! (nextPrec ! p)) ! p ! k} ;
|
||||
mkInfixR : Str -> Prec -> PrecTerm -> PrecTerm -> PrecTerm =
|
||||
\f -> \p -> \x -> \y ->
|
||||
table {k => mkPrec (x ! (nextPrec ! p) ++ f ++ y ! p) ! p ! k} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P>
|
||||
alternative:
|
||||
precedence as inherent feature
|
||||
</P>
|
||||
<PRE>
|
||||
lintype TermWithPrec = {s : Str ; p : Prec} ;
|
||||
|
||||
oper
|
||||
mkpPrec : Str -> Prec -> TermWithPrec =
|
||||
\f -> \p ->
|
||||
{s = f ; p = p} ;
|
||||
|
||||
usePrec : TermWithPrec -> Prec -> Str =
|
||||
\x -> \p ->
|
||||
mkPrec x.s ! x.p ! p ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string into a constant, of precedence p4
|
||||
</P>
|
||||
<PRE>
|
||||
mkpConst : Str -> TermWithPrec =
|
||||
\f ->
|
||||
mkpPrec f p4 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string into a 1/2/3 -place prefix operator, of precedence p3
|
||||
</P>
|
||||
<PRE>
|
||||
mkpFun1 : Str -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \x ->
|
||||
mkpPrec (f ++ usePrec x p4) p3 ;
|
||||
|
||||
mkpFun2 : Str -> TermWithPrec -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \x -> \y ->
|
||||
mkpPrec (f ++ usePrec x p4 ++ usePrec y p4) p3 ;
|
||||
|
||||
mkpFun3 : Str -> TermWithPrec -> TermWithPrec -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \x -> \y -> \z ->
|
||||
mkpPrec (f ++ usePrec x p4 ++ usePrec y p4 ++ usePrec z p4) p3 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
make a string a into non/left/right -associative infix operator, of precedence p
|
||||
</P>
|
||||
<PRE>
|
||||
mkpInfix : Str -> Prec -> TermWithPrec -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \p -> \x -> \y ->
|
||||
mkpPrec (usePrec x (nextPrec ! p) ++ f ++ usePrec y (nextPrec ! p)) p ;
|
||||
mkpInfixL : Str -> Prec -> TermWithPrec -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \p -> \x -> \y ->
|
||||
mkpPrec (usePrec x p ++ f ++ usePrec y (nextPrec ! p)) p ;
|
||||
mkpInfixR : Str -> Prec -> TermWithPrec -> TermWithPrec -> TermWithPrec =
|
||||
\f -> \p -> \x -> \y ->
|
||||
mkpPrec (usePrec x (nextPrec ! p) ++ f ++ usePrec y p) p ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc ../prelude/Precedence.txt -->
|
||||
</BODY></HTML>
|
||||
67
lib/resource/doc/gfdoc/Predef.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Predefined functions for concrete syntax</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Predefined functions for concrete syntax</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-09-01 16:37:08 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
The definitions of these constants are hard-coded in GF, and defined
|
||||
in <A HREF="../src/GF/Grammar/AppPredefined.hs">AppPredefined.hs</A>. Applying
|
||||
them to run-time variables leads to compiler errors that are often
|
||||
only detected at the code generation time.
|
||||
</P>
|
||||
<PRE>
|
||||
resource Predef = {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This type of booleans is for internal use only.
|
||||
</P>
|
||||
<PRE>
|
||||
param PBool = PTrue | PFalse ;
|
||||
|
||||
oper Error : Type = variants {} ; -- the empty type
|
||||
oper Int : Type = variants {} ; -- the type of integers
|
||||
oper Ints : Int -> Type = variants {} ; -- the type of integers from 0 to n
|
||||
|
||||
oper error : Str -> Error = variants {} ; -- forms error message
|
||||
oper length : Tok -> Int = variants {} ; -- length of string
|
||||
oper drop : Int -> Tok -> Tok = variants {} ; -- drop prefix of length
|
||||
oper take : Int -> Tok -> Tok = variants {} ; -- take prefix of length
|
||||
oper tk : Int -> Tok -> Tok = variants {} ; -- drop suffix of length
|
||||
oper dp : Int -> Tok -> Tok = variants {} ; -- take suffix of length
|
||||
oper eqInt : Int -> Int -> PBool = variants {} ; -- test if equal integers
|
||||
oper lessInt: Int -> Int -> PBool = variants {} ; -- test order of integers
|
||||
oper plus : Int -> Int -> Int = variants {} ; -- add integers
|
||||
oper eqStr : Tok -> Tok -> PBool = variants {} ; -- test if equal strings
|
||||
oper occur : Tok -> Tok -> PBool = variants {} ; -- test if occurs as substring
|
||||
oper occurs : Tok -> Tok -> PBool = variants {} ; -- test if any char occurs
|
||||
oper show : (P : Type) -> P -> Tok = variants {} ; -- convert param to string
|
||||
oper read : (P : Type) -> Tok -> P = variants {} ; -- convert string to param
|
||||
oper toStr : (L : Type) -> L -> Str = variants {} ; -- find the "first" string
|
||||
oper mapStr : (L : Type) -> (Str -> Str) -> L -> L = variants {} ;
|
||||
-- map all strings in a data structure; experimental ---
|
||||
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc ../prelude/Predef.txt -->
|
||||
</BODY></HTML>
|
||||
32
lib/resource/doc/gfdoc/PredefAbs.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<FONT SIZE="4">
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Last update: 2006-06-02 17:49:44 CEST
|
||||
</P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract PredefAbs = {
|
||||
cat Int ; String ; Float ;
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc ../prelude/PredefAbs.txt -->
|
||||
</BODY></HTML>
|
||||
113
lib/resource/doc/gfdoc/Predication.html
Normal file
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> A Small Predication Library</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> A Small Predication Library</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-02-28 09:26:58 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">The category of atomic sentences</A>
|
||||
<LI><A HREF="#toc2">Predication patterns.</A>
|
||||
<LI><A HREF="#toc3">Imperatives and infinitives.</A>
|
||||
<LI><A HREF="#toc4">Individual-valued function applications</A>
|
||||
<LI><A HREF="#toc5">Families of types</A>
|
||||
<LI><A HREF="#toc6">Type constructor</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
(c) Aarne Ranta 2003-2006 under Gnu GPL.
|
||||
</P>
|
||||
<P>
|
||||
This library is a derived library built on the language-independent Ground
|
||||
API of resource grammars.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Predication = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>The category of atomic sentences</H2>
|
||||
<P>
|
||||
We want to use sentences in positive and negative forms but do not care about
|
||||
tenses.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
PosCl : Cl -> S ; -- positive sentence: "x intersects y"
|
||||
NegCl : Cl -> S ; -- negative sentence: "x doesn't intersect y"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Predication patterns.</H2>
|
||||
<PRE>
|
||||
predV : V -> NP -> Cl ; -- one-place verb: "x converges"
|
||||
predV2 : V2 -> NP -> NP -> Cl ; -- two-place verb: "x intersects y"
|
||||
predV3 : V3 -> NP->NP-> NP -> Cl; -- three-place verb: "x intersects y at z"
|
||||
predVColl : V -> NP -> NP -> Cl ; -- collective verb: "x and y intersect"
|
||||
predA : A -> NP -> Cl ; -- one-place adjective: "x is even"
|
||||
predA2 : A2 -> NP -> NP -> Cl ; -- two-place adj: "x is divisible by y"
|
||||
predAComp : A -> NP -> NP -> Cl; -- comparative adj: "x is greater than y"
|
||||
predAColl : A -> NP -> NP -> Cl ; -- collective adj: "x and y are parallel"
|
||||
predN : N -> NP -> Cl ; -- one-place noun: "x is a point"
|
||||
predN2 : N2 -> NP -> NP -> Cl ; -- two-place noun: "x is a divisor of y"
|
||||
predNColl : N -> NP -> NP -> Cl ; -- collective noun: "x and y are duals"
|
||||
predAdv : Adv -> NP -> Cl ; -- adverb: "x is inside"
|
||||
predPrep : Prep -> NP -> NP -> Cl ; -- preposition: "x is outside y"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Imperatives and infinitives.</H2>
|
||||
<PRE>
|
||||
impV2 : V2 -> NP -> Phr ; -- imperative: "solve the equation E"
|
||||
infV2 : V2 -> NP -> Phr ; -- infinitive: "to solve the equation E"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Individual-valued function applications</H2>
|
||||
<PRE>
|
||||
appN2 : N2 -> NP -> NP ; -- one-place function: "the successor of x"
|
||||
appN3 : N3 -> NP -> NP -> NP ; -- two-place function: "the distance from x to y"
|
||||
appColl : N2 -> NP -> NP -> NP ; -- collective function: "the sum of x and y"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Families of types</H2>
|
||||
<P>
|
||||
These are expressed by relational nouns applied to arguments.
|
||||
</P>
|
||||
<PRE>
|
||||
famN2 : N2 -> NP -> CN ; -- one-place family: "divisor of x"
|
||||
famN3 : N3 -> NP -> NP -> CN ; -- two-place family: "path from x to y"
|
||||
famColl : N2 -> NP -> NP -> CN ; -- collective family: "path between x and y"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Type constructor</H2>
|
||||
<P>
|
||||
This is similar to a family except that the argument is a type.
|
||||
</P>
|
||||
<PRE>
|
||||
typN2 : N2 -> CN -> CN ; -- constructed type: "list of integers"
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc mathematical/Predication.txt -->
|
||||
</BODY></HTML>
|
||||
222
lib/resource/doc/gfdoc/Prelude.html
Normal file
@@ -0,0 +1,222 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> The GF Prelude</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> The GF Prelude</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-02-27 09:41:31 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Strings, records, and tables</A>
|
||||
<LI><A HREF="#toc2">Optional elements</A>
|
||||
<LI><A HREF="#toc3">Infixes. prefixes, and postfixes</A>
|
||||
<LI><A HREF="#toc4">Booleans</A>
|
||||
<LI><A HREF="#toc5">High-level acces to Predef operations</A>
|
||||
<LI><A HREF="#toc6">Lexer-related operations</A>
|
||||
<LI><A HREF="#toc7">Miscellaneous</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This file defines some prelude facilities usable in all grammars.
|
||||
</P>
|
||||
<PRE>
|
||||
resource Prelude = open (Predef=Predef) in {
|
||||
|
||||
oper
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Strings, records, and tables</H2>
|
||||
<PRE>
|
||||
SS : Type = {s : Str} ;
|
||||
ss : Str -> SS = \s -> {s = s} ;
|
||||
ss2 : (_,_ : Str) -> SS = \x,y -> ss (x ++ y) ;
|
||||
ss3 : (_,_ ,_: Str) -> SS = \x,y,z -> ss (x ++ y ++ z) ;
|
||||
|
||||
cc2 : (_,_ : SS) -> SS = \x,y -> ss (x.s ++ y.s) ;
|
||||
cc3 : (_,_,_ : SS) -> SS = \x,y,z -> ss (x.s ++ y.s ++ z.s) ;
|
||||
|
||||
SS1 : Type -> Type = \P -> {s : P => Str} ;
|
||||
ss1 : (A : Type) -> Str -> SS1 A = \A,s -> {s = table {_ => s}} ;
|
||||
|
||||
SP1 : Type -> Type = \P -> {s : Str ; p : P} ;
|
||||
sp1 : (A : Type) -> Str -> A -> SP1 A = \_,s,a -> {s = s ; p = a} ;
|
||||
|
||||
constTable : (A,B : Type) -> B -> A => B = \_,_,b -> \\_ => b ;
|
||||
constStr : (A : Type) -> Str -> A => Str = \A -> constTable A Str ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Discontinuous constituents.
|
||||
</P>
|
||||
<PRE>
|
||||
SD2 = {s1,s2 : Str} ;
|
||||
sd2 : (_,_ : Str) -> SD2 = \x,y -> {s1 = x ; s2 = y} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Optional elements</H2>
|
||||
<P>
|
||||
Missing form.
|
||||
</P>
|
||||
<PRE>
|
||||
nonExist : Str = variants {} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Optional string with preference on the string vs. empty.
|
||||
</P>
|
||||
<PRE>
|
||||
optStr : Str -> Str = \s -> variants {s ; []} ;
|
||||
strOpt : Str -> Str = \s -> variants {[] ; s} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Free order between two strings.
|
||||
</P>
|
||||
<PRE>
|
||||
bothWays : Str -> Str -> Str = \x,y -> variants {x ++ y ; y ++ x} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Parametric order between two strings.
|
||||
</P>
|
||||
<PRE>
|
||||
preOrPost : Bool -> Str -> Str -> Str = \pr,x,y ->
|
||||
if_then_Str pr (x ++ y) (y ++ x) ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Infixes. prefixes, and postfixes</H2>
|
||||
<P>
|
||||
Fixes with precedences are defined in <A HREF="Precedence.html">Precedence</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
infixSS : Str -> SS -> SS -> SS = \f,x,y -> ss (x.s ++ f ++ y.s) ;
|
||||
prefixSS : Str -> SS -> SS = \f,x -> ss (f ++ x.s) ;
|
||||
postfixSS : Str -> SS -> SS = \f,x -> ss (x.s ++ f) ;
|
||||
embedSS : Str -> Str -> SS -> SS = \f,g,x -> ss (f ++ x.s ++ g) ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Booleans</H2>
|
||||
<PRE>
|
||||
param Bool = True | False ;
|
||||
|
||||
oper
|
||||
if_then_else : (A : Type) -> Bool -> A -> A -> A = \_,c,d,e ->
|
||||
case c of {
|
||||
True => d ; ---- should not need to qualify
|
||||
False => e
|
||||
} ;
|
||||
|
||||
andB : (_,_ : Bool) -> Bool = \a,b -> if_then_else Bool a b False ;
|
||||
orB : (_,_ : Bool) -> Bool = \a,b -> if_then_else Bool a True b ;
|
||||
notB : Bool -> Bool = \a -> if_then_else Bool a False True ;
|
||||
|
||||
if_then_Str : Bool -> Str -> Str -> Str = if_then_else Str ;
|
||||
|
||||
onlyIf : Bool -> Str -> Str = \b,s -> case b of {
|
||||
True => s ;
|
||||
_ => nonExist
|
||||
} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Interface to internal booleans
|
||||
</P>
|
||||
<PRE>
|
||||
pbool2bool : Predef.PBool -> Bool = \b -> case b of {
|
||||
Predef.PFalse => False ; Predef.PTrue => True
|
||||
} ;
|
||||
|
||||
init : Tok -> Tok = Predef.tk 1 ;
|
||||
last : Tok -> Tok = Predef.dp 1 ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>High-level acces to Predef operations</H2>
|
||||
<PRE>
|
||||
isNil : Tok -> Bool = \b -> pbool2bool (Predef.eqStr [] b) ;
|
||||
|
||||
ifTok : (A : Type) -> Tok -> Tok -> A -> A -> A = \A,t,u,a,b ->
|
||||
case Predef.eqStr t u of {Predef.PTrue => a ; Predef.PFalse => b} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc6"></A>
|
||||
<H2>Lexer-related operations</H2>
|
||||
<P>
|
||||
Bind together two tokens in some lexers, either obligatorily or optionally
|
||||
</P>
|
||||
<PRE>
|
||||
oper
|
||||
glue : Str -> Str -> Str = \x,y -> x ++ BIND ++ y ;
|
||||
glueOpt : Str -> Str -> Str = \x,y -> variants {glue x y ; x ++ y} ;
|
||||
noglueOpt : Str -> Str -> Str = \x,y -> variants {x ++ y ; glue x y} ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Force capitalization of next word in some unlexers
|
||||
</P>
|
||||
<PRE>
|
||||
capitalize : Str -> Str = \s -> CAPIT ++ s ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
These should be hidden, and never changed since they are hardcoded in (un)lexers
|
||||
</P>
|
||||
<PRE>
|
||||
BIND : Str = "&+" ;
|
||||
PARA : Str = "&-" ;
|
||||
CAPIT : Str = "&|" ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc7"></A>
|
||||
<H2>Miscellaneous</H2>
|
||||
<P>
|
||||
Identity function
|
||||
</P>
|
||||
<PRE>
|
||||
id : (A : Type) -> A -> A = \_,a -> a ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Parentheses
|
||||
</P>
|
||||
<PRE>
|
||||
paren : Str -> Str = \s -> "(" ++ s ++ ")" ;
|
||||
parenss : SS -> SS = \s -> ss (paren s.s) ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Zero, one, two, or more (elements in a list etc)
|
||||
</P>
|
||||
<PRE>
|
||||
param
|
||||
ENumber = E0 | E1 | E2 | Emore ;
|
||||
|
||||
oper
|
||||
eNext : ENumber -> ENumber = \e -> case e of {
|
||||
E0 => E1 ; E1 => E2 ; _ => Emore} ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc ../prelude/Prelude.txt -->
|
||||
</BODY></HTML>
|
||||
64
lib/resource/doc/gfdoc/Question.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Question: Questions and Interrogative Pronouns</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Question: Questions and Interrogative Pronouns</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Question = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
A question can be formed from a clause ('yes-no question') or
|
||||
with an interrogative.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
QuestCl : Cl -> QCl ; -- does John walk
|
||||
QuestVP : IP -> VP -> QCl ; -- who walks
|
||||
QuestSlash : IP -> Slash -> QCl ; -- who does John love
|
||||
QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
QuestIComp : IComp -> NP -> QCl ; -- where is John
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Interrogative pronouns can be formed with interrogative
|
||||
determiners.
|
||||
</P>
|
||||
<PRE>
|
||||
IDetCN : IDet -> Num -> Ord -> CN -> IP; -- which five best songs
|
||||
AdvIP : IP -> Adv -> IP ; -- who in Europe
|
||||
|
||||
PrepIP : Prep -> IP -> IAdv ; -- with whom
|
||||
|
||||
CompIAdv : IAdv -> IComp ; -- where
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
More <CODE>IP</CODE>, <CODE>IDet</CODE>, and <CODE>IAdv</CODE> are defined in
|
||||
<A HREF="Structural.html"><CODE>Structural</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Question.txt -->
|
||||
</BODY></HTML>
|
||||
61
lib/resource/doc/gfdoc/Relative.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Relative clauses and pronouns</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Relative clauses and pronouns</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-26 13:24:17 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Relative = Cat ** {
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The simplest way to form a relative clause is from a clause by
|
||||
a pronoun similar to <I>such that</I>.
|
||||
</P>
|
||||
<PRE>
|
||||
RelCl : Cl -> RCl ; -- such that John loves her
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The more proper ways are from a verb phrase
|
||||
(formed in <A HREF="Verb.html"><CODE>Verb</CODE></A>) or a sentence
|
||||
with a missing noun phrase (formed in <A HREF="Sentence.html"><CODE>Sentence</CODE></A>).
|
||||
</P>
|
||||
<PRE>
|
||||
RelVP : RP -> VP -> RCl ; -- who loves John
|
||||
RelSlash : RP -> Slash -> RCl ; -- whom John loves
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Relative pronouns are formed from an 'identity element' by prefixing
|
||||
or suffixing (depending on language) prepositional phrases.
|
||||
</P>
|
||||
<PRE>
|
||||
IdRP : RP ; -- which
|
||||
FunRP : Prep -> NP -> RP -> RP ; -- all the roots of which
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Relative.txt -->
|
||||
</BODY></HTML>
|
||||
124
lib/resource/doc/gfdoc/Sentence.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Sentence: Sentences, Clauses, and Imperatives</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Sentence: Sentences, Clauses, and Imperatives</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-12-18 16:59:02 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Clauses</A>
|
||||
<LI><A HREF="#toc2">Clauses missing object noun phrases</A>
|
||||
<LI><A HREF="#toc3">Imperatives</A>
|
||||
<LI><A HREF="#toc4">Embedded sentences</A>
|
||||
<LI><A HREF="#toc5">Sentences</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Sentence = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Clauses</H2>
|
||||
<P>
|
||||
The <CODE>NP VP</CODE> predication rule form a clause whose linearization
|
||||
gives a table of all tense variants, positive and negative.
|
||||
Clauses are converted to <CODE>S</CODE> (with fixed tense) with the
|
||||
<CODE>UseCl</CODE> function below.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
PredVP : NP -> VP -> Cl ; -- John walks
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Using an embedded sentence as a subject is treated separately.
|
||||
This can be overgenerating. E.g. <I>whether you go</I> as subject
|
||||
is only meaningful for some verb phrases.
|
||||
</P>
|
||||
<PRE>
|
||||
PredSCVP : SC -> VP -> Cl ; -- that you go makes me happy
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Clauses missing object noun phrases</H2>
|
||||
<P>
|
||||
This category is a variant of the 'slash category' <CODE>S/NP</CODE> of
|
||||
GPSG and categorial grammars, which in turn replaces
|
||||
movement transformations in the formation of questions
|
||||
and relative clauses. Except <CODE>SlashV2</CODE>, the construction
|
||||
rules can be seen as special cases of function composition, in
|
||||
the style of CCG.
|
||||
<B>Note</B> the set is not complete and lacks e.g. verbs with more than 2 places.
|
||||
</P>
|
||||
<PRE>
|
||||
SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees
|
||||
SlashVVV2 : NP -> VV -> V2 -> Slash; -- (whom) he wants to see
|
||||
AdvSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow
|
||||
SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Imperatives</H2>
|
||||
<P>
|
||||
An imperative is straightforwardly formed from a verb phrase.
|
||||
It has variation over positive and negative, singular and plural.
|
||||
To fix these parameters, see <A HREF="Phrase.html">Phrase</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
ImpVP : VP -> Imp ; -- go
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Embedded sentences</H2>
|
||||
<P>
|
||||
Sentences, questions, and infinitival phrases can be used as
|
||||
subjects and (adverbial) complements.
|
||||
</P>
|
||||
<PRE>
|
||||
EmbedS : S -> SC ; -- that you go
|
||||
EmbedQS : QS -> SC ; -- whether you go
|
||||
EmbedVP : VP -> SC ; -- to go
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Sentences</H2>
|
||||
<P>
|
||||
These are the 2 x 4 x 4 = 16 forms generated by different
|
||||
combinations of tense, polarity, and
|
||||
anteriority, which are defined in <A HREF="Common.html"><CODE>Common</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
UseCl : Tense -> Ant -> Pol -> Cl -> S ;
|
||||
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
|
||||
UseRCl : Tense -> Ant -> Pol -> RCl -> RS ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
An adverb can be added to the beginning of a sentence.
|
||||
</P>
|
||||
<PRE>
|
||||
AdvS : Adv -> S -> S ; -- today, I will go home
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Sentence.txt -->
|
||||
</BODY></HTML>
|
||||
82
lib/resource/doc/gfdoc/SeqConjunction.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Conjunctions of left-recursive lists</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Conjunctions of left-recursive lists</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: </I><BR>
|
||||
Last update: Fri Jan 20 18:01:39 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Conjunctions of left-recursive lists</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<A NAME="toc1"></A>
|
||||
<H1>Conjunctions of left-recursive lists</H1>
|
||||
<PRE>
|
||||
abstract SeqConjunction = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This module is for backward compatibility with API 0.9.
|
||||
To be used instead of <A HREF="Conjunction.html">Conjunction</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
|
||||
ConjS : Conj -> SeqS -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> SeqAP -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> SeqNP -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> SeqAdv -> Adv ; -- "quickly or slowly"
|
||||
|
||||
DConjS : DConj -> SeqS -> S ; -- "either John walks or Mary runs"
|
||||
DConjAP : DConj -> SeqAP -> AP ; -- "both even and prime"
|
||||
DConjNP : DConj -> SeqNP -> NP ; -- "either John or Mary"
|
||||
DConjAdv : DConj -> SeqAdv -> Adv ; -- "both badly and slowly"
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
these are rather uninteresting
|
||||
</P>
|
||||
<PRE>
|
||||
TwoS : S -> S -> SeqS ;
|
||||
AddS : SeqS -> S -> SeqS ;
|
||||
TwoAdv : Adv -> Adv -> SeqAdv ;
|
||||
AddAdv : SeqAdv -> Adv -> SeqAdv ;
|
||||
TwoNP : NP -> NP -> SeqNP ;
|
||||
AddNP : SeqNP -> NP -> SeqNP ;
|
||||
TwoAP : AP -> AP -> SeqAP ;
|
||||
AddAP : SeqAP -> AP -> SeqAP ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
we use right-associative lists instead of GF's built-in lists
|
||||
</P>
|
||||
<PRE>
|
||||
cat
|
||||
SeqS ;
|
||||
SeqAdv ;
|
||||
SeqNP ;
|
||||
SeqAP ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/SeqConjunction.txt -->
|
||||
</BODY></HTML>
|
||||
143
lib/resource/doc/gfdoc/Structural.html
Normal file
@@ -0,0 +1,143 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Structural: Structural Words</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Structural: Structural Words</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-11-27 16:41:30 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Here we have some words belonging to closed classes and appearing
|
||||
in all languages we have considered.
|
||||
Sometimes more distinctions are needed, e.g. <CODE>we_Pron</CODE> in Spanish
|
||||
should be replaced by masculine and feminine variants, found in
|
||||
<A HREF="../spanish/ExtraSpa.gf"><CODE>ExtraSpa</CODE></A>.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Structural = Cat ** {
|
||||
|
||||
fun
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
This is an alphabetical list of structural words
|
||||
</P>
|
||||
<PRE>
|
||||
above_Prep : Prep ;
|
||||
after_Prep : Prep ;
|
||||
all_Predet : Predet ;
|
||||
almost_AdA : AdA ;
|
||||
almost_AdN : AdN ;
|
||||
although_Subj : Subj ;
|
||||
always_AdV : AdV ;
|
||||
and_Conj : Conj ;
|
||||
because_Subj : Subj ;
|
||||
before_Prep : Prep ;
|
||||
behind_Prep : Prep ;
|
||||
between_Prep : Prep ;
|
||||
both7and_DConj : DConj ;
|
||||
but_PConj : PConj ;
|
||||
by8agent_Prep : Prep ;
|
||||
by8means_Prep : Prep ;
|
||||
can8know_VV : VV ;
|
||||
can_VV : VV ;
|
||||
during_Prep : Prep ;
|
||||
either7or_DConj : DConj ;
|
||||
every_Det : Det ;
|
||||
everybody_NP : NP ;
|
||||
everything_NP : NP ;
|
||||
everywhere_Adv : Adv ;
|
||||
first_Ord : Ord ;
|
||||
few_Det : Det ;
|
||||
for_Prep : Prep ;
|
||||
from_Prep : Prep ;
|
||||
he_Pron : Pron ;
|
||||
here_Adv : Adv ;
|
||||
here7to_Adv : Adv ;
|
||||
here7from_Adv : Adv ;
|
||||
how_IAdv : IAdv ;
|
||||
how8many_IDet : IDet ;
|
||||
i_Pron : Pron ;
|
||||
if_Subj : Subj ;
|
||||
in8front_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
it_Pron : Pron ;
|
||||
less_CAdv : CAdv ;
|
||||
many_Det : Det ;
|
||||
more_CAdv : CAdv ;
|
||||
most_Predet : Predet ;
|
||||
much_Det : Det ;
|
||||
must_VV : VV ;
|
||||
no_Phr : Phr ;
|
||||
on_Prep : Prep ;
|
||||
one_Quant : QuantSg ;
|
||||
only_Predet : Predet ;
|
||||
or_Conj : Conj ;
|
||||
otherwise_PConj : PConj ;
|
||||
part_Prep : Prep ;
|
||||
please_Voc : Voc ;
|
||||
possess_Prep : Prep ;
|
||||
quite_Adv : AdA ;
|
||||
she_Pron : Pron ;
|
||||
so_AdA : AdA ;
|
||||
someSg_Det : Det ;
|
||||
somePl_Det : Det ;
|
||||
somebody_NP : NP ;
|
||||
something_NP : NP ;
|
||||
somewhere_Adv : Adv ;
|
||||
that_Quant : Quant ;
|
||||
that_NP : NP ;
|
||||
there_Adv : Adv ;
|
||||
there7to_Adv : Adv ;
|
||||
there7from_Adv : Adv ;
|
||||
therefore_PConj : PConj ;
|
||||
these_NP : NP ;
|
||||
they_Pron : Pron ;
|
||||
this_Quant : Quant ;
|
||||
this_NP : NP ;
|
||||
those_NP : NP ;
|
||||
through_Prep : Prep ;
|
||||
to_Prep : Prep ;
|
||||
too_AdA : AdA ;
|
||||
under_Prep : Prep ;
|
||||
very_AdA : AdA ;
|
||||
want_VV : VV ;
|
||||
we_Pron : Pron ;
|
||||
whatPl_IP : IP ;
|
||||
whatSg_IP : IP ;
|
||||
when_IAdv : IAdv ;
|
||||
when_Subj : Subj ;
|
||||
where_IAdv : IAdv ;
|
||||
whichPl_IDet : IDet ;
|
||||
whichSg_IDet : IDet ;
|
||||
whoPl_IP : IP ;
|
||||
whoSg_IP : IP ;
|
||||
why_IAdv : IAdv ;
|
||||
with_Prep : Prep ;
|
||||
without_Prep : Prep ;
|
||||
yes_Phr : Phr ;
|
||||
youSg_Pron : Pron ;
|
||||
youPl_Pron : Pron ;
|
||||
youPol_Pron : Pron ;
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Structural.txt -->
|
||||
</BODY></HTML>
|
||||
91
lib/resource/doc/gfdoc/Symbol.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Symbolic expressions</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Symbolic expressions</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-11-23 12:18:08 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Noun phrases with symbols and numbers</A>
|
||||
<LI><A HREF="#toc2">Sentence consisting of a formula</A>
|
||||
<LI><A HREF="#toc3">Symbols as numerals</A>
|
||||
<LI><A HREF="#toc4">Symbol lists</A>
|
||||
<LI><A HREF="#toc5">Obsolescent</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
<B>Note</B>. This module is not automatically included in the main
|
||||
grammar <A HREF="Lang.html">Lang</A>.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Symbol = Cat, PredefAbs ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Noun phrases with symbols and numbers</H2>
|
||||
<PRE>
|
||||
fun
|
||||
|
||||
SymbPN : Symb -> PN ; -- x
|
||||
IntPN : Int -> PN ; -- 27
|
||||
FloatPN : Float -> PN ; -- 3.14159
|
||||
CNNumNP : CN -> Num -> NP ; -- level five ; level 5
|
||||
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Sentence consisting of a formula</H2>
|
||||
<PRE>
|
||||
SymbS : Symb -> S ; -- A
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Symbols as numerals</H2>
|
||||
<PRE>
|
||||
SymbNum : Symb -> Num ; -- n
|
||||
SymbOrd : Symb -> Ord ; -- n'th
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Symbol lists</H2>
|
||||
<P>
|
||||
A symbol list has at least two elements. The last two are separated
|
||||
by a conjunction (<I>and</I> in English), the others by commas.
|
||||
This produces <I>x, y and z</I>, in English.
|
||||
</P>
|
||||
<PRE>
|
||||
cat
|
||||
Symb ;
|
||||
[Symb]{2} ;
|
||||
|
||||
fun
|
||||
MkSymb : String -> Symb ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc5"></A>
|
||||
<H2>Obsolescent</H2>
|
||||
<PRE>
|
||||
CNIntNP : CN -> Int -> NP ; -- level 53 (covered by CNNumNP)
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc mathematical/Symbol.txt -->
|
||||
</BODY></HTML>
|
||||
43
lib/resource/doc/gfdoc/Symbolic.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Symbolic: Noun Phrases with mathematical symbols</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Symbolic: Noun Phrases with mathematical symbols</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-12-22 14:08:31 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
incomplete resource Symbolic = open Symbol, Grammar in {
|
||||
|
||||
oper
|
||||
symb : overload {
|
||||
symb : Str -> NP ; -- x
|
||||
symb : Int -> NP ; -- 23
|
||||
symb : Float -> NP ; -- 0.99
|
||||
symb : N -> Int -> NP ; -- level 4
|
||||
symb : CN -> Num -> NP ; -- level four
|
||||
symb : Det -> N -> Str -> Str -> NP ; -- the levels i and j
|
||||
symb : Det -> CN -> [Symb] -> NP -- the basic levels i, j, and k
|
||||
} ;
|
||||
|
||||
mkSymb : Str -> Symb ;
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc api/Symbolic.txt -->
|
||||
</BODY></HTML>
|
||||
50
lib/resource/doc/gfdoc/Tense.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Tense, Polarity, and Anteriority</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Tense, Polarity, and Anteriority</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-02-27 09:41:31 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
This module defines the abstract parameters of tense, polarity, and
|
||||
anteriority, which are used in <A HREF="Tensed.html">Tensed</A> to generate different
|
||||
forms of sentences. Together they give 2 x 4 x 4 = 16 sentence forms.
|
||||
These tenses are defined for all languages in the library. More tenses
|
||||
can be defined in the language extensions, e.g. the <I>passé simple</I> of
|
||||
Romance languages.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Tense = {
|
||||
|
||||
cat
|
||||
Pol ;
|
||||
Tense ;
|
||||
Ant ;
|
||||
|
||||
fun
|
||||
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||
TPres, TPast, TFut, TCond : Tense ; -- I sleep/slept/will sleep/would sleep
|
||||
ASimul, AAnter : Ant ; -- I sleep/have slept
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Tense.txt -->
|
||||
</BODY></HTML>
|
||||
43
lib/resource/doc/gfdoc/Text.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> Text: Texts</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> Text: Texts</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-06-15 09:19:39 CEST</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<P>
|
||||
Texts are built from an empty text by adding <CODE>Phr</CODE>ases,
|
||||
using as constructors the punctuation marks <I>.</I>, <I>?</I>, and <I>!</I>.
|
||||
Any punctuation mark can be attached to any kind of phrase.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Text = Common ** {
|
||||
|
||||
fun
|
||||
TEmpty : Text ; --
|
||||
TFullStop : Phr -> Text -> Text ; -- John walks. ...
|
||||
TQuestMark : Phr -> Text -> Text ; -- Are you OK? ...
|
||||
TExclMark : Phr -> Text -> Text ; -- John walks! ...
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Text.txt -->
|
||||
</BODY></HTML>
|
||||
123
lib/resource/doc/gfdoc/Verb.html
Normal file
@@ -0,0 +1,123 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE> The construction of verb phrases</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1> The construction of verb phrases</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Last update: 2006-02-27 09:41:31 CET</I><BR>
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Complementization rules</A>
|
||||
<LI><A HREF="#toc2">Other ways of forming verb phrases</A>
|
||||
<LI><A HREF="#toc3">Complements to copula</A>
|
||||
<LI><A HREF="#toc4">Coercions</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<P>
|
||||
Produced by
|
||||
gfdoc - a rudimentary GF document generator.
|
||||
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
|
||||
</P>
|
||||
<PRE>
|
||||
abstract Verb = Cat ** {
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Complementization rules</H2>
|
||||
<P>
|
||||
Verb phrases are constructed from verbs by providing their
|
||||
complements. There is one rule for each verb category.
|
||||
</P>
|
||||
<PRE>
|
||||
fun
|
||||
UseV : V -> VP ; -- sleep
|
||||
ComplV2 : V2 -> NP -> VP ; -- use it
|
||||
ComplV3 : V3 -> NP -> NP -> VP ; -- send a message to her
|
||||
|
||||
ComplVV : VV -> VP -> VP ; -- want to run
|
||||
ComplVS : VS -> S -> VP ; -- know that she runs
|
||||
ComplVQ : VQ -> QS -> VP ; -- ask if she runs
|
||||
|
||||
ComplVA : VA -> AP -> VP ; -- look red
|
||||
ComplV2A : V2A -> NP -> AP -> VP ; -- paint the house red
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc2"></A>
|
||||
<H2>Other ways of forming verb phrases</H2>
|
||||
<P>
|
||||
Verb phrases can also be constructed reflexively and from
|
||||
copula-preceded complements.
|
||||
</P>
|
||||
<PRE>
|
||||
ReflV2 : V2 -> VP ; -- use itself
|
||||
UseComp : Comp -> VP ; -- be warm
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Passivization of two-place verbs is another way to use
|
||||
them. In many languages, the result is a participle that
|
||||
is used as complement to a copula (<I>is used</I>), but other
|
||||
auxiliary verbs are possible (Ger. <I>wird angewendet</I>, It.
|
||||
<I>viene usato</I>), as well as special verb forms (Fin. <I>käytetään</I>,
|
||||
Swe. <I>används</I>).
|
||||
</P>
|
||||
<P>
|
||||
<B>Note</B>. the rule can be overgenerating, since the <CODE>V2</CODE> need not
|
||||
take a direct object.
|
||||
</P>
|
||||
<PRE>
|
||||
PassV2 : V2 -> VP ; -- be used
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
Adverbs can be added to verb phrases. Many languages make
|
||||
a distinction between adverbs that are attached in the end
|
||||
vs. next to (or before) the verb.
|
||||
</P>
|
||||
<PRE>
|
||||
AdvVP : VP -> Adv -> VP ; -- sleep here
|
||||
AdVVP : AdV -> VP -> VP ; -- always sleep
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<B>Agents of passives</B> are constructed as adverbs with the
|
||||
preposition <A HREF="Structural.html">Structural</A><CODE>.8agent_Prep</CODE>.
|
||||
</P>
|
||||
<A NAME="toc3"></A>
|
||||
<H2>Complements to copula</H2>
|
||||
<P>
|
||||
Adjectival phrases, noun phrases, and adverbs can be used.
|
||||
</P>
|
||||
<PRE>
|
||||
CompAP : AP -> Comp ; -- (be) small
|
||||
CompNP : NP -> Comp ; -- (be) a soldier
|
||||
CompAdv : Adv -> Comp ; -- (be) here
|
||||
</PRE>
|
||||
<P></P>
|
||||
<A NAME="toc4"></A>
|
||||
<H2>Coercions</H2>
|
||||
<P>
|
||||
Verbs can change subcategorization patterns in systematic ways,
|
||||
but this is very much language-dependent. The following two
|
||||
work in all the languages we cover.
|
||||
</P>
|
||||
<PRE>
|
||||
UseVQ : VQ -> V2 ; -- ask (a question)
|
||||
UseVS : VS -> V2 ; -- know (a secret)
|
||||
|
||||
}
|
||||
</PRE>
|
||||
<P></P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml -\-toc abstract/Verb.txt -->
|
||||
</BODY></HTML>
|
||||
1173
lib/resource/doc/gslt-sem-2006.html
Normal file
933
lib/resource/doc/gslt-sem-2006.txt
Normal file
@@ -0,0 +1,933 @@
|
||||
Grammars as Software Libraries
|
||||
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
|
||||
Last update: %%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags --toc gslt-sem-2006.txt
|
||||
|
||||
%!target:html
|
||||
|
||||
%!postproc(html): #NEW <!-- NEW -->
|
||||
|
||||
#NEW
|
||||
|
||||
==Setting==
|
||||
|
||||
Current funding
|
||||
- VR: Library-Based Grammar Engineering (2006-2008)
|
||||
- Lars Borin (Swedish)
|
||||
- Robin Cooper (Computational Linguistics)
|
||||
- Sibylle Schupp and Aarne Ranta (Computer Science)
|
||||
|
||||
|
||||
Previous funding
|
||||
- VR: Record Types and Dialogue Semantics (2003-2005)
|
||||
- VINNOVA: Interactive Language Technology (2001-2004)
|
||||
|
||||
|
||||
Main applications
|
||||
- TALK: multilingual and multimodal dialogue systems
|
||||
- WebALT: multilingual generation of mathematical teaching material
|
||||
- KeY: multilingual authoring of software specifications
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==People==
|
||||
|
||||
Staff contributions to grammar libraries:
|
||||
- Björn Bringert
|
||||
- Markus Forsberg
|
||||
- Harald Hammarström
|
||||
- Janna Khegai
|
||||
- Aarne Ranta
|
||||
|
||||
|
||||
Student projects on grammar libraries:
|
||||
- Inger Andersson & Therese Söderberg: Spanish morphology
|
||||
- Ludmilla Bogavac: Russian morphology
|
||||
- Karin Cavallin: comparison with Svenska Akademins Grammatik
|
||||
- Ali El Dada: Arabic morphology and syntax
|
||||
- Muhammad Humayoun: Urdu morphology
|
||||
- Michael Pellauer: Estonian morphology
|
||||
|
||||
|
||||
Technology, also:
|
||||
- Håkan Burden
|
||||
- Hans-Joachim Daniels
|
||||
- Kristofer Johannisson
|
||||
- Peter Ljunglöf
|
||||
|
||||
|
||||
Various grammar library contributions from the multilingual Chalmers community:
|
||||
- Ana Bove, Koen Claessen, Carlos Gonzalía, Patrik Jansson,
|
||||
Wojciech Mostowski, Karol Ostrovský, David Wahlstedt
|
||||
|
||||
|
||||
Resource library patches and suggestions from the WebALT staff:
|
||||
- Lauri Carlson, Glòria Casanellas, Anni Laine, Wanjiku Ng'ang'a, Jordi Saludes
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Software Libraries==
|
||||
|
||||
The main device of **division of labour** in programming.
|
||||
|
||||
Instead of writing a sorting algorithm over and over again,
|
||||
the programmers take it from a library. You write (in Haskell),
|
||||
```
|
||||
Data.List.sort xs
|
||||
```
|
||||
instead of a lot of code actually implementing sorting.
|
||||
|
||||
Practical advantages:
|
||||
- faster development of new software
|
||||
- quality guarantee and automatic improvements
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Abstraction==
|
||||
|
||||
Libraries promote **abstraction**: you abstract away from details.
|
||||
|
||||
The use of libraries is therefore a good programming style.
|
||||
|
||||
It is also **scientifically interesting** to create libraries:
|
||||
you have to think about abstractions on your domain of expertise.
|
||||
|
||||
Notice: libraries can bring abstraction to almost any language,
|
||||
if it just has a support for functions or macros.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Grammars as libraries?==
|
||||
|
||||
Example: we want to create a GUI (Graphical User Interface) button
|
||||
that says //yes//, and **localize** it to different languages:
|
||||
```
|
||||
Yes Ja Kyllä Oui Ja Sì
|
||||
```
|
||||
Possible ways to do this:
|
||||
+ Go around dictionaries to find the word in different languages
|
||||
```
|
||||
yesButton english = button "Yes"
|
||||
yesButton swedish = button "Ja"
|
||||
yesButton finnish = button "Kyllä"
|
||||
```
|
||||
|
||||
+ Hire more programmers to perform localization in different languages
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
3. Use a library ``Text`` such that you can write
|
||||
```
|
||||
yesButton lang = button (Text.render lang Text.Yes)
|
||||
```
|
||||
The library has an API (Application Programmer's Interface) with:
|
||||
+ A repository of text elements such as
|
||||
```
|
||||
Yes : Text
|
||||
No : Text
|
||||
```
|
||||
+ A function rendering text elements in different languages:
|
||||
```
|
||||
render : Language -> Text -> String
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==A slightly more advanced example==
|
||||
|
||||
This is what you often see as a feedback from a program:
|
||||
```
|
||||
You have 1 messages.
|
||||
```
|
||||
Or perhaps with a little more thought:
|
||||
```
|
||||
You have 1 message(s).
|
||||
```
|
||||
The code that should be written is of course
|
||||
```
|
||||
mess n = "You have" +++ show n +++ messages ++ "."
|
||||
where
|
||||
messages = if n==1 then "message" else "messages"
|
||||
```
|
||||
(E.g. VoiceXML supports this.)
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Problems with the more advanced example==
|
||||
|
||||
The same as with "Yes": you have to know the words "you",
|
||||
"have", "message".
|
||||
|
||||
//Moreover//, you have to know the inflection of the equivalent
|
||||
of "message":
|
||||
```
|
||||
if n == 1 then "meddelande" else "meddelanden"
|
||||
```
|
||||
//Moreover//, you have to know the congruence with different numbers
|
||||
(e.g. Arabic):
|
||||
```
|
||||
if n == 1 then "risAlaö" else
|
||||
if n == 2 then "risAlatAn" else
|
||||
if n < 11 then "rasA'il" else
|
||||
"risAlaö"
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
==More problems with the advanced example==
|
||||
|
||||
You also have to know the case required by the verb "have"
|
||||
e.g. Finnish:
|
||||
```
|
||||
1 viesti -- nominative
|
||||
4 viestiä -- partitive
|
||||
```
|
||||
//Moreover//, you have to know what is the proper way to politely
|
||||
address the user:
|
||||
```
|
||||
Du har 3 meddelanden / Ni har 3 meddelanden
|
||||
Vous avez 3 messages / Tu as 3 messages
|
||||
```
|
||||
(This can also depend on country and the kind of program.)
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==A library-based solution==
|
||||
|
||||
In analogy with the "Yes" case, you write
|
||||
```
|
||||
mess lang n = render lang (Text.YouHaveMessages n)
|
||||
```
|
||||
Hmm, is this so smart? What about if you want to say
|
||||
```
|
||||
You have 4 documents.
|
||||
You have 5 jewels.
|
||||
I have 7 surprises.
|
||||
```
|
||||
It is time to move from **canned text** to a **grammar**.
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==An improved library-based solution==
|
||||
|
||||
You may want to write
|
||||
```
|
||||
mess lang n = render lang (Have PolYou (Num n Message))
|
||||
sword lang n = render lang (Have FamYou (Num n Jewel))
|
||||
surpr lang n = render lang (Have I (Num n Surprise))
|
||||
```
|
||||
For this purpose, you need a library with the API
|
||||
```
|
||||
Have : NounPhrase -> NounPhrase -> Sentence
|
||||
|
||||
PolYou : NounPhrase
|
||||
FamYou : NounPhrase
|
||||
|
||||
Num : Int -> Noun -> NounPhrase
|
||||
|
||||
Message : Noun
|
||||
Jewel : Noun
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==The ultimate solution?==
|
||||
|
||||
The library API for language will certainly grow big and become
|
||||
difficult to use. Why couldn't I just write
|
||||
```
|
||||
mess lang n = render lang (parse english "you have n messages")
|
||||
```
|
||||
To this end, the API should provide the top-level function
|
||||
```
|
||||
parse : Language -> String -> Sentence
|
||||
```
|
||||
The library that we will present actually has this as well!
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
The only complication is that ``parse`` does not always return
|
||||
just one sentence. Those may be zero:
|
||||
```
|
||||
"you have n mesaggse"
|
||||
|
||||
```
|
||||
or many:
|
||||
```
|
||||
"you have n messages"
|
||||
|
||||
Have PolYou (Num n Message)
|
||||
Have FamYou (Num n Message)
|
||||
Have PlurYou (Num n Message)
|
||||
```
|
||||
Thus some amount of interaction is needed.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==The components of a grammar library==
|
||||
|
||||
The library has **construction functions** like
|
||||
```
|
||||
Have : NounPhrase -> NounPhrase -> Sentence
|
||||
PolYou : NounPhrase
|
||||
```
|
||||
These functions build **grammatical structures**, which
|
||||
can have different realizations in different languages.
|
||||
|
||||
Therefore we also need **realization functions**,
|
||||
```
|
||||
render : Language -> Sentence -> String
|
||||
parse : Language -> String -> [Sentence]
|
||||
```
|
||||
Both of them require linguistic expertise to write - but,
|
||||
one this is done, they can be used with very little linguistic
|
||||
knowledge by application programmers!
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Implementing a grammar library in GF==
|
||||
|
||||
GF = Grammatical Framework
|
||||
|
||||
Those who know GF have already seen the introduction as a
|
||||
seduction argument leading to GF.
|
||||
|
||||
In GF,
|
||||
- construction functions = **abstract syntax**
|
||||
- realization functions = **concrete syntax**
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
Simplest possible example:
|
||||
```
|
||||
abstract Text = {
|
||||
cat Text ;
|
||||
fun Yes : Text ;
|
||||
fun No : Text ;
|
||||
}
|
||||
|
||||
concrete TextEng of Text = {
|
||||
lin Yes = ss "yes" ;
|
||||
lin No = ss "no" ;
|
||||
}
|
||||
|
||||
concrete TextFin of Text = {
|
||||
lin Yes = ss "kyllä" ;
|
||||
lin No = ss "ei" ;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Linearization and parsing==
|
||||
|
||||
The realizatin function is, for each language, implemented by
|
||||
**linearization rules** (``lin``).
|
||||
|
||||
The linearization rules directly give the ``render`` method:
|
||||
```
|
||||
render english x = TextEng.lin x
|
||||
```
|
||||
The GF formalism moreover has the property of **reversibility**:
|
||||
- a set of linearization rules automatically generates a parser.
|
||||
|
||||
|
||||
%While reversibility has a minor importance for the applications
|
||||
%shown above, it is crucial for other applications of GF grammars.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Applying GF==
|
||||
|
||||
**multilingual grammar** = abstract syntax + concrete syntaxes
|
||||
|
||||
Examples of the idea:
|
||||
- domain-specific translation
|
||||
- multilingual authoring
|
||||
- dialogue systems
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Domain, ontology, idiom==
|
||||
|
||||
An abstract syntax has other names:
|
||||
- a **semantic model**
|
||||
- an **ontology**
|
||||
|
||||
|
||||
The concrete syntax defines how the ontology
|
||||
is represented in a language.
|
||||
|
||||
The following requirements are made:
|
||||
- linguistic correctness (inflection, agreement, word order,...)
|
||||
- semantic correctness (express the concepts properly)
|
||||
- conformance to the domain idiom (use proper terms and phrasing)
|
||||
|
||||
|
||||
Benefit: translation via semantic model of domain can reach high quality.
|
||||
|
||||
Problem: the expertise of both a linguist and a domain expert are required.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Example domain==
|
||||
|
||||
Arithmetic of natural numbers: abstract syntax
|
||||
```
|
||||
cat Prop ; Nat ;
|
||||
fun Even : Nat -> Prop ;
|
||||
```
|
||||
**Concrete syntax**: mapping from abstract syntax trees to strings in a language
|
||||
(English, French, German, Swedish,...)
|
||||
```
|
||||
lin Even x = {s = x.s ++ "is" ++ "even"} ;
|
||||
lin Even x = {s = x.s ++ "est" ++ "pair"} ;
|
||||
lin Even x = {s = x.s ++ "ist" ++ "gerade"} ;
|
||||
lin Even x = {s = x.s ++ "är" ++ "jämnt"} ;
|
||||
```
|
||||
|
||||
#NEW
|
||||
|
||||
==Translation system==
|
||||
|
||||
We can translate using the abstract syntax as interlingua:
|
||||
```
|
||||
4 is even 4 ist gerade
|
||||
\ /
|
||||
Even (NInt 4)
|
||||
/ \
|
||||
4 est pair 4 är jämnt
|
||||
```
|
||||
This idea is used e.g. in the WebALT project to generate mathematical
|
||||
teaching material in 7 languages.
|
||||
|
||||
But is it really so simple?
|
||||
|
||||
|
||||
#NEW
|
||||
==Difficulties with concrete syntax==
|
||||
|
||||
The previous multilingual grammar breaks these rules in many situations:
|
||||
```
|
||||
2 and 3 is even
|
||||
la somme de 3 et de 5 est pair
|
||||
wenn 2 ist gerade, dann 2+2 ist gerade
|
||||
om x är jämnt, summan av x och 2 är jämnt
|
||||
```
|
||||
All these sentences are grammatically incorrect.
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Solving the difficulties==
|
||||
|
||||
GF //can// express the linguistic rules that are needed to
|
||||
produce correct translations:
|
||||
|
||||
In addition to strings, we use **parameters**, **tables**,
|
||||
and **record types**. For instance, French:
|
||||
```
|
||||
param Mod = Ind | Subj ;
|
||||
param Gen = Masc | Fem ;
|
||||
|
||||
lincat Nat = {s : Str ; g : Gen} ;
|
||||
lincat Prop = {s : Mod => Str} ;
|
||||
|
||||
lin Even x = {s =
|
||||
table {
|
||||
m => x.s ++
|
||||
case m of {Ind => "est" ; Subj => "soit"} ++
|
||||
case x.g of {Masc => "pair" ; Fem => "paire"}
|
||||
}
|
||||
} ;
|
||||
```
|
||||
Linguistic knowledge dominates in the size of this grammar.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Application grammars vs. resource grammars==
|
||||
|
||||
Application grammar ("semantic grammar")
|
||||
- abstract syntax: domain semantics
|
||||
- concrete syntax: "controlled language"
|
||||
- author: domain expert
|
||||
|
||||
|
||||
Resource grammar ("syntactic grammar")
|
||||
- abstract syntax: linguistic structures
|
||||
- concrete syntax: (approximation of) entire language
|
||||
- author: linguist
|
||||
|
||||
|
||||
#NEW
|
||||
==GF as programming language==
|
||||
|
||||
The expressive power is between TAG and HPSG.
|
||||
|
||||
The language is more high-level: a modern, **typed functional programming language**.
|
||||
|
||||
It enables linguistic generalizations and abstractions.
|
||||
|
||||
But we don't want to bother application grammarians with these details.
|
||||
|
||||
We have built a **module system** that can hide details.
|
||||
|
||||
|
||||
#NEW
|
||||
|
||||
==Concrete syntax using library==
|
||||
|
||||
Assume the following API
|
||||
```
|
||||
cat S ; NP ; A ;
|
||||
|
||||
fun predA : A -> NP -> S ;
|
||||
|
||||
oper regA : Str -> A ;
|
||||
```
|
||||
Now implement ``Even`` for four languages
|
||||
```
|
||||
lincat
|
||||
Prop = S ;
|
||||
Nat = NP ;
|
||||
lin
|
||||
Even = predA (regA "even") ; -- English
|
||||
Even = predA (regA "jämn") ; -- Swedish
|
||||
Even = predA (regA "pair") ; -- French
|
||||
Even = predA (regA "gerade") ; -- German
|
||||
```
|
||||
Notice: the choice of adjective is domain expert knowledge.
|
||||
|
||||
|
||||
#NEW
|
||||
==Design questions for the grammar library==
|
||||
|
||||
What should there be in the library?
|
||||
- morphology, lexicon, syntax, semantics,...
|
||||
|
||||
|
||||
How do we organize and present the library?
|
||||
- division into modules, level of granularity
|
||||
- "school grammar" vs. sophisticated linguistic concepts
|
||||
|
||||
|
||||
Where to get the data from?
|
||||
- automatic extraction or hand-writing?
|
||||
- reuse of existing resources?
|
||||
|
||||
|
||||
Extra constraint: we want open-source free software and
|
||||
hence cannot use existing proprietary resources.
|
||||
|
||||
|
||||
#NEW
|
||||
==Design decisions==
|
||||
|
||||
Coverage, for each language:
|
||||
- complete morphology
|
||||
- lexicon of the most important structural words
|
||||
- test lexicon of ca. 300 content words
|
||||
- representative fragment of syntax (cf. CLE (Core Language Engine))
|
||||
- rather flat semantics (cf. Quasi-Logical Form of CLE)
|
||||
|
||||
|
||||
Organization:
|
||||
- top-level (API) modules
|
||||
- Ground API + special-purpose APIs ("macro packages")
|
||||
- "school grammar" concepts rather than advanced linguistic theory
|
||||
|
||||
|
||||
Presentation:
|
||||
- tool ``gfdoc`` for generating HTML from grammars
|
||||
- example collections
|
||||
|
||||
|
||||
#NEW
|
||||
==Design decisions, cont'd==
|
||||
|
||||
Where do we get the data from?
|
||||
- morphology and syntax are hand-written
|
||||
- the test lexicon is hand-written
|
||||
- APIs for manual lexicon extension
|
||||
- tool for automatic lexicon extraction
|
||||
- we have not reused existing resources
|
||||
|
||||
|
||||
The resource grammar library is entirely open-source free software
|
||||
(under GNU GPL license).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Success criteria and evaluation==
|
||||
|
||||
Grammatical correctness of everything generated.
|
||||
|
||||
Semantic coverage: you can express whatever you want.
|
||||
|
||||
Usability as library for non-linguists.
|
||||
|
||||
Evaluation: tested in third-party projects.
|
||||
|
||||
Tools for regression testing (treebank generation and comparison)
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==These are not our success criteria==
|
||||
|
||||
Language coverage:
|
||||
- to be able to parse all expressions.
|
||||
- Example: French //passé simple//, although covered by the
|
||||
morphology, is not available through the language-independent API.
|
||||
- But: reconsidered to improve example-based grammar writing
|
||||
|
||||
|
||||
Semantic correctness:
|
||||
- only to produce meaningful expressions.
|
||||
- Example: the following sentences can be generated
|
||||
```
|
||||
colourless green ideas sleep furiously
|
||||
the time is seventy past forty-two
|
||||
```
|
||||
|
||||
|
||||
Linguistic innovation in syntax:
|
||||
- rather a presentation of "known facts"
|
||||
- innovation would be hidden from users anyway...
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Where is semantics?==
|
||||
|
||||
Application grammars use domain-specific
|
||||
semantics to guarantee semantic well-formedness.
|
||||
|
||||
GF incorporates a **Logical Framework** and can express
|
||||
- logical semantics //à la// Montague
|
||||
- anaphora and discourse using dependent types
|
||||
|
||||
|
||||
Language-independent API is a rough semantic model.
|
||||
|
||||
But we do //not// try to give semantics once and
|
||||
for all for the whole language.
|
||||
|
||||
|
||||
#NEW
|
||||
==Representations in different APIs==
|
||||
|
||||
**Grammar composition**: any grammar can serve as resource to another one.
|
||||
|
||||
No fixed set of representation levels; here some examples for
|
||||
```
|
||||
2 is even
|
||||
2 är jämnt
|
||||
```
|
||||
In ``Arithm``
|
||||
```
|
||||
Even 2
|
||||
```
|
||||
In ``Predication`` (high level resource API)
|
||||
```
|
||||
predA (IntNP 2) (regA "even")
|
||||
predA (IntNP 2) (regA "jämn")
|
||||
```
|
||||
In ``Lang`` (ground level resource API)
|
||||
```
|
||||
UseCl TPres ASimul PPos (PredVP (UsePN (IntPN 2))
|
||||
(UseComp (CompAP (PositA (regA "even")))))
|
||||
UseCl TPres ASimul PPos (PredVP (UsePN (IntPN 2))
|
||||
(UseComp (CompAP (PositA (regA "jämn")))))
|
||||
```
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Languages==
|
||||
|
||||
The current GF Resource Project covers ten languages:
|
||||
- ``Dan``ish
|
||||
- ``Eng``lish
|
||||
- ``Fin``nish
|
||||
- ``Fre``nch
|
||||
- ``Ger``man
|
||||
- ``Ita``lian
|
||||
- ``Nor``wegian (bokmål)
|
||||
- ``Rus``sian
|
||||
- ``Spa``nish
|
||||
- ``Swe``dish
|
||||
|
||||
|
||||
Implementation of API v 1.0 projected for the end of February.
|
||||
|
||||
In addition, we have parts (morphology) of Arabic, Estonian, Latin, and Urdu
|
||||
|
||||
|
||||
#NEW
|
||||
==Library structure 1: language-independent API==
|
||||
|
||||
[Lang.png]
|
||||
|
||||
[Resource index page index.html]
|
||||
|
||||
[Examples of each category gfdoc/Cat.html]
|
||||
|
||||
Cf. "matrix" in BLARK, LinGo
|
||||
|
||||
|
||||
#NEW
|
||||
==Library structure 2: language-dependent APIs==
|
||||
|
||||
- morphological paradigms, e.g. ``ParadigmsSwe``
|
||||
```
|
||||
mkN : (man,mannen,män,männen : Str) -> N ; -- worst-case nouns
|
||||
regV : (leker : Str) -> V ; -- regular verbs
|
||||
```
|
||||
- irregular words esp. verbs, e.g. ``IrregSwe``
|
||||
```
|
||||
angripa_V = irregV "angripa" "angrep" "angripit" ;
|
||||
```
|
||||
- exended syntax with language-specific rules, e.g. ``ExtNor``
|
||||
```
|
||||
PostPoss : CN -> Pron -> NP ; -- bilen min
|
||||
```
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Difficulties encountered==
|
||||
|
||||
English: negation and auxiliary vs. non-auxiliary verbs
|
||||
|
||||
Finnish: object case
|
||||
|
||||
German: double infinitives
|
||||
|
||||
Romance: clitic pronouns
|
||||
|
||||
Scandinavian: determiners
|
||||
|
||||
//In particular//: how to make the grammars efficient
|
||||
|
||||
|
||||
#NEW
|
||||
==How much can be language-independent?==
|
||||
|
||||
For the ten languages we have considered, it //is// possible
|
||||
to implement the current API.
|
||||
|
||||
Reservations:
|
||||
|
||||
- does not necessarily extend to all other languages
|
||||
- does not necessarily cover the most idiomatic expressions of each language
|
||||
- may not be the easiest API to implement
|
||||
- e.g. negation and inversion with //do// in English suggest that some other
|
||||
structure would be more natural
|
||||
|
||||
|
||||
- the structures may not have the same semantics in all different languages
|
||||
|
||||
|
||||
#NEW
|
||||
==Using the library==
|
||||
|
||||
Simplest case: use the API in the same way for all languages.
|
||||
- **+** grammar localization for free
|
||||
- **-** not the best idioms for each language
|
||||
|
||||
|
||||
In practice: use the API in different ways for different languages
|
||||
```
|
||||
-- Eng: x's name is y
|
||||
Name x y = predNP (GenCN x (regN "name")) (StringNP y)
|
||||
-- Swe: x heter y
|
||||
Name x y = predV2 x heta_V2 (StringNP y)
|
||||
```
|
||||
This amounts to **compile-time transfer**.
|
||||
|
||||
Surprisingly, writing an application grammar requires more native-speaker knowledge
|
||||
than writing a resource grammar!
|
||||
|
||||
|
||||
#NEW
|
||||
==Parametrized modules==
|
||||
|
||||
We can go even farther than share an abstract API: we can share implementations
|
||||
among related languages.
|
||||
|
||||
Exploited in two families:
|
||||
- Romance: French, Italian, Spanish
|
||||
- Scanndinavian: Danish, Norwegian, Swedish
|
||||
|
||||
|
||||
[The declarations of Scandinavian syntax differences ../scandinavian/DiffScand.gf]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Lexicon extension==
|
||||
|
||||
We cannot anticipate all vocabulary needed in application grammars.
|
||||
|
||||
Therefore we provide high-level paradigms to add new words.
|
||||
|
||||
Example heuristic, from [ParadigsSwe gfdoc/ParadigmsSwe.html]:
|
||||
```
|
||||
regV : (leker : Str) -> V ;
|
||||
|
||||
regV leker = case leker of {
|
||||
lek + ("a" | "ar") => conj1 (lek + "a") ;
|
||||
lek + "er" => conj2 (lek + "a") ;
|
||||
bo + "r" => conj3 bo
|
||||
}
|
||||
```
|
||||
|
||||
#NEW
|
||||
==Example low-level morphological definition==
|
||||
|
||||
```
|
||||
decl2Noun : Str -> N = \bil ->
|
||||
let
|
||||
bb : Str * Str = case bil of {
|
||||
pojk + "e" => <pojk + "ar", bil + "n"> ;
|
||||
nyck + "e" + l@("l" | "r") => <nyck + l + "ar",bil + "n"> ;
|
||||
sock + "e" + "n" => <sock + "nar", sock + "nen"> ;
|
||||
_ => <bil + "ar", bil + "en">
|
||||
} ;
|
||||
in mkN bil bb.p2 bb.p1 (bb.p1 + "na") ;
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
==Some formats that can be generated from GF grammars==
|
||||
|
||||
```
|
||||
-printer=lbnf BNF Converter, thereby C/Bison, Java/JavaCup
|
||||
-printer=fullform full-form lexicon, short format
|
||||
-printer=xml XML: DTD for the pg command, object for st
|
||||
-printer=gsl Nuance GSL speech recognition grammar
|
||||
-printer=jsgf Java Speech Grammar Format
|
||||
-printer=srgs_xml SRGS XML format
|
||||
-printer=srgs_xml_prob SRGS XML format, with weights
|
||||
-printer=slf a finite automaton in the HTK SLF format
|
||||
-printer=regular a regular grammar in a simple BNF
|
||||
-printer=gfc-prolog gfc in prolog format (also pg)
|
||||
```
|
||||
|
||||
|
||||
#NEW
|
||||
==Use as program components==
|
||||
|
||||
Haskell, Java, Prolog
|
||||
|
||||
Parsing, generation, translation
|
||||
|
||||
Push-button creation of spoken language translators (using Nuance)
|
||||
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Grammar library as linguistic resource==
|
||||
|
||||
Can we use the libraries outside domain-specific fragments?
|
||||
|
||||
We seem to be approaching full coverage from below.
|
||||
|
||||
The resource API is not good for heavy-duty parsing (too abstract and
|
||||
therefore too inefficient).
|
||||
|
||||
Two ideas:
|
||||
- write shallow parsers as application grammars
|
||||
- generate corpora and use statistic parsing methods
|
||||
|
||||
|
||||
|
||||
#NEW
|
||||
==Corpus generation==
|
||||
|
||||
The most general format is **multilingual treebank** generation:
|
||||
```
|
||||
> gr -tr | l -multi
|
||||
UseCl TCond AAnter PNeg (PredVP (DetCN (DetSg DefSg NoOrd)
|
||||
(AdjCN (PositA young_A) (UseN woman_N))) (ComplV2 love_V2 (UsePron he_Pron)))
|
||||
|
||||
The young woman wouldn't have loved him
|
||||
Den unga kvinnan skulle inte ha älskat honom
|
||||
Den unge kvinna ville ikke ha elska ham
|
||||
La joven mujer no lo habría amado
|
||||
La giovane donna non lo avrebbe amato
|
||||
La jeune femme ne l' aurait pas aimé
|
||||
Nuori nainen ei olisi rakastanut häntä
|
||||
```
|
||||
This is either exhaustive or random, possibly
|
||||
with probability weights attached to constructors.
|
||||
|
||||
A special case is **corpus generation**: just leave one language.
|
||||
|
||||
Can this be useful? Cf. Rebecca Jonson this afternoon.
|
||||
|
||||
|
||||
#NEW
|
||||
==Related work==
|
||||
|
||||
CLE = Core Language Engine
|
||||
- the closest point of comparison as for coverage and purpose
|
||||
- resource API similar to "Quasi-Logical Form"
|
||||
- parametrized modules instead of grammar porting via macro packages
|
||||
- grammar specialization via partial evaluation instead of explanation-based learning
|
||||
- therefore, transfer at compile time as often as possible
|
||||
|
||||
|
||||
LinGo Matrix project (HPSG)
|
||||
- methodology rather than formal discipline for multilingual grammars
|
||||
- not aimed as library, no grammar specialization?
|
||||
- wider coverage - parsing real texts
|
||||
|
||||
|
||||
Parsing detached from grammar (Nivre) - grammar detached from parsing
|
||||
|
||||
#NEW
|
||||
==Demo==
|
||||
|
||||
Stoneage grammar, based on the Swadesh word list.
|
||||
|
||||
Implemented as application on top of the resource grammar.
|
||||
|
||||
Illustrate generation and spoken-language parsing.
|
||||
|
||||
|
||||
|
||||
%http://www.boost.org/
|
||||
499
lib/resource/doc/index-1.1.html
Normal file
@@ -0,0 +1,499 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE>GF Resource Grammar Library v. 1.1</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1>GF Resource Grammar Library v. 1.1</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Thu Apr 19 23:35:29 2007
|
||||
</FONT></CENTER>
|
||||
|
||||
<P>
|
||||
The GF Resource Grammar Library defines the basic grammar of
|
||||
ten languages:
|
||||
Danish, English, Finnish, French, German,
|
||||
Italian, Norwegian, Russian, Spanish, Swedish.
|
||||
A still incomplete implementation for Arabic is also
|
||||
included.
|
||||
</P>
|
||||
<P>
|
||||
<B>New in Version 1.1</B>
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Simpler APIs using overloading:
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Constructors.html">Constructors</A>: almost all trees in a category <CODE>C</CODE>
|
||||
can be built by the function <CODE>mkC</CODE>.
|
||||
<LI><A HREF="gfdoc/Combinators.html">Combinators</A>: cross-cut grammatical functions:
|
||||
predication, application, modification, coordination.
|
||||
<LI><A HREF="gfdoc/Symbolic.html">Symbolic</A>: noun phrases with mathematical symbols.
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
An example of use is <A HREF="../../../examples/logic"><CODE>logic</CODE></A>.
|
||||
The API of version 1.0 remains valid and can be used in combination with this.
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Some new functions.
|
||||
<LI>Bug fixes.
|
||||
</UL>
|
||||
|
||||
<H2>Authors</H2>
|
||||
<P>
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Ali El Dada (Arabic modules),
|
||||
Janna Khegai (Russian modules),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalía (Spanish cardinals),
|
||||
Harald Hammarström (German morphology),
|
||||
Patrik Jansson (Swedish cardinals),
|
||||
Andreas Priesnitz (German lexicon),
|
||||
Aarne Ranta.
|
||||
</P>
|
||||
<P>
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Peter Ljunglöf,
|
||||
Saara Myllyntausta,
|
||||
Wanjiku Ng'ang'a,
|
||||
Jordi Saludes.
|
||||
</P>
|
||||
<H2>License</H2>
|
||||
<P>
|
||||
The GF Resource Grammar Library is open-source software licensed under
|
||||
GNU General Public License. See the file <A HREF="../LICENSE">LICENSE</A> for more
|
||||
details.
|
||||
</P>
|
||||
<H2>Scope</H2>
|
||||
<P>
|
||||
Coverage, for each language:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>complete morphology
|
||||
<LI>lexicon of the ca. 100 most important structural words
|
||||
<LI>test lexicon of ca. 300 content words (rough equivalents in each language)
|
||||
<LI>list of irregular verbs (separately for each language)
|
||||
<LI>representative fragment of syntax (cf. CLE (Core Language Engine))
|
||||
<LI>rather flat semantics (cf. Quasi-Logical Form of CLE)
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Organization:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>top-level (API) modules
|
||||
<LI>Ground API + special-purpose APIs
|
||||
<LI>"school grammar" concepts rather than advanced linguistic theory
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Presentation:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>tool <CODE>gfdoc</CODE> for generating HTML from grammars
|
||||
<LI>example collections
|
||||
</UL>
|
||||
|
||||
<H2>Quick start</H2>
|
||||
<P>
|
||||
Go to the main directory, compile the grammars, and run a test.
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib/resource-1.0
|
||||
make
|
||||
make test
|
||||
</PRE>
|
||||
<P>
|
||||
This will take quite some time. An alternative is to use the
|
||||
precompiled grammar package <A HREF="../../compiled.tgz"><CODE>compiled.tgz</CODE></A>.
|
||||
This package has the necessary <CODE>gfc</CODE> and <CODE>gfr</CODE> files directly under <CODE>GF/lib</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
GF/lib/alltenses
|
||||
GF/lib/mathematical
|
||||
GF/lib/multimodal
|
||||
GF/lib/present
|
||||
</PRE>
|
||||
<P>
|
||||
Do for instance
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib/
|
||||
gf
|
||||
> i -path=present:prelude present/LangEng.gfc
|
||||
> gr -cat=S -number=3 -cf | tb
|
||||
</PRE>
|
||||
<P>
|
||||
For more examples, see the <A HREF="clt2006.html">Overview slides</A>.
|
||||
The <CODE>make</CODE> procedure does not make Arabic, but it can
|
||||
be compiled in a similar way as the other languages.
|
||||
</P>
|
||||
<H2>Encoding</H2>
|
||||
<P>
|
||||
Finnish, German, Romance, and Scandinavian languages are in isolatin-1.
|
||||
</P>
|
||||
<P>
|
||||
Arabic and Russian are in UTF-8.
|
||||
</P>
|
||||
<P>
|
||||
English is in pure ASCII.
|
||||
</P>
|
||||
<H3>The language independent ground API</H3>
|
||||
<P>
|
||||
This API is accessible by both <CODE>present</CODE> and <CODE>alltenses</CODE>.
|
||||
The API is divided into a bunch of <CODE>abstract</CODE> modules.
|
||||
The following figure gives the dependencies of these modules.
|
||||
</P>
|
||||
<P>
|
||||
<IMG ALIGN="left" SRC="Grammar.png" BORDER="0" ALT="">
|
||||
</P>
|
||||
<P>
|
||||
The documentation of the individual modules:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Common.html">Common</A>: abstract notions with language-indep. implementations
|
||||
<LI><A HREF="gfdoc/Cat.html">Cat</A>: the category system
|
||||
<LI><A HREF="gfdoc/Noun.html">Noun</A>: construction of nouns and noun phrases
|
||||
<LI><A HREF="gfdoc/Adjective.html">Adjective</A>: construction of adjectival phrases
|
||||
<LI><A HREF="gfdoc/Verb.html">Verb</A>: construction of verb phrases
|
||||
<LI><A HREF="gfdoc/Adverb.html">Adverb</A>: construction of adverbial phrases
|
||||
<LI><A HREF="gfdoc/Numeral.html">Numeral</A>: construction of cardinal and ordinal numerals
|
||||
<LI><A HREF="gfdoc/Sentence.html">Sentence</A>: construction of sentences and imperatives
|
||||
<LI><A HREF="gfdoc/Question.html">Question</A>: construction of questions
|
||||
<LI><A HREF="gfdoc/Relative.html">Relative</A>: construction of relative clauses
|
||||
<LI><A HREF="gfdoc/Conjunction.html">Conjunction</A>: coordination of phrases
|
||||
<LI><A HREF="gfdoc/Phrase.html">Phrase</A>: construction of the major units of text and speech
|
||||
<LI><A HREF="gfdoc/Text.html">Text</A>: construction of texts from phrases, using punctuation
|
||||
<LI><A HREF="gfdoc/Idiom.html">Idiom</A>: idiomatic phrases, such as existentials
|
||||
<LI><A HREF="gfdoc/Structural.html">Structural</A>: a lexicon of structural words
|
||||
<LI><A HREF="gfdoc/Lexicon.html">Lexicon</A>: a lexicon of other common words, for test purposes
|
||||
<LI><A HREF="gfdoc/Grammar.html">Grammar</A>: the main module comprising all but <CODE>Lexicon</CODE>
|
||||
<LI><A HREF="gfdoc/Lang.html">Lang</A>: the main module comprising both <CODE>Grammar</CODE> and <CODE>Lexicon</CODE>
|
||||
</UL>
|
||||
|
||||
<H3>The language-dependent APIs</H3>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/ParadigmsDan.html">ParadigmsDan</A>: Danish lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsEng.html">ParadigmsEng</A>: English lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsFin.html">ParadigmsFin</A>: Finnish lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsFre.html">ParadigmsFre</A>: French lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsIta.html">ParadigmsIta</A>: Italian lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsGer.html">ParadigmsGer</A>: German lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsNor.html">ParadigmsNor</A>: Norwegian lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsRus.html">ParadigmsRus</A>: Russian lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsSpa.html">ParadigmsSpa</A>: Spanish lexical paradigms
|
||||
<LI><A HREF="gfdoc/ParadigmsSwe.html">ParadigmsSwe</A>: Swedish lexical paradigms
|
||||
</UL>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="../danish/IrregDan.gf">IrregDan</A>: Danish irregular verbs (very incomplete)
|
||||
<LI><A HREF="../english/IrregEng.gf">IrregEng</A>: English irregular verbs
|
||||
<LI><A HREF="../french/IrregFre.gf">IrregFre</A>: French irregular verbs
|
||||
<LI><A HREF="../german/IrregGer.gf">IrregGer</A>: German irregular verbs
|
||||
<LI><A HREF="../norwegian/IrregNor.gf">IrregNor</A>: Norwegian irregular verbs (very incomplete)
|
||||
<LI><A HREF="../spanish/IrregSpa.gf">IrregSpa</A>: Spanish irregular verbs
|
||||
<LI><A HREF="../swedish/IrregSwe.gf">IrregSwe</A>: Swedish irregular verbs
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
This is the structure of each language-dependent top module.
|
||||
</P>
|
||||
<P>
|
||||
<IMG ALIGN="middle" SRC="English.png" BORDER="0" ALT="">
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="../abstract/Extra.gf">Extra</A>: extra constructs implemented in some languages
|
||||
<LI><A HREF="../danish/ExtraDanAbs.gf">ExtraDan</A>: extra constructs in Danish
|
||||
<LI><A HREF="../english/ExtraEngAbs.gf">ExtraEng</A>: extra constructs in English
|
||||
<LI><A HREF="../finnish/ExtraFinAbs.gf">ExtraFin</A>: extra constructs in Finnish
|
||||
<LI><A HREF="../french/ExtraFreAbs.gf">ExtraFre</A>: extra constructs in French
|
||||
<LI><A HREF="../italian/ExtraItaAbs.gf">ExtraIta</A>: extra constructs in Italian
|
||||
<LI><A HREF="../norwegian/ExtraNorAbs.gf">ExtraNor</A>: extra constructs in Norwegian
|
||||
<LI><A HREF="../russian/ExtraRusAbs.gf">ExtraRus</A>: extra constructs in Russian
|
||||
<LI><A HREF="../scandinavian/ExtraScandAbs.gf">ExtraScand</A>: extra constructs in Scandinavian
|
||||
<LI><A HREF="../french/ExtraSpaAbs.gf">ExtraSpa</A>: extra constructs in Spanish
|
||||
<LI><A HREF="../swedish/ExtraSweAbs.gf">ExtraSwe</A>: extra constructs in Swedish
|
||||
</UL>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="../danish/DanishAbs.gf">Danish</A>: Danish with all extras
|
||||
<LI><A HREF="../english/EnglishAbs.gf">English</A>: English with all extras
|
||||
<LI><A HREF="../finnish/FinnishAbs.gf">Finnish</A>: Finnish with all extras
|
||||
<LI><A HREF="../french/FrenchAbs.gf">French</A>: French with all extras
|
||||
<LI><A HREF="../german/GermanAbs.gf">German</A>: German with all extras
|
||||
<LI><A HREF="../italian/ItalianAbs.gf">Italian</A>: Italian with all extras
|
||||
<LI><A HREF="../norwegian/NorwegianAbs.gf">Norwegian</A>: Norwegian with all extras
|
||||
<LI><A HREF="../russian/RussianAbs.gf">Russian</A>: Russian with all extras
|
||||
<LI><A HREF="../spanish/SpanishAbs.gf">Spanish</A>: Spanish with all extras
|
||||
<LI><A HREF="../swedish/SwedishAbs.gf">Swedish</A>: Swedish with all extras
|
||||
</UL>
|
||||
|
||||
<H3>Special-purpose APIs</H3>
|
||||
<H4>Present</H4>
|
||||
<P>
|
||||
The API is the same as for the full ground API, but the compiler
|
||||
has ignored all verb and sentence tenses except the present.
|
||||
Lines ignored in the source files are marked by <CODE>--# notpresent</CODE>.
|
||||
The result is a smaller and more efficient grammar, which is still
|
||||
sufficient for many applications.
|
||||
</P>
|
||||
<H4>Multimodal</H4>
|
||||
<P>
|
||||
The API is the same as for the full ground API, but with modified
|
||||
linearization types of <CODE>NP</CODE> and <CODE>Adv</CODE>, and all other categories
|
||||
depending on them: an extra field is added to a demonstrative pointing
|
||||
gesture. Some functions for constructing demonstratives are provided.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Multi.html">Multi</A>: main module for multimodal dialogue systems
|
||||
</UL>
|
||||
|
||||
<H4>Mathematical</H4>
|
||||
<UL>
|
||||
<LI><A HREF="gfdoc/Mathematical.html">Mathematical</A>: main module for mathematical language
|
||||
<LI><A HREF="gfdoc/Predication.html">Predication</A>: predication with verbs, adjectives, etc
|
||||
<LI><A HREF="gfdoc/Symbol.html">Symbol</A>: symbols and numbers in text
|
||||
</UL>
|
||||
|
||||
<H2>Using the library</H2>
|
||||
<H3>The compiled version</H3>
|
||||
<P>
|
||||
The simplest way to get the library is to install the precompiled version
|
||||
<A HREF="../../compiled.tgz"><CODE>lib/compiled.tgz</CODE></A>. Just do
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib
|
||||
tar xvfz compiled.tgz
|
||||
</PRE>
|
||||
<P>
|
||||
There is no need to link application grammars to the source directories of the
|
||||
library. Use one (or several) of the following packages instead:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>lib/alltenses</CODE> the complete ground-API library with all forms
|
||||
<LI><CODE>lib/present</CODE> a pruned ground-API library with present tense only
|
||||
<LI><CODE>lib/mathematical</CODE> special-purpose API for mathematical applications
|
||||
<LI><CODE>lib/multimodal</CODE> the complete ground-API with demonstratives for
|
||||
multimodal dialogue applications
|
||||
</UL>
|
||||
|
||||
<H3>Linking applications to libraries</H3>
|
||||
<P>
|
||||
Typically, open one of
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>GrammarX</CODE> for just syntax
|
||||
<LI><CODE>LangX</CODE> for both syntax and a small lexicon
|
||||
<LI><CODE>X</CODE> (e.g. <CODE>English</CODE>) for syntax, lexicon, and language-dependent extensions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Usually you also need your own lexicon, and hence have to open
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>ParadigmsX</CODE> for lexicon-building functions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
It is advisable to use the bare package names in paths pointing to the
|
||||
libraries. Here is an example, from <CODE>examples/dialogue/LightsEng.gf</CODE>:
|
||||
</P>
|
||||
<PRE>
|
||||
--# -path=.:alltenses:multimodal:prelude
|
||||
</PRE>
|
||||
<P>
|
||||
To reach these directories from anywhere, set the environment variable
|
||||
<CODE>GF_LIB_PATH</CODE> to point to the directory <CODE>GF/lib/</CODE>. For instance,
|
||||
I have the following line in my <CODE>.bashrc</CODE> file:
|
||||
</P>
|
||||
<PRE>
|
||||
export GF_LIB_PATH=/home/aarne/GF/lib
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
The <CODE>mathematical</CODE> API shares modules with
|
||||
<CODE>present</CODE>. It is therefore not a good idea to use it in combination with
|
||||
<CODE>alltenses</CODE>.
|
||||
</P>
|
||||
<H3>Using the libraries as top-level grammars</H3>
|
||||
<P>
|
||||
If you have done <CODE>make</CODE> in <CODE>lib/resource-1.0</CODE>, you will have
|
||||
a file <CODE>langs.gfcm</CODE>. This file can be used with fast startup for
|
||||
tasks such as treebank generation:
|
||||
</P>
|
||||
<PRE>
|
||||
> i -nocf langs.gfcm
|
||||
> gr -cat=S -cf -number=10 | tb
|
||||
</PRE>
|
||||
<P>
|
||||
The <CODE>-nocf</CODE> flag saves startup time and memory by preventing the
|
||||
creation of context-free parse grammars.
|
||||
The resource grammar libraries do <I>not</I> support
|
||||
parsing very well. While it is theoretically possible to parse with any
|
||||
GF grammar, the resource grammars are so abstract and complex that
|
||||
building the actual parser in memory may just need too much resources
|
||||
to succeed.
|
||||
</P>
|
||||
<P>
|
||||
An exception is <CODE>LangEng</CODE>. It is actually feasible to parse with
|
||||
both <CODE>alltenses/LangEng</CODE> and <CODE>present/LangEng</CODE> - the latter being
|
||||
much faster than the former. The <CODE>-fcfg</CODE> flag (fast multiple context-free grammar)
|
||||
must be used:
|
||||
</P>
|
||||
<PRE>
|
||||
p -lang=LangEng -fcfg "this man is old"
|
||||
</PRE>
|
||||
<P>
|
||||
Parsing with the <CODE>-fcfg</CODE> flag takes a few extra seconds the first time during
|
||||
each session, but gets faster at later runs. From GF 2.6, <CODE>fcfg</CODE> is the
|
||||
default parser of GF and the flag is not needed.
|
||||
</P>
|
||||
<P>
|
||||
It is also possible to parse in Scandinavian languages
|
||||
(Danish, Norwegian, Swedish) and, with enough memory (<CODE>gf +RTS -K512M</CODE>),
|
||||
German.
|
||||
</P>
|
||||
<H2>Example applications</H2>
|
||||
<P>
|
||||
These applications are meant to serve as starting points for
|
||||
new applications, showing how the libraries can be used in
|
||||
typical situations.
|
||||
</P>
|
||||
<H3>Bronzeage</H3>
|
||||
<P>
|
||||
The <A HREF="../../../examples/bronzeage">examples/bronzeage</A>
|
||||
grammar set implements a language fragment
|
||||
based on the Swadesh list of 200 words. It is useful for
|
||||
things like language training.
|
||||
</P>
|
||||
<H3>Dialogue</H3>
|
||||
<P>
|
||||
The <A HREF="../../../examples/dialogue">examples/dialogue</A>
|
||||
grammar set implements the user grammars of some
|
||||
multimodal dialogue system.
|
||||
Its purpose is to serve as a prototype for applications in the
|
||||
TALK project.
|
||||
</P>
|
||||
<H3>Animals</H3>
|
||||
<P>
|
||||
The <A HREF="../../../examples/animal">examples/animal</A>
|
||||
grammar set implements some queries about animals.
|
||||
Its purpose is to serve as a prototype for example-based
|
||||
grammar writing.
|
||||
</P>
|
||||
<H2>Known bugs and missing components</H2>
|
||||
<P>
|
||||
Danish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the lexicon and chosen inflections are only partially verified
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
English
|
||||
</P>
|
||||
<P>
|
||||
Finnish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>wrong cases in some passive constructions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
French
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
<LI>third person pronominal questions with inverted word order
|
||||
have wrong forms if "t" is required e.g.
|
||||
(e.g. "comment fera-t-il" becomes "comment fera il")
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
German
|
||||
</P>
|
||||
<P>
|
||||
Italian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Norwegian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the lexicon and chosen inflections are only partially verified
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Russian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>some functions missing
|
||||
<LI>some regular paradigms are missing
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Spanish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
<LI>missing contractions with imperatives and clitics
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Swedish
|
||||
</P>
|
||||
<H2>More reading</H2>
|
||||
<P>
|
||||
<A HREF="../../../doc/resource.pdf">GF Resource Grammar Library</A> (pdf).
|
||||
Printable user manual with API documentation (version 1.0).
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="gslt-sem-2006.html">Grammars as Software Libraries</A>. Slides
|
||||
with background and motivation for the resource grammar library.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="clt2006.html">GF Resource Grammar Library Version 1.0</A>. Slides
|
||||
giving an overview of the library and practical hints on its use.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="Resource-HOWTO.html">How to write resource grammars</A>. Helps you
|
||||
start if you want to add another language to the library.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/geocal2006.pdf">Parametrized modules for Romance languages</A>.
|
||||
Slides explaining some ideas in the implementation of
|
||||
French, Italian, and Spanish.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/slides/webalt-2005.pdf">Grammar writing by examples</A>.
|
||||
Slides showing how the method is used.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf">Multimodal Resource Grammars</A>.
|
||||
Slides showing how to use the multimodal resource library. N.B. the library
|
||||
examples are from <CODE>multimodal/old</CODE>, which is a reduced-size API.
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags index.txt -->
|
||||
</BODY></HTML>
|
||||
439
lib/resource/doc/index-1.1.txt
Normal file
@@ -0,0 +1,439 @@
|
||||
GF Resource Grammar Library v. 1.1
|
||||
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
|
||||
Last update: %%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags --toc -thtml index.txt
|
||||
|
||||
%!target:html
|
||||
|
||||
|
||||
The GF Resource Grammar Library defines the basic grammar of
|
||||
ten languages:
|
||||
Danish, English, Finnish, French, German,
|
||||
Italian, Norwegian, Russian, Spanish, Swedish.
|
||||
A still incomplete implementation for Arabic is also
|
||||
included.
|
||||
|
||||
**New in Version 1.1**
|
||||
- Simpler APIs using overloading:
|
||||
- [Constructors gfdoc/Constructors.html]: almost all trees in a category ``C``
|
||||
can be built by the function ``mkC``.
|
||||
- [Combinators gfdoc/Combinators.html]: cross-cut grammatical functions:
|
||||
predication, application, modification, coordination.
|
||||
- [Symbolic gfdoc/Symbolic.html]: noun phrases with mathematical symbols.
|
||||
|
||||
|
||||
An example of use is [``logic`` ../../../examples/logic].
|
||||
The API of version 1.0 remains valid and can be used in combination with this.
|
||||
- Some new functions.
|
||||
- Bug fixes.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
==Authors==
|
||||
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Ali El Dada (Arabic modules),
|
||||
Janna Khegai (Russian modules),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalía (Spanish cardinals),
|
||||
Harald Hammarström (German morphology),
|
||||
Patrik Jansson (Swedish cardinals),
|
||||
Andreas Priesnitz (German lexicon),
|
||||
Aarne Ranta.
|
||||
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Peter Ljunglöf,
|
||||
Saara Myllyntausta,
|
||||
Wanjiku Ng'ang'a,
|
||||
Jordi Saludes.
|
||||
|
||||
|
||||
==License==
|
||||
|
||||
The GF Resource Grammar Library is open-source software licensed under
|
||||
GNU General Public License. See the file [LICENSE ../LICENSE] for more
|
||||
details.
|
||||
|
||||
|
||||
==Scope==
|
||||
|
||||
Coverage, for each language:
|
||||
- complete morphology
|
||||
- lexicon of the ca. 100 most important structural words
|
||||
- test lexicon of ca. 300 content words (rough equivalents in each language)
|
||||
- list of irregular verbs (separately for each language)
|
||||
- representative fragment of syntax (cf. CLE (Core Language Engine))
|
||||
- rather flat semantics (cf. Quasi-Logical Form of CLE)
|
||||
|
||||
|
||||
Organization:
|
||||
- top-level (API) modules
|
||||
- Ground API + special-purpose APIs
|
||||
- "school grammar" concepts rather than advanced linguistic theory
|
||||
|
||||
|
||||
Presentation:
|
||||
- tool ``gfdoc`` for generating HTML from grammars
|
||||
- example collections
|
||||
|
||||
|
||||
==Quick start==
|
||||
|
||||
Go to the main directory, compile the grammars, and run a test.
|
||||
```
|
||||
cd GF/lib/resource-1.0
|
||||
make
|
||||
make test
|
||||
```
|
||||
This will take quite some time. An alternative is to use the
|
||||
precompiled grammar package [``compiled.tgz`` ../../compiled.tgz].
|
||||
This package has the necessary ``gfc`` and ``gfr`` files directly under ``GF/lib``.
|
||||
```
|
||||
GF/lib/alltenses
|
||||
GF/lib/mathematical
|
||||
GF/lib/multimodal
|
||||
GF/lib/present
|
||||
```
|
||||
Do for instance
|
||||
```
|
||||
cd GF/lib/
|
||||
gf
|
||||
> i -path=present:prelude present/LangEng.gfc
|
||||
> gr -cat=S -number=3 -cf | tb
|
||||
```
|
||||
For more examples, see the [Overview slides clt2006.html].
|
||||
The ``make`` procedure does not make Arabic, but it can
|
||||
be compiled in a similar way as the other languages.
|
||||
|
||||
|
||||
==Encoding==
|
||||
|
||||
Finnish, German, Romance, and Scandinavian languages are in isolatin-1.
|
||||
|
||||
Arabic and Russian are in UTF-8.
|
||||
|
||||
English is in pure ASCII.
|
||||
|
||||
|
||||
|
||||
===The language independent ground API===
|
||||
|
||||
This API is accessible by both ``present`` and ``alltenses``.
|
||||
The API is divided into a bunch of ``abstract`` modules.
|
||||
The following figure gives the dependencies of these modules.
|
||||
|
||||
[Grammar.png]
|
||||
|
||||
The documentation of the individual modules:
|
||||
|
||||
- [Common gfdoc/Common.html]: abstract notions with language-indep. implementations
|
||||
- [Cat gfdoc/Cat.html]: the category system
|
||||
- [Noun gfdoc/Noun.html]: construction of nouns and noun phrases
|
||||
- [Adjective gfdoc/Adjective.html]: construction of adjectival phrases
|
||||
- [Verb gfdoc/Verb.html]: construction of verb phrases
|
||||
- [Adverb gfdoc/Adverb.html]: construction of adverbial phrases
|
||||
- [Numeral gfdoc/Numeral.html]: construction of cardinal and ordinal numerals
|
||||
- [Sentence gfdoc/Sentence.html]: construction of sentences and imperatives
|
||||
- [Question gfdoc/Question.html]: construction of questions
|
||||
- [Relative gfdoc/Relative.html]: construction of relative clauses
|
||||
- [Conjunction gfdoc/Conjunction.html]: coordination of phrases
|
||||
- [Phrase gfdoc/Phrase.html]: construction of the major units of text and speech
|
||||
- [Text gfdoc/Text.html]: construction of texts from phrases, using punctuation
|
||||
- [Idiom gfdoc/Idiom.html]: idiomatic phrases, such as existentials
|
||||
- [Structural gfdoc/Structural.html]: a lexicon of structural words
|
||||
- [Lexicon gfdoc/Lexicon.html]: a lexicon of other common words, for test purposes
|
||||
- [Grammar gfdoc/Grammar.html]: the main module comprising all but ``Lexicon``
|
||||
- [Lang gfdoc/Lang.html]: the main module comprising both ``Grammar`` and ``Lexicon``
|
||||
|
||||
|
||||
===The language-dependent APIs===
|
||||
|
||||
- [ParadigmsDan gfdoc/ParadigmsDan.html]: Danish lexical paradigms
|
||||
- [ParadigmsEng gfdoc/ParadigmsEng.html]: English lexical paradigms
|
||||
- [ParadigmsFin gfdoc/ParadigmsFin.html]: Finnish lexical paradigms
|
||||
- [ParadigmsFre gfdoc/ParadigmsFre.html]: French lexical paradigms
|
||||
- [ParadigmsIta gfdoc/ParadigmsIta.html]: Italian lexical paradigms
|
||||
- [ParadigmsGer gfdoc/ParadigmsGer.html]: German lexical paradigms
|
||||
- [ParadigmsNor gfdoc/ParadigmsNor.html]: Norwegian lexical paradigms
|
||||
- [ParadigmsRus gfdoc/ParadigmsRus.html]: Russian lexical paradigms
|
||||
- [ParadigmsSpa gfdoc/ParadigmsSpa.html]: Spanish lexical paradigms
|
||||
- [ParadigmsSwe gfdoc/ParadigmsSwe.html]: Swedish lexical paradigms
|
||||
|
||||
|
||||
|
||||
- [IrregDan ../danish/IrregDan.gf]: Danish irregular verbs (very incomplete)
|
||||
- [IrregEng ../english/IrregEng.gf]: English irregular verbs
|
||||
- [IrregFre ../french/IrregFre.gf]: French irregular verbs
|
||||
- [IrregGer ../german/IrregGer.gf]: German irregular verbs
|
||||
- [IrregNor ../norwegian/IrregNor.gf]: Norwegian irregular verbs (very incomplete)
|
||||
- [IrregSpa ../spanish/IrregSpa.gf]: Spanish irregular verbs
|
||||
- [IrregSwe ../swedish/IrregSwe.gf]: Swedish irregular verbs
|
||||
|
||||
|
||||
This is the structure of each language-dependent top module.
|
||||
|
||||
[English.png]
|
||||
|
||||
- [Extra ../abstract/Extra.gf]: extra constructs implemented in some languages
|
||||
- [ExtraDan ../danish/ExtraDanAbs.gf]: extra constructs in Danish
|
||||
- [ExtraEng ../english/ExtraEngAbs.gf]: extra constructs in English
|
||||
- [ExtraFin ../finnish/ExtraFinAbs.gf]: extra constructs in Finnish
|
||||
- [ExtraFre ../french/ExtraFreAbs.gf]: extra constructs in French
|
||||
- [ExtraIta ../italian/ExtraItaAbs.gf]: extra constructs in Italian
|
||||
- [ExtraNor ../norwegian/ExtraNorAbs.gf]: extra constructs in Norwegian
|
||||
- [ExtraRus ../russian/ExtraRusAbs.gf]: extra constructs in Russian
|
||||
- [ExtraScand ../scandinavian/ExtraScandAbs.gf]: extra constructs in Scandinavian
|
||||
- [ExtraSpa ../french/ExtraSpaAbs.gf]: extra constructs in Spanish
|
||||
- [ExtraSwe ../swedish/ExtraSweAbs.gf]: extra constructs in Swedish
|
||||
|
||||
|
||||
- [Danish ../danish/DanishAbs.gf]: Danish with all extras
|
||||
- [English ../english/EnglishAbs.gf]: English with all extras
|
||||
- [Finnish ../finnish/FinnishAbs.gf]: Finnish with all extras
|
||||
- [French ../french/FrenchAbs.gf]: French with all extras
|
||||
- [German ../german/GermanAbs.gf]: German with all extras
|
||||
- [Italian ../italian/ItalianAbs.gf]: Italian with all extras
|
||||
- [Norwegian ../norwegian/NorwegianAbs.gf]: Norwegian with all extras
|
||||
- [Russian ../russian/RussianAbs.gf]: Russian with all extras
|
||||
- [Spanish ../spanish/SpanishAbs.gf]: Spanish with all extras
|
||||
- [Swedish ../swedish/SwedishAbs.gf]: Swedish with all extras
|
||||
|
||||
|
||||
|
||||
===Special-purpose APIs===
|
||||
|
||||
====Present====
|
||||
|
||||
The API is the same as for the full ground API, but the compiler
|
||||
has ignored all verb and sentence tenses except the present.
|
||||
Lines ignored in the source files are marked by ``--# notpresent``.
|
||||
The result is a smaller and more efficient grammar, which is still
|
||||
sufficient for many applications.
|
||||
|
||||
|
||||
====Multimodal====
|
||||
|
||||
The API is the same as for the full ground API, but with modified
|
||||
linearization types of ``NP`` and ``Adv``, and all other categories
|
||||
depending on them: an extra field is added to a demonstrative pointing
|
||||
gesture. Some functions for constructing demonstratives are provided.
|
||||
|
||||
- [Multi gfdoc/Multi.html]: main module for multimodal dialogue systems
|
||||
|
||||
|
||||
====Mathematical====
|
||||
|
||||
- [Mathematical gfdoc/Mathematical.html]: main module for mathematical language
|
||||
- [Predication gfdoc/Predication.html]: predication with verbs, adjectives, etc
|
||||
- [Symbol gfdoc/Symbol.html]: symbols and numbers in text
|
||||
|
||||
|
||||
|
||||
==Using the library==
|
||||
|
||||
===The compiled version===
|
||||
|
||||
The simplest way to get the library is to install the precompiled version
|
||||
[``lib/compiled.tgz`` ../../compiled.tgz]. Just do
|
||||
```
|
||||
cd GF/lib
|
||||
tar xvfz compiled.tgz
|
||||
```
|
||||
There is no need to link application grammars to the source directories of the
|
||||
library. Use one (or several) of the following packages instead:
|
||||
|
||||
- ``lib/alltenses`` the complete ground-API library with all forms
|
||||
- ``lib/present`` a pruned ground-API library with present tense only
|
||||
- ``lib/mathematical`` special-purpose API for mathematical applications
|
||||
- ``lib/multimodal`` the complete ground-API with demonstratives for
|
||||
multimodal dialogue applications
|
||||
|
||||
|
||||
===Linking applications to libraries===
|
||||
|
||||
Typically, open one of
|
||||
- ``GrammarX`` for just syntax
|
||||
- ``LangX`` for both syntax and a small lexicon
|
||||
- ``X`` (e.g. ``English``) for syntax, lexicon, and language-dependent extensions
|
||||
|
||||
|
||||
Usually you also need your own lexicon, and hence have to open
|
||||
- ``ParadigmsX`` for lexicon-building functions
|
||||
|
||||
|
||||
It is advisable to use the bare package names in paths pointing to the
|
||||
libraries. Here is an example, from ``examples/dialogue/LightsEng.gf``:
|
||||
```
|
||||
--# -path=.:alltenses:multimodal:prelude
|
||||
```
|
||||
To reach these directories from anywhere, set the environment variable
|
||||
``GF_LIB_PATH`` to point to the directory ``GF/lib/``. For instance,
|
||||
I have the following line in my ``.bashrc`` file:
|
||||
```
|
||||
export GF_LIB_PATH=/home/aarne/GF/lib
|
||||
```
|
||||
|
||||
The ``mathematical`` API shares modules with
|
||||
``present``. It is therefore not a good idea to use it in combination with
|
||||
``alltenses``.
|
||||
|
||||
|
||||
|
||||
===Using the libraries as top-level grammars===
|
||||
|
||||
If you have done ``make`` in ``lib/resource-1.0``, you will have
|
||||
a file ``langs.gfcm``. This file can be used with fast startup for
|
||||
tasks such as treebank generation:
|
||||
```
|
||||
> i -nocf langs.gfcm
|
||||
> gr -cat=S -cf -number=10 | tb
|
||||
```
|
||||
The ``-nocf`` flag saves startup time and memory by preventing the
|
||||
creation of context-free parse grammars.
|
||||
The resource grammar libraries do //not// support
|
||||
parsing very well. While it is theoretically possible to parse with any
|
||||
GF grammar, the resource grammars are so abstract and complex that
|
||||
building the actual parser in memory may just need too much resources
|
||||
to succeed.
|
||||
|
||||
An exception is ``LangEng``. It is actually feasible to parse with
|
||||
both ``alltenses/LangEng`` and ``present/LangEng`` - the latter being
|
||||
much faster than the former. The ``-fcfg`` flag (fast multiple context-free grammar)
|
||||
must be used:
|
||||
```
|
||||
p -lang=LangEng -fcfg "this man is old"
|
||||
```
|
||||
Parsing with the ``-fcfg`` flag takes a few extra seconds the first time during
|
||||
each session, but gets faster at later runs. From GF 2.6, ``fcfg`` is the
|
||||
default parser of GF and the flag is not needed.
|
||||
|
||||
It is also possible to parse in Scandinavian languages
|
||||
(Danish, Norwegian, Swedish) and, with enough memory (``gf +RTS -K512M``),
|
||||
German.
|
||||
|
||||
|
||||
|
||||
|
||||
==Example applications==
|
||||
|
||||
These applications are meant to serve as starting points for
|
||||
new applications, showing how the libraries can be used in
|
||||
typical situations.
|
||||
|
||||
===Bronzeage===
|
||||
|
||||
The [examples/bronzeage ../../../examples/bronzeage]
|
||||
grammar set implements a language fragment
|
||||
based on the Swadesh list of 200 words. It is useful for
|
||||
things like language training.
|
||||
|
||||
|
||||
===Dialogue===
|
||||
|
||||
The [examples/dialogue ../../../examples/dialogue]
|
||||
grammar set implements the user grammars of some
|
||||
multimodal dialogue system.
|
||||
Its purpose is to serve as a prototype for applications in the
|
||||
TALK project.
|
||||
|
||||
|
||||
===Animals===
|
||||
|
||||
The [examples/animal ../../../examples/animal]
|
||||
grammar set implements some queries about animals.
|
||||
Its purpose is to serve as a prototype for example-based
|
||||
grammar writing.
|
||||
|
||||
|
||||
==Known bugs and missing components==
|
||||
|
||||
Danish
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
English
|
||||
|
||||
|
||||
Finnish
|
||||
- wrong cases in some passive constructions
|
||||
|
||||
|
||||
French
|
||||
- multiple clitics (with V3) not always right
|
||||
- third person pronominal questions with inverted word order
|
||||
have wrong forms if "t" is required e.g.
|
||||
(e.g. "comment fera-t-il" becomes "comment fera il")
|
||||
|
||||
|
||||
German
|
||||
|
||||
|
||||
Italian
|
||||
- multiple clitics (with V3) not always right
|
||||
|
||||
|
||||
Norwegian
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
Russian
|
||||
- some functions missing
|
||||
- some regular paradigms are missing
|
||||
|
||||
|
||||
Spanish
|
||||
- multiple clitics (with V3) not always right
|
||||
- missing contractions with imperatives and clitics
|
||||
|
||||
|
||||
Swedish
|
||||
|
||||
|
||||
|
||||
|
||||
==More reading==
|
||||
|
||||
[GF Resource Grammar Library ../../../doc/resource.pdf] (pdf).
|
||||
Printable user manual with API documentation (version 1.0).
|
||||
|
||||
[Grammars as Software Libraries gslt-sem-2006.html]. Slides
|
||||
with background and motivation for the resource grammar library.
|
||||
|
||||
[GF Resource Grammar Library Version 1.0 clt2006.html]. Slides
|
||||
giving an overview of the library and practical hints on its use.
|
||||
|
||||
[How to write resource grammars Resource-HOWTO.html]. Helps you
|
||||
start if you want to add another language to the library.
|
||||
|
||||
[Parametrized modules for Romance languages http://www.cs.chalmers.se/~aarne/geocal2006.pdf].
|
||||
Slides explaining some ideas in the implementation of
|
||||
French, Italian, and Spanish.
|
||||
|
||||
[Grammar writing by examples http://www.cs.chalmers.se/~aarne/slides/webalt-2005.pdf].
|
||||
Slides showing how the method is used.
|
||||
|
||||
[Multimodal Resource Grammars http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf].
|
||||
Slides showing how to use the multimodal resource library. N.B. the library
|
||||
examples are from ``multimodal/old``, which is a reduced-size API.
|
||||
|
||||
320
lib/resource/doc/index.html
Normal file
@@ -0,0 +1,320 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE>GF Resource Grammar Library v. 1.2</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1>GF Resource Grammar Library v. 1.2</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Sun Jul 8 18:49:50 2007
|
||||
</FONT></CENTER>
|
||||
|
||||
<P>
|
||||
<center>
|
||||
</P>
|
||||
<P>
|
||||
<IMG ALIGN="middle" SRC="10lang-large.png" BORDER="0" ALT="">
|
||||
</P>
|
||||
<P>
|
||||
</center>
|
||||
</P>
|
||||
<P>
|
||||
The GF Resource Grammar Library defines the basic grammar of
|
||||
ten languages:
|
||||
Danish, English, Finnish, French, German,
|
||||
Italian, Norwegian, Russian, Spanish, Swedish.
|
||||
Still incomplete implementations for Arabic and Catalan are also
|
||||
included.
|
||||
</P>
|
||||
<P>
|
||||
<B>New in Version 1.2</B>
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Simpler APIs using overloading: see <A HREF="synopsis.html">Synopsis</A>.
|
||||
The API of version 1.0 remains valid and can be used in combination with this.
|
||||
<LI>Bug fixes and new paradigms.
|
||||
<LI>Licensed under LGPL.
|
||||
</UL>
|
||||
|
||||
<H2>Authors</H2>
|
||||
<P>
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Ali El Dada (Arabic modules),
|
||||
Janna Khegai (Russian modules),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalía (Spanish cardinals),
|
||||
Harald Hammarström (German morphology),
|
||||
Patrik Jansson (Swedish cardinals),
|
||||
Andreas Priesnitz (German lexicon),
|
||||
Aarne Ranta,
|
||||
Jordi Saludes (Catalan modules),
|
||||
Henning Thielemann (German lexicon).
|
||||
</P>
|
||||
<P>
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Hans Leiß,
|
||||
Peter Ljunglöf,
|
||||
Saara Myllyntausta,
|
||||
Wanjiku Ng'ang'a,
|
||||
Nadine Perera,
|
||||
Jordi Saludes.
|
||||
</P>
|
||||
<H2>License</H2>
|
||||
<P>
|
||||
The GF Resource Grammar Library is open-source software licensed under
|
||||
GNU Lesser General Public License (LGPL). See the file <A HREF="../LICENSE">LICENSE</A> for more
|
||||
details.
|
||||
</P>
|
||||
<H2>Scope</H2>
|
||||
<P>
|
||||
Coverage, for each language:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>complete morphology
|
||||
<LI>lexicon of the ca. 100 most important structural words
|
||||
<LI>test lexicon of ca. 300 content words (rough equivalents in each language)
|
||||
<LI>list of irregular verbs (separately for each language)
|
||||
<LI>representative fragment of syntax (cf. CLE (Core Language Engine))
|
||||
<LI>rather flat semantics (cf. Quasi-Logical Form of CLE)
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Organization:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>top-level (API) modules
|
||||
<LI>Ground API + special-purpose APIs
|
||||
<LI>"school grammar" concepts rather than advanced linguistic theory
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Presentation:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>tool <CODE>gfdoc</CODE> for generating HTML from grammars
|
||||
<LI>example collections
|
||||
</UL>
|
||||
|
||||
<H2>Location</H2>
|
||||
<P>
|
||||
Assuming you have installed the libraries, you will find the precompiled
|
||||
<CODE>gfc</CODE> and <CODE>gfr</CODE> files directly under <CODE>$GF_LIB_PATH</CODE>, whose default
|
||||
value is <CODE>/usr/local/share/GF/</CODE>. The precompiled subdirectories are
|
||||
</P>
|
||||
<PRE>
|
||||
alltenses
|
||||
mathematical
|
||||
multimodal
|
||||
present
|
||||
</PRE>
|
||||
<P>
|
||||
Do for instance
|
||||
</P>
|
||||
<PRE>
|
||||
cd $GF_LIB_PATH
|
||||
gf alltenses/langs.gfcm
|
||||
|
||||
> p -cat=S -lang=LangEng "this grammar is too big" | tb
|
||||
</PRE>
|
||||
<P>
|
||||
For more details, see the <A HREF="synopsis.html">Synopsis</A>.
|
||||
</P>
|
||||
<H2>Compilation</H2>
|
||||
<P>
|
||||
If you want to compile the library from scratch, use <CODE>make</CODE> in the root of
|
||||
the source directory:
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib/resource-1.0
|
||||
make
|
||||
</PRE>
|
||||
<P>
|
||||
The <CODE>make</CODE> procedure does not by default make Arabic and Catalan, but you
|
||||
can uncomment the relevant lines in <CODE>Makefile</CODE> to compile them.
|
||||
</P>
|
||||
<H2>Encoding</H2>
|
||||
<P>
|
||||
Finnish, German, Romance, and Scandinavian languages are in isolatin-1.
|
||||
</P>
|
||||
<P>
|
||||
Arabic and Russian are in UTF-8.
|
||||
</P>
|
||||
<P>
|
||||
English is in pure ASCII.
|
||||
</P>
|
||||
<P>
|
||||
The different encodings imply, unfortunately, that it is hard to get
|
||||
a nice view of all languages simultaneously. The easiest way to achieve this is
|
||||
to use <CODE>gfeditor</CODE>, which automatically converts grammars to UTF-8.
|
||||
</P>
|
||||
<H2>Using the resource as library</H2>
|
||||
<P>
|
||||
This API is accessible by both <CODE>present</CODE> and <CODE>alltenses</CODE>. The modules you most often need are
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Syntax</CODE>, the interface to syntactic structures
|
||||
<LI><CODE>Syntax</CODE><I>L</I>, the implementations of <CODE>Syntax</CODE> for each language <I>L</I>
|
||||
<LI><CODE>Paradigms</CODE><I>L</I>, the morphological paradigms for each language <I>L</I>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The <A HREF="synopsis.html">Synopsis</A> gives examples on the typical usage of these
|
||||
modules.
|
||||
</P>
|
||||
<H2>Using the resource as top level grammar</H2>
|
||||
<P>
|
||||
The following modules can be used for parsing and linearization. They are accessible from both
|
||||
<CODE>present</CODE> and <CODE>alltenses</CODE>.
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>Lang</CODE><I>L</I> for each language <I>L</I>, implementing a common abstract syntax <CODE>Lang</CODE>
|
||||
<LI><CODE>Danish</CODE>, <CODE>English</CODE>, etc, implementing <CODE>Lang</CODE> with language-specific extensions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
In addition, there is in both <CODE>present</CODE> and <CODE>alltenses</CODE> the file
|
||||
</P>
|
||||
<UL>
|
||||
<LI><CODE>langs.gfcm</CODE>, a package with precompiled <CODE>Lang</CODE><I>L</I> grammars
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
A way to test and view the resource grammar is to load <CODE>langs.gfcm</CODE> either into <CODE>gfeditor</CODE>
|
||||
or into the <CODE>gf</CODE> shell and perform actions such as syntax editing and treebank generation.
|
||||
For instance, the command
|
||||
</P>
|
||||
<PRE>
|
||||
> p -lang=LangEng -cat=S "this grammar is too big" | tb
|
||||
</PRE>
|
||||
<P>
|
||||
creates a treebank entry with translations of this sentence.
|
||||
</P>
|
||||
<P>
|
||||
For parsing, currently only English and the Scandinavian languages are within the limits ofr
|
||||
reasonable resources. For other languages <I>L</I>, parsing with <CODE>Lang</CODE><I>L</I> will probably eat
|
||||
up the computer resources before finishing the parser generation.
|
||||
</P>
|
||||
<H2>Accessing the lower level ground API</H2>
|
||||
<P>
|
||||
The <CODE>Syntax</CODE> API is implemented in terms a bunch of <CODE>abstract</CODE> modules, which
|
||||
as of version 1.2 are mainly interesting for implementors of the resource.
|
||||
See the <A HREF="index-1.1.html">documentation for version 1.1</A> for more details.
|
||||
</P>
|
||||
<H2>Known bugs and missing components</H2>
|
||||
<P>
|
||||
Danish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the lexicon and chosen inflections are only partially verified
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
English
|
||||
</P>
|
||||
<P>
|
||||
Finnish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>wrong cases in some passive constructions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
French
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
<LI>third person pronominal questions with inverted word order
|
||||
have wrong forms if "t" is required e.g.
|
||||
(e.g. "comment fera-t-il" becomes "comment fera il")
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
German
|
||||
</P>
|
||||
<P>
|
||||
Italian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Norwegian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the lexicon and chosen inflections are only partially verified
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Russian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>some functions missing
|
||||
<LI>some regular paradigms are missing
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Spanish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>multiple clitics (with V3) not always right
|
||||
<LI>missing contractions with imperatives and clitics
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Swedish
|
||||
</P>
|
||||
<H2>More reading</H2>
|
||||
<P>
|
||||
<A HREF="synopsis.html">Synopsis</A>. The concise guide to API v. 1.2.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="gslt-sem-2006.html">Grammars as Software Libraries</A>. Slides
|
||||
with background and motivation for the resource grammar library.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="clt2006.html">GF Resource Grammar Library Version 1.0</A>. Slides
|
||||
giving an overview of the library and practical hints on its use.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="Resource-HOWTO.html">How to write resource grammars</A>. Helps you
|
||||
start if you want to add another language to the library.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/geocal2006.pdf">Parametrized modules for Romance languages</A>.
|
||||
Slides explaining some ideas in the implementation of
|
||||
French, Italian, and Spanish.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/slides/webalt-2005.pdf">Grammar writing by examples</A>.
|
||||
Slides showing how linearization rules are written as strings parsable by the resource grammar.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf">Multimodal Resource Grammars</A>.
|
||||
Slides showing how to use the multimodal resource library. N.B. the library
|
||||
examples are from <CODE>multimodal/old</CODE>, which is a reduced-size API.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="../../../doc/resource.pdf">GF Resource Grammar Library</A> (pdf).
|
||||
Printable user manual with API documentation, for version 1.0.
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags -thtml index.txt -->
|
||||
</BODY></HTML>
|
||||
270
lib/resource/doc/index.txt
Normal file
@@ -0,0 +1,270 @@
|
||||
GF Resource Grammar Library v. 1.2
|
||||
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
|
||||
Last update: %%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags --toc -thtml index.txt
|
||||
|
||||
%!target:html
|
||||
|
||||
%!postproc(html): #BCEN <center>
|
||||
%!postproc(html): #ECEN </center>
|
||||
|
||||
|
||||
#BCEN
|
||||
|
||||
[10lang-large.png]
|
||||
|
||||
#ECEN
|
||||
|
||||
|
||||
The GF Resource Grammar Library defines the basic grammar of
|
||||
ten languages:
|
||||
Danish, English, Finnish, French, German,
|
||||
Italian, Norwegian, Russian, Spanish, Swedish.
|
||||
Still incomplete implementations for Arabic and Catalan are also
|
||||
included.
|
||||
|
||||
**New in Version 1.2**
|
||||
- Simpler APIs using overloading: see [Synopsis synopsis.html].
|
||||
The API of version 1.0 remains valid and can be used in combination with this.
|
||||
- Bug fixes and new paradigms.
|
||||
- Licensed under LGPL.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
==Authors==
|
||||
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Ali El Dada (Arabic modules),
|
||||
Janna Khegai (Russian modules),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalía (Spanish cardinals),
|
||||
Harald Hammarström (German morphology),
|
||||
Patrik Jansson (Swedish cardinals),
|
||||
Andreas Priesnitz (German lexicon),
|
||||
Aarne Ranta,
|
||||
Jordi Saludes (Catalan modules),
|
||||
Henning Thielemann (German lexicon).
|
||||
|
||||
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Hans Leiß,
|
||||
Peter Ljunglöf,
|
||||
Saara Myllyntausta,
|
||||
Wanjiku Ng'ang'a,
|
||||
Nadine Perera,
|
||||
Jordi Saludes.
|
||||
|
||||
|
||||
==License==
|
||||
|
||||
The GF Resource Grammar Library is open-source software licensed under
|
||||
GNU Lesser General Public License (LGPL). See the file [LICENSE ../LICENSE] for more
|
||||
details.
|
||||
|
||||
|
||||
==Scope==
|
||||
|
||||
Coverage, for each language:
|
||||
- complete morphology
|
||||
- lexicon of the ca. 100 most important structural words
|
||||
- test lexicon of ca. 300 content words (rough equivalents in each language)
|
||||
- list of irregular verbs (separately for each language)
|
||||
- representative fragment of syntax (cf. CLE (Core Language Engine))
|
||||
- rather flat semantics (cf. Quasi-Logical Form of CLE)
|
||||
|
||||
|
||||
Organization:
|
||||
- top-level (API) modules
|
||||
- Ground API + special-purpose APIs
|
||||
- "school grammar" concepts rather than advanced linguistic theory
|
||||
|
||||
|
||||
Presentation:
|
||||
- tool ``gfdoc`` for generating HTML from grammars
|
||||
- example collections
|
||||
|
||||
|
||||
==Location==
|
||||
|
||||
Assuming you have installed the libraries, you will find the precompiled
|
||||
``gfc`` and ``gfr`` files directly under ``$GF_LIB_PATH``, whose default
|
||||
value is ``/usr/local/share/GF/``. The precompiled subdirectories are
|
||||
```
|
||||
alltenses
|
||||
mathematical
|
||||
multimodal
|
||||
present
|
||||
```
|
||||
Do for instance
|
||||
```
|
||||
cd $GF_LIB_PATH
|
||||
gf alltenses/langs.gfcm
|
||||
|
||||
> p -cat=S -lang=LangEng "this grammar is too big" | tb
|
||||
```
|
||||
For more details, see the [Synopsis synopsis.html].
|
||||
|
||||
|
||||
==Compilation==
|
||||
|
||||
If you want to compile the library from scratch, use ``make`` in the root of
|
||||
the source directory:
|
||||
```
|
||||
cd GF/lib/resource-1.0
|
||||
make
|
||||
```
|
||||
The ``make`` procedure does not by default make Arabic and Catalan, but you
|
||||
can uncomment the relevant lines in ``Makefile`` to compile them.
|
||||
|
||||
|
||||
==Encoding==
|
||||
|
||||
Finnish, German, Romance, and Scandinavian languages are in isolatin-1.
|
||||
|
||||
Arabic and Russian are in UTF-8.
|
||||
|
||||
English is in pure ASCII.
|
||||
|
||||
The different encodings imply, unfortunately, that it is hard to get
|
||||
a nice view of all languages simultaneously. The easiest way to achieve this is
|
||||
to use ``gfeditor``, which automatically converts grammars to UTF-8.
|
||||
|
||||
|
||||
==Using the resource as library==
|
||||
|
||||
This API is accessible by both ``present`` and ``alltenses``. The modules you most often need are
|
||||
- ``Syntax``, the interface to syntactic structures
|
||||
- ``Syntax``//L//, the implementations of ``Syntax`` for each language //L//
|
||||
- ``Paradigms``//L//, the morphological paradigms for each language //L//
|
||||
|
||||
|
||||
The [Synopsis synopsis.html] gives examples on the typical usage of these
|
||||
modules.
|
||||
|
||||
|
||||
==Using the resource as top level grammar==
|
||||
|
||||
The following modules can be used for parsing and linearization. They are accessible from both
|
||||
``present`` and ``alltenses``.
|
||||
- ``Lang``//L// for each language //L//, implementing a common abstract syntax ``Lang``
|
||||
- ``Danish``, ``English``, etc, implementing ``Lang`` with language-specific extensions
|
||||
|
||||
|
||||
In addition, there is in both ``present`` and ``alltenses`` the file
|
||||
- ``langs.gfcm``, a package with precompiled ``Lang``//L// grammars
|
||||
|
||||
|
||||
A way to test and view the resource grammar is to load ``langs.gfcm`` either into ``gfeditor``
|
||||
or into the ``gf`` shell and perform actions such as syntax editing and treebank generation.
|
||||
For instance, the command
|
||||
```
|
||||
> p -lang=LangEng -cat=S "this grammar is too big" | tb
|
||||
```
|
||||
creates a treebank entry with translations of this sentence.
|
||||
|
||||
For parsing, currently only English and the Scandinavian languages are within the limits ofr
|
||||
reasonable resources. For other languages //L//, parsing with ``Lang``//L// will probably eat
|
||||
up the computer resources before finishing the parser generation.
|
||||
|
||||
|
||||
|
||||
==Accessing the lower level ground API==
|
||||
|
||||
The ``Syntax`` API is implemented in terms a bunch of ``abstract`` modules, which
|
||||
as of version 1.2 are mainly interesting for implementors of the resource.
|
||||
See the [documentation for version 1.1 index-1.1.html] for more details.
|
||||
|
||||
|
||||
==Known bugs and missing components==
|
||||
|
||||
Danish
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
English
|
||||
|
||||
|
||||
Finnish
|
||||
- wrong cases in some passive constructions
|
||||
|
||||
|
||||
French
|
||||
- multiple clitics (with V3) not always right
|
||||
- third person pronominal questions with inverted word order
|
||||
have wrong forms if "t" is required e.g.
|
||||
(e.g. "comment fera-t-il" becomes "comment fera il")
|
||||
|
||||
|
||||
German
|
||||
|
||||
|
||||
Italian
|
||||
- multiple clitics (with V3) not always right
|
||||
|
||||
|
||||
Norwegian
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
Russian
|
||||
- some functions missing
|
||||
- some regular paradigms are missing
|
||||
|
||||
|
||||
Spanish
|
||||
- multiple clitics (with V3) not always right
|
||||
- missing contractions with imperatives and clitics
|
||||
|
||||
|
||||
Swedish
|
||||
|
||||
|
||||
|
||||
|
||||
==More reading==
|
||||
|
||||
[Synopsis synopsis.html]. The concise guide to API v. 1.2.
|
||||
|
||||
[Grammars as Software Libraries gslt-sem-2006.html]. Slides
|
||||
with background and motivation for the resource grammar library.
|
||||
|
||||
[GF Resource Grammar Library Version 1.0 clt2006.html]. Slides
|
||||
giving an overview of the library and practical hints on its use.
|
||||
|
||||
[How to write resource grammars Resource-HOWTO.html]. Helps you
|
||||
start if you want to add another language to the library.
|
||||
|
||||
[Parametrized modules for Romance languages http://www.cs.chalmers.se/~aarne/geocal2006.pdf].
|
||||
Slides explaining some ideas in the implementation of
|
||||
French, Italian, and Spanish.
|
||||
|
||||
[Grammar writing by examples http://www.cs.chalmers.se/~aarne/slides/webalt-2005.pdf].
|
||||
Slides showing how linearization rules are written as strings parsable by the resource grammar.
|
||||
|
||||
[Multimodal Resource Grammars http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf].
|
||||
Slides showing how to use the multimodal resource library. N.B. the library
|
||||
examples are from ``multimodal/old``, which is a reduced-size API.
|
||||
|
||||
[GF Resource Grammar Library ../../../doc/resource.pdf] (pdf).
|
||||
Printable user manual with API documentation, for version 1.0.
|
||||
|
||||
175
lib/resource/doc/latin.gf
Normal file
@@ -0,0 +1,175 @@
|
||||
--1 A Latin grammar to illustrate some main dependencies
|
||||
--
|
||||
-- All implementations of the resource API have so far been variations
|
||||
-- and extensions of this. The most notable regularities are
|
||||
-- - which types of features each category has
|
||||
-- - how inherent features are inherited and passed to parameters
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
cat
|
||||
Cl ; -- clause
|
||||
VP ; -- verb phrase
|
||||
V2 ; -- two-place verb
|
||||
NP ; -- noun phrase
|
||||
CN ; -- common noun
|
||||
Det ; -- determiner
|
||||
AP ; -- adjectival phrase
|
||||
|
||||
fun
|
||||
PredVP : NP -> VP -> Cl ; -- predication
|
||||
ComplV2 : V2 -> NP -> VP ; -- complementization
|
||||
DetCN : Det -> CN -> NP ; -- determination
|
||||
ModCN : AP -> CN -> CN ; -- modification
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Person = P1 | P2 | P3 ;
|
||||
Tense = Pres | Past ;
|
||||
Polarity = Pos | Neg ;
|
||||
Case = Nom | Acc | Dat ;
|
||||
Gender = Masc | Fem | Neutr ;
|
||||
|
||||
oper
|
||||
Agr = {g : Gender ; n : Number ; p : Person} ; -- agreement features
|
||||
|
||||
lincat
|
||||
Cl = {
|
||||
s : Tense => Polarity => Str
|
||||
} ;
|
||||
VP = {
|
||||
verb : Tense => Polarity => Agr => Str ;
|
||||
neg : Polarity => Str ; -- negation
|
||||
compl : Agr => Str -- complement
|
||||
} ;
|
||||
V2 = {
|
||||
s : Tense => Number => Person => Str ;
|
||||
c : Case -- complement case
|
||||
} ;
|
||||
NP = {
|
||||
s : Case => Str ;
|
||||
a : Agr -- agreement features
|
||||
} ;
|
||||
CN = {
|
||||
s : Number => Case => Str ;
|
||||
g : Gender
|
||||
} ;
|
||||
Det = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number
|
||||
} ;
|
||||
AP = {
|
||||
s : Gender => Number => Case => Str
|
||||
} ;
|
||||
|
||||
lin
|
||||
PredVP np vp = {
|
||||
s = \\t,p =>
|
||||
let
|
||||
agr = np.a ;
|
||||
subject = np.s ! Nom ;
|
||||
object = vp.compl ! agr ;
|
||||
verb = vp.neg ! p ++ vp.verb ! t ! p ! agr
|
||||
in
|
||||
subject ++ object ++ verb
|
||||
} ;
|
||||
|
||||
ComplV2 v np = {
|
||||
verb = \\t,p,a => v.s ! t ! a.n ! a.p ;
|
||||
compl = \\_ => np.s ! v.c ;
|
||||
neg = table {Pos => [] ; Neg => "non"}
|
||||
} ;
|
||||
|
||||
DetCN det cn =
|
||||
let
|
||||
g = cn.g ;
|
||||
n = det.n
|
||||
in {
|
||||
s = \\c => det.s ! g ! c ++ cn.s ! n ! c ;
|
||||
a = {g = g ; n = n ; p = P3}
|
||||
} ;
|
||||
|
||||
ModCN ap cn =
|
||||
let
|
||||
g = cn.g
|
||||
in {
|
||||
s = \\n,c => cn.s ! n ! c ++ ap.s ! g ! n ! c ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
-- lexicon to test
|
||||
|
||||
fun
|
||||
ego_NP : NP ;
|
||||
omnis_Det : Det ;
|
||||
defPl_Det : Det ;
|
||||
|
||||
amare_V2 : V2 ;
|
||||
placere_V2 : V2 ;
|
||||
puella_CN : CN ;
|
||||
servus_CN : CN ;
|
||||
habilis_AP : AP ;
|
||||
|
||||
lin
|
||||
ego_NP = {
|
||||
s = table Case ["ego" ; "me" ; "mihi"] ;
|
||||
a = {g = Fem ; n = Sg ; p = P1}
|
||||
} ;
|
||||
|
||||
omnis_Det = {
|
||||
s = table {
|
||||
Masc | Fem => table Case ["omnis" ; "omnem" ; "omni"] ;
|
||||
_ => table Case ["omne" ; "omne" ; "omni"]
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
|
||||
defPl_Det = {
|
||||
s = \\_,_ => [] ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
amare_V2 = {
|
||||
s = \\t,n,p => table (Tense * Number * Person) [
|
||||
"amo" ; "amas" ; "amat" ; "amamus" ; "amatis" ; "amant" ;
|
||||
"amabam" ; "amabas" ; "amabat" ; "amabamus" ; "amabatis" ; "amabant"
|
||||
] ! <t,n,p> ;
|
||||
c = Acc
|
||||
} ;
|
||||
|
||||
placere_V2 = {
|
||||
s = \\t,n,p => table (Tense * Number * Person) [
|
||||
"placeo" ; "places" ; "placet" ; "placemus" ; "placetis" ; "placent" ;
|
||||
"placebam" ; "placebas" ; "placebat" ; "placebamus" ; "placebatis" ; "placebant"
|
||||
] ! <t,n,p> ;
|
||||
c = Dat
|
||||
} ;
|
||||
|
||||
puella_CN = {
|
||||
s = \\n,c => table (Number * Case) [
|
||||
"puella" ; "puellam" ; "puellae" ;
|
||||
"puellae" ; "puellas" ; "puellis"
|
||||
] ! <n,c> ;
|
||||
g = Fem
|
||||
} ;
|
||||
|
||||
servus_CN = {
|
||||
s = \\n,c => table (Number * Case) [
|
||||
"servus" ; "servum" ; "servo" ;
|
||||
"servi" ; "servos" ; "servis"
|
||||
] ! <n,c> ;
|
||||
g = Masc
|
||||
} ;
|
||||
|
||||
habilis_AP = {
|
||||
s = table {
|
||||
Masc | Fem => \\n,c => table (Number * Case) [
|
||||
"habilis" ; "habilem" ; "habili" ; "habiles" ; "habiles" ; "habilibus"
|
||||
] ! <n,c> ;
|
||||
_ => \\n,c => table (Number * Case) [
|
||||
"habile" ; "habile" ; "habili" ; "habilia" ; "habilia" ; "habilibus"
|
||||
] ! <n,c>
|
||||
}
|
||||
} ;
|
||||
|
||||
581
lib/resource/doc/official.txt
Normal file
@@ -0,0 +1,581 @@
|
||||
The Official EU languages
|
||||
|
||||
The 20 official languages of the EU and their abbreviations are as follows:
|
||||
|
||||
Español ES Spanish
|
||||
Dansk DA Danish
|
||||
Deutsch DE German
|
||||
Elinika EL Greek
|
||||
English EN
|
||||
Français FR French
|
||||
Italiano IT Italian
|
||||
Nederlands NL Dutch
|
||||
Português PT Portuguese
|
||||
Suomi FI Finnish
|
||||
Svenska SV Swedish
|
||||
?e?tina CS Czech
|
||||
Eesti ET Estonian
|
||||
Latviesu valoda LV Latvian
|
||||
Lietuviu kalba LT Lithuanian
|
||||
Magyar HU Hungarian
|
||||
Malti MT Maltese
|
||||
Polski PL Polish
|
||||
Sloven?ina SK Slovak
|
||||
Sloven??ina SL Slovene
|
||||
|
||||
http://europa.eu.int/comm/education/policies/lang/languages/index_en.html
|
||||
|
||||
-----
|
||||
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
|
||||
|
||||
ar arabic
|
||||
no norwegian
|
||||
ru russian
|
||||
|
||||
--
|
||||
|
||||
ISO 639: 3-letter codes
|
||||
|
||||
abk ab Abkhazian
|
||||
ace Achinese
|
||||
ach Acoli
|
||||
ada Adangme
|
||||
aar aa Afar
|
||||
afh Afrihili
|
||||
afr af Afrikaans
|
||||
afa Afro-Asiatic (Other)
|
||||
aka Akan
|
||||
akk Akkadian
|
||||
alb/sqi sq Albanian
|
||||
ale Aleut
|
||||
alg Algonquian languages
|
||||
tut Altaic (Other)
|
||||
amh am Amharic
|
||||
apa Apache languages
|
||||
ara ar Arabic
|
||||
arc Aramaic
|
||||
arp Arapaho
|
||||
arn Araucanian
|
||||
arw Arawak
|
||||
arm/hye hy Armenian
|
||||
art Artificial (Other)
|
||||
asm as Assamese
|
||||
ath Athapascan languages
|
||||
map Austronesian (Other)
|
||||
ava Avaric
|
||||
ave Avestan
|
||||
awa Awadhi
|
||||
aym ay Aymara
|
||||
aze az Azerbaijani
|
||||
nah Aztec
|
||||
ban Balinese
|
||||
bat Baltic (Other)
|
||||
bal Baluchi
|
||||
bam Bambara
|
||||
bai Bamileke languages
|
||||
bad Banda
|
||||
bnt Bantu (Other)
|
||||
bas Basa
|
||||
bak ba Bashkir
|
||||
baq/eus eu Basque
|
||||
bej Beja
|
||||
bem Bemba
|
||||
ben bn Bengali
|
||||
ber Berber (Other)
|
||||
bho Bhojpuri
|
||||
bih bh Bihari
|
||||
bik Bikol
|
||||
bin Bini
|
||||
bis bi Bislama
|
||||
bra Braj
|
||||
bre be Breton
|
||||
bug Buginese
|
||||
bul bg Bulgarian
|
||||
bua Buriat
|
||||
bur/mya my Burmese
|
||||
bel be Byelorussian
|
||||
cad Caddo
|
||||
car Carib
|
||||
cat ca Catalan
|
||||
cau Caucasian (Other)
|
||||
ceb Cebuano
|
||||
cel Celtic (Other)
|
||||
cai Central American Indian (Other)
|
||||
chg Chagatai
|
||||
cha Chamorro
|
||||
che Chechen
|
||||
chr Cherokee
|
||||
chy Cheyenne
|
||||
chb Chibcha
|
||||
chi/zho zh Chinese
|
||||
chn Chinook jargon
|
||||
cho Choctaw
|
||||
chu Church Slavic
|
||||
chv Chuvash
|
||||
cop Coptic
|
||||
cor Cornish
|
||||
cos co Corsican
|
||||
cre Cree
|
||||
mus Creek
|
||||
crp Creoles and Pidgins (Other)
|
||||
cpe Creoles and Pidgins, English-based (Other)
|
||||
cpf Creoles and Pidgins, French-based (Other)
|
||||
cpp Creoles and Pidgins, Portuguese-based (Other)
|
||||
cus Cushitic (Other)
|
||||
hr Croatian
|
||||
ces/cze cs Czech
|
||||
dak Dakota
|
||||
dan da Danish
|
||||
del Delaware
|
||||
din Dinka
|
||||
div Divehi
|
||||
doi Dogri
|
||||
dra Dravidian (Other)
|
||||
dua Duala
|
||||
dut/nla nl Dutch
|
||||
dum Dutch, Middle (ca. 1050-1350)
|
||||
dyu Dyula
|
||||
dzo dz Dzongkha
|
||||
efi Efik
|
||||
egy Egyptian (Ancient)
|
||||
eka Ekajuk
|
||||
elx Elamite
|
||||
eng en English
|
||||
enm English, Middle (ca. 1100-1500)
|
||||
ang English, Old (ca. 450-1100)
|
||||
esk Eskimo (Other)
|
||||
epo eo Esperanto
|
||||
est et Estonian
|
||||
ewe Ewe
|
||||
ewo Ewondo
|
||||
fan Fang
|
||||
fat Fanti
|
||||
fao fo Faroese
|
||||
fij fj Fijian
|
||||
fin fi Finnish
|
||||
fiu Finno-Ugrian (Other)
|
||||
fon Fon
|
||||
fra/fre fr French
|
||||
frm French, Middle (ca. 1400-1600)
|
||||
fro French, Old (842- ca. 1400)
|
||||
fry fy Frisian
|
||||
ful Fulah
|
||||
gaa Ga
|
||||
gae/gdh Gaelic (Scots)
|
||||
glg gl Gallegan
|
||||
lug Ganda
|
||||
gay Gayo
|
||||
gez Geez
|
||||
geo/kat ka Georgian
|
||||
deu/ger de German
|
||||
gmh German, Middle High (ca. 1050-1500)
|
||||
goh German, Old High (ca. 750-1050)
|
||||
gem Germanic (Other)
|
||||
gil Gilbertese
|
||||
gon Gondi
|
||||
got Gothic
|
||||
grb Grebo
|
||||
grc Greek, Ancient (to 1453)
|
||||
ell/gre el Greek, Modern (1453-)
|
||||
kal kl Greenlandic
|
||||
grn gn Guarani
|
||||
guj gu Gujarati
|
||||
hai Haida
|
||||
hau ha Hausa
|
||||
haw Hawaiian
|
||||
heb he Hebrew
|
||||
her Herero
|
||||
hil Hiligaynon
|
||||
him Himachali
|
||||
hin hi Hindi
|
||||
hmo Hiri Motu
|
||||
hun hu Hungarian
|
||||
hup Hupa
|
||||
iba Iban
|
||||
ice/isl is Icelandic
|
||||
ibo Igbo
|
||||
ijo Ijo
|
||||
ilo Iloko
|
||||
inc Indic (Other)
|
||||
ine Indo-European (Other)
|
||||
ind id Indonesian
|
||||
ina ia Interlingua (International Auxiliary language Association)
|
||||
ine - Interlingue
|
||||
iku iu Inuktitut
|
||||
ipk ik Inupiak
|
||||
ira Iranian (Other)
|
||||
gai/iri ga Irish
|
||||
sga Irish, Old (to 900)
|
||||
mga Irish, Middle (900 - 1200)
|
||||
iro Iroquoian languages
|
||||
ita it Italian
|
||||
jpn ja Japanese
|
||||
jav/jaw jv/jw Javanese
|
||||
jrb Judeo-Arabic
|
||||
jpr Judeo-Persian
|
||||
kab Kabyle
|
||||
kac Kachin
|
||||
kam Kamba
|
||||
kan kn Kannada
|
||||
kau Kanuri
|
||||
kaa Kara-Kalpak
|
||||
kar Karen
|
||||
kas ks Kashmiri
|
||||
kaw Kawi
|
||||
kaz kk Kazakh
|
||||
kha Khasi
|
||||
khm km Khmer
|
||||
khi Khoisan (Other)
|
||||
kho Khotanese
|
||||
kik Kikuyu
|
||||
kin rw Kinyarwanda
|
||||
kir ky Kirghiz
|
||||
kom Komi
|
||||
kon Kongo
|
||||
kok Konkani
|
||||
kor ko Korean
|
||||
kpe Kpelle
|
||||
kro Kru
|
||||
kua Kuanyama
|
||||
kum Kumyk
|
||||
kur ku Kurdish
|
||||
kru Kurukh
|
||||
kus Kusaie
|
||||
kut Kutenai
|
||||
lad Ladino
|
||||
lah Lahnda
|
||||
lam Lamba
|
||||
oci oc Langue d'Oc (post 1500)
|
||||
lao lo Lao
|
||||
lat la Latin
|
||||
lav lv Latvian
|
||||
ltz Letzeburgesch
|
||||
lez Lezghian
|
||||
lin ln Lingala
|
||||
lit lt Lithuanian
|
||||
loz Lozi
|
||||
lub Luba-Katanga
|
||||
lui Luiseno
|
||||
lun Lunda
|
||||
luo Luo (Kenya and Tanzania)
|
||||
mac/mak mk Macedonian
|
||||
mad Madurese
|
||||
mag Magahi
|
||||
mai Maithili
|
||||
mak Makasar
|
||||
mlg mg Malagasy
|
||||
may/msa ms Malay
|
||||
mal Malayalam
|
||||
mlt ml Maltese
|
||||
man Mandingo
|
||||
mni Manipuri
|
||||
mno Manobo languages
|
||||
max Manx
|
||||
mao/mri mi Maori
|
||||
mar mr Marathi
|
||||
chm Mari
|
||||
mah Marshall
|
||||
mwr Marwari
|
||||
mas Masai
|
||||
myn Mayan languages
|
||||
men Mende
|
||||
mic Micmac
|
||||
min Minangkabau
|
||||
mis Miscellaneous (Other)
|
||||
moh Mohawk
|
||||
mol mo Moldavian
|
||||
mkh Mon-Kmer (Other)
|
||||
lol Mongo
|
||||
mon mn Mongolian
|
||||
mos Mossi
|
||||
mul Multiple languages
|
||||
mun Munda languages
|
||||
nau na Nauru
|
||||
nav Navajo
|
||||
nde Ndebele, North
|
||||
nbl Ndebele, South
|
||||
ndo Ndongo
|
||||
nep ne Nepali
|
||||
new Newari
|
||||
nic Niger-Kordofanian (Other)
|
||||
ssa Nilo-Saharan (Other)
|
||||
niu Niuean
|
||||
non Norse, Old
|
||||
nai North American Indian (Other)
|
||||
nor no Norwegian
|
||||
nno Norwegian (Nynorsk)
|
||||
nub Nubian languages
|
||||
nym Nyamwezi
|
||||
nya Nyanja
|
||||
nyn Nyankole
|
||||
nyo Nyoro
|
||||
nzi Nzima
|
||||
oji Ojibwa
|
||||
ori or Oriya
|
||||
orm om Oromo
|
||||
osa Osage
|
||||
oss Ossetic
|
||||
oto Otomian languages
|
||||
pal Pahlavi
|
||||
pau Palauan
|
||||
pli Pali
|
||||
pam Pampanga
|
||||
pag Pangasinan
|
||||
pan pa Panjabi
|
||||
pap Papiamento
|
||||
paa Papuan-Australian (Other)
|
||||
fas/per fa Persian
|
||||
peo Persian, Old (ca 600 - 400 B.C.)
|
||||
phn Phoenician
|
||||
pol pl Polish
|
||||
pon Ponape
|
||||
por pt Portuguese
|
||||
pra Prakrit languages
|
||||
pro Provencal, Old (to 1500)
|
||||
pus ps Pushto
|
||||
que qu Quechua
|
||||
roh rm Rhaeto-Romance
|
||||
raj Rajasthani
|
||||
rar Rarotongan
|
||||
roa Romance (Other)
|
||||
ron/rum ro Romanian
|
||||
rom Romany
|
||||
run rn Rundi
|
||||
rus ru Russian
|
||||
sal Salishan languages
|
||||
sam Samaritan Aramaic
|
||||
smi Sami languages
|
||||
smo sm Samoan
|
||||
sad Sandawe
|
||||
sag sg Sango
|
||||
san sa Sanskrit
|
||||
srd Sardinian
|
||||
sco Scots
|
||||
sel Selkup
|
||||
sem Semitic (Other)
|
||||
sr Serbian
|
||||
scr sh Serbo-Croatian
|
||||
srr Serer
|
||||
shn Shan
|
||||
sna sn Shona
|
||||
sid Sidamo
|
||||
bla Siksika
|
||||
snd sd Sindhi
|
||||
sin si Singhalese
|
||||
sit - Sino-Tibetan (Other)
|
||||
sio Siouan languages
|
||||
sla Slavic (Other)
|
||||
ssw ss Siswant
|
||||
slk/slo sk Slovak
|
||||
slv sl Slovenian
|
||||
sog Sogdian
|
||||
som so Somali
|
||||
son Songhai
|
||||
wen Sorbian languages
|
||||
nso Sotho, Northern
|
||||
sot st Sotho, Southern
|
||||
sai South American Indian (Other)
|
||||
esl/spa es Spanish
|
||||
suk Sukuma
|
||||
sux Sumerian
|
||||
sun su Sudanese
|
||||
sus Susu
|
||||
swa sw Swahili
|
||||
ssw Swazi
|
||||
sve/swe sv Swedish
|
||||
syr Syriac
|
||||
tgl tl Tagalog
|
||||
tah Tahitian
|
||||
tgk tg Tajik
|
||||
tmh Tamashek
|
||||
tam ta Tamil
|
||||
tat tt Tatar
|
||||
tel te Telugu
|
||||
ter Tereno
|
||||
tha th Thai
|
||||
bod/tib bo Tibetan
|
||||
tig Tigre
|
||||
tir ti Tigrinya
|
||||
tem Timne
|
||||
tiv Tivi
|
||||
tli Tlingit
|
||||
tog to Tonga (Nyasa)
|
||||
ton Tonga (Tonga Islands)
|
||||
tru Truk
|
||||
tsi Tsimshian
|
||||
tso ts Tsonga
|
||||
tsn tn Tswana
|
||||
tum Tumbuka
|
||||
tur tr Turkish
|
||||
ota Turkish, Ottoman (1500 - 1928)
|
||||
tuk tk Turkmen
|
||||
tyv Tuvinian
|
||||
twi tw Twi
|
||||
uga Ugaritic
|
||||
uig ug Uighur
|
||||
ukr uk Ukrainian
|
||||
umb Umbundu
|
||||
und Undetermined
|
||||
urd ur Urdu
|
||||
uzb uz Uzbek
|
||||
vai Vai
|
||||
ven Venda
|
||||
vie vi Vietnamese
|
||||
vol vo Volapük
|
||||
vot Votic
|
||||
wak Wakashan languages
|
||||
wal Walamo
|
||||
war Waray
|
||||
was Washo
|
||||
cym/wel cy Welsh
|
||||
wol wo Wolof
|
||||
xho xh Xhosa
|
||||
sah Yakut
|
||||
yao Yao
|
||||
yap Yap
|
||||
yid yi Yiddish
|
||||
yor yo Yoruba
|
||||
zap Zapotec
|
||||
zen Zenaga
|
||||
zha za Zhuang
|
||||
zul zu Zulu
|
||||
zun Zuni
|
||||
|
||||
ISO 639: 2-letter codes
|
||||
|
||||
AA "Afar"
|
||||
AB "Abkhazian"
|
||||
AF "Afrikaans"
|
||||
AM "Amharic"
|
||||
AR "Arabic"
|
||||
AS "Assamese"
|
||||
AY "Aymara"
|
||||
AZ "Azerbaijani"
|
||||
BA "Bashkir"
|
||||
BE "Byelorussian"
|
||||
BG "Bulgarian"
|
||||
BH "Bihari"
|
||||
BI "Bislama"
|
||||
BN "Bengali" "Bangla"
|
||||
BO "Tibetan"
|
||||
BR "Breton"
|
||||
CA "Catalan"
|
||||
CO "Corsican"
|
||||
CS "Czech"
|
||||
CY "Welsh"
|
||||
DA "Danish"
|
||||
DE "German"
|
||||
DZ "Bhutani"
|
||||
EL "Greek"
|
||||
EN "English" "American"
|
||||
EO "Esperanto"
|
||||
ES "Spanish"
|
||||
ET "Estonian"
|
||||
EU "Basque"
|
||||
FA "Persian"
|
||||
FI "Finnish"
|
||||
FJ "Fiji"
|
||||
FO "Faeroese"
|
||||
FR "French"
|
||||
FY "Frisian"
|
||||
GA "Irish"
|
||||
GD "Gaelic" "Scots Gaelic"
|
||||
GL "Galician"
|
||||
GN "Guarani"
|
||||
GU "Gujarati"
|
||||
HA "Hausa"
|
||||
HI "Hindi"
|
||||
HR "Croatian"
|
||||
HU "Hungarian"
|
||||
HY "Armenian"
|
||||
IA "Interlingua"
|
||||
IE "Interlingue"
|
||||
IK "Inupiak"
|
||||
IN "Indonesian"
|
||||
IS "Icelandic"
|
||||
IT "Italian"
|
||||
IW "Hebrew"
|
||||
JA "Japanese"
|
||||
JI "Yiddish"
|
||||
JW "Javanese"
|
||||
KA "Georgian"
|
||||
KK "Kazakh"
|
||||
KL "Greenlandic"
|
||||
KM "Cambodian"
|
||||
KN "Kannada"
|
||||
KO "Korean"
|
||||
KS "Kashmiri"
|
||||
KU "Kurdish"
|
||||
KY "Kirghiz"
|
||||
LA "Latin"
|
||||
LN "Lingala"
|
||||
LO "Laothian"
|
||||
LT "Lithuanian"
|
||||
LV "Latvian" "Lettish"
|
||||
MG "Malagasy"
|
||||
MI "Maori"
|
||||
MK "Macedonian"
|
||||
ML "Malayalam"
|
||||
MN "Mongolian"
|
||||
MO "Moldavian"
|
||||
MR "Marathi"
|
||||
MS "Malay"
|
||||
MT "Maltese"
|
||||
MY "Burmese"
|
||||
NA "Nauru"
|
||||
NE "Nepali"
|
||||
NL "Dutch"
|
||||
NO "Norwegian"
|
||||
OC "Occitan"
|
||||
OM "Oromo" "Afan"
|
||||
OR "Oriya"
|
||||
PA "Punjabi"
|
||||
PL "Polish"
|
||||
PS "Pashto" "Pushto"
|
||||
PT "Portuguese"
|
||||
QU "Quechua"
|
||||
RM "Rhaeto-Romance"
|
||||
RN "Kirundi"
|
||||
RO "Romanian"
|
||||
RU "Russian"
|
||||
RW "Kinyarwanda"
|
||||
SA "Sanskrit"
|
||||
SD "Sindhi"
|
||||
SG "Sangro"
|
||||
SH "Serbo-Croatian"
|
||||
SI "Singhalese"
|
||||
SK "Slovak"
|
||||
SL "Slovenian"
|
||||
SM "Samoan"
|
||||
SN "Shona"
|
||||
SO "Somali"
|
||||
SQ "Albanian"
|
||||
SR "Serbian"
|
||||
SS "Siswati"
|
||||
ST "Sesotho"
|
||||
SU "Sudanese"
|
||||
SV "Swedish"
|
||||
SW "Swahili"
|
||||
TA "Tamil"
|
||||
TE "Tegulu"
|
||||
TG "Tajik"
|
||||
TH "Thai"
|
||||
TI "Tigrinya"
|
||||
TK "Turkmen"
|
||||
TL "Tagalog"
|
||||
TN "Setswana"
|
||||
TO "Tonga"
|
||||
TR "Turkish"
|
||||
TS "Tsonga"
|
||||
TT "Tatar"
|
||||
TW "Twi"
|
||||
UK "Ukrainian"
|
||||
UR "Urdu"
|
||||
UZ "Uzbek"
|
||||
VI "Vietnamese"
|
||||
VO "Volapuk"
|
||||
WO "Wolof"
|
||||
XH "Xhosa"
|
||||
YO "Yoruba"
|
||||
ZH "Chinese"
|
||||
ZU "Zulu"
|
||||
1040
lib/resource/doc/old/gf-resource.txt
Normal file
48
lib/resource/doc/paradigms.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
Morphological Paradigms in the GF Resource Grammar Library
|
||||
Aarne Ranta
|
||||
|
||||
|
||||
This is a synopsis of the main morphological paradigms for
|
||||
nouns (``N``), adjectives (``A``), and verbs (``V``).
|
||||
|
||||
|
||||
=English=
|
||||
|
||||
```
|
||||
mkN : (flash : Str) -> N ; -- car, bus, ax, hero, fly, boy
|
||||
mkN : (man,men : Str) -> N ; -- index, indices
|
||||
mkN : (man,men,man's,men's : Str) -> N ;
|
||||
mkN : Str -> N -> N ; -- baby boom
|
||||
|
||||
mkA : (happy : Str) -> A ; -- small, happy, free
|
||||
mkA : (fat,fatter : Str) -> A ;
|
||||
mkA : (good,better,best,well : Str) -> A
|
||||
compoundA : A -> A ; -- -/more/most ridiculous
|
||||
|
||||
mkV : (cry : Str) -> V ; -- call, kiss, echo, cry, pray
|
||||
mkV : (stop,stopped : Str) -> V ;
|
||||
mkV : (drink,drank,drunk : Str) -> V ;
|
||||
mkV : (run,ran,run,running : Str) -> V ;
|
||||
mkV : (go,goes,went,gone,going : Str) -> V
|
||||
```
|
||||
|
||||
=French=
|
||||
|
||||
```
|
||||
mkN : (cheval : Str) -> N ; -- pas, prix, nez, bijou, cheval
|
||||
mkN : (foie : Str) -> Gender -> N ;
|
||||
mkN : (oeil,yeux : Str) -> Gender -> N ;
|
||||
mkN : N -> Str -> N
|
||||
|
||||
mkA : (cher : Str) -> A ; -- banal, heureux, italien, jeune, amer, carré, joli
|
||||
mkA : (sec,seche : Str) -> A ;
|
||||
mkA : (banal,banale,banaux,banalement : Str) -> A ;
|
||||
mkA : (bon : A) -> (meilleur : A) -> A
|
||||
prefixA : A -> A ;
|
||||
|
||||
mkV : (finir : Str) -> V ; -- aimer, céder, placer, manger, payer, finir
|
||||
mkV : (jeter,jette,jettera : Str) -> V ;
|
||||
mkV : V2 -> V
|
||||
etreV : V -> V ;
|
||||
reflV : V -> V ;
|
||||
```
|
||||
28
lib/resource/doc/synopsis-browse.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
=Browsing the libraries with GF commands=
|
||||
|
||||
All of the following assume
|
||||
```
|
||||
cd $GF_LIB_PATH
|
||||
```
|
||||
To try out inflection paradigms:
|
||||
```
|
||||
> i -path=alltenses:prelude -retain alltenses/ParadigmsGer.gfr
|
||||
> cc mkN "Farbe"
|
||||
```
|
||||
To try out overloaded syntax, test lexicon, and inflection paradigms:
|
||||
```
|
||||
> i -path=alltenses:prelude -retain alltenses/TryGer.gfr
|
||||
> cc mkCl (mkNP this_QuantSg (mkN "Farbe")) (mkA "dunkel")
|
||||
```
|
||||
To look for a syntax tree in the overload API by parsing:
|
||||
```
|
||||
> i -path=alltenses:prelude alltenses/OverLangEng.gfc
|
||||
> p -cat=S -overload "this grammar is too big"
|
||||
```
|
||||
To view linearizations in all languages by parsing from English:
|
||||
```
|
||||
> i alltenses/langs.gfcm
|
||||
> p -cat=S -lang=LangEng "this grammar is too big" | tb
|
||||
```
|
||||
|
||||
51
lib/resource/doc/synopsis-example.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
The standard way of building an application has the following modules.
|
||||
|
||||
An abstract syntax:
|
||||
```
|
||||
abstract Music = {
|
||||
cat
|
||||
Kind,
|
||||
Property ;
|
||||
fun
|
||||
PropKind : Kind -> Property -> Kind ;
|
||||
Song : Kind ;
|
||||
American : Property ;
|
||||
}
|
||||
```
|
||||
A domain lexicon interface:
|
||||
```
|
||||
interface LexMusic = open Cat in {
|
||||
oper
|
||||
song_N : N ;
|
||||
american_A : A ;
|
||||
}
|
||||
```
|
||||
A functor on ``Syntax`` and the domain lexicon interface:
|
||||
```
|
||||
incomplete concrete MusicI of Music = open Syntax, MusicLex in {
|
||||
lincat
|
||||
Kind = CN ;
|
||||
Property = AP ;
|
||||
lin
|
||||
PropKind k p = mkCN p k ;
|
||||
Song = mkCN song_N ;
|
||||
American = mkAP american_A ;
|
||||
}
|
||||
```
|
||||
For each language, an instance of the domain lexicon:
|
||||
```
|
||||
instance LexMusicGer of LexMusic = CatGer ** open ParadigmsGer in {
|
||||
oper
|
||||
song_N = mkN "Lied" "Lieder" neuter ;
|
||||
american_A = mkA "amerikanisch" ;
|
||||
}
|
||||
```
|
||||
For each language, an instantiation of the functor:
|
||||
```
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MusicGer of Music = MusicI with
|
||||
(Syntax = SyntaxGer),
|
||||
(LexMusic = LexMusicGer) ;
|
||||
```
|
||||
17
lib/resource/doc/synopsis-intro.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
This document contains the most important parts of the GF Resource Grammar API.
|
||||
It has been machine-generated from the source files; each chapter gives a link
|
||||
to the relevant source files, which give more information. Some of the files have
|
||||
not yet been prepared so that the machine generated documentation has the right format.
|
||||
|
||||
Since the character encoding is UTF-8 for Russian and Latin-1 for other languages, you
|
||||
may have to change the encoding preference of your browser when reading different
|
||||
parts of the document.
|
||||
|
||||
The second-last chapter gives instructions on how to "browse" the library by
|
||||
loading the grammars into the ``gf`` command editor.
|
||||
|
||||
The last chapter contains a brief example of how application grammars can
|
||||
import resource modules. At the same time, it illustrates a "design pattern" for
|
||||
using the resource API to build functor-based applications
|
||||
|
||||