mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
doc for next-lib; adjustments in summerschool-flyer
This commit is contained in:
Binary file not shown.
@@ -3,8 +3,11 @@
|
||||
\pagestyle{empty}
|
||||
\usepackage[urlcolor=blue,colorlinks=true]{hyperref}
|
||||
|
||||
\setlength{\parindent}{0mm}
|
||||
\setlength{\parskip}{2mm}
|
||||
|
||||
\setlength{\oddsidemargin}{0mm}
|
||||
\setlength{\evensidemargin}{-2mm}
|
||||
\setlength{\evensidemargin}{0mm}
|
||||
\setlength{\topmargin}{-12mm}
|
||||
\setlength{\textheight}{240mm}
|
||||
\setlength{\textwidth}{158mm}
|
||||
@@ -32,7 +35,7 @@ Gothenburg, 17-28 August 2009
|
||||
\newpage
|
||||
|
||||
\begin{itemize}
|
||||
\item Do you like programming?
|
||||
\item Do you like programming challenges?
|
||||
\item Are you interested in how your language really works?
|
||||
\item Would you like to try and build a computational grammar for your language,
|
||||
and make it available as a part of an international open-source
|
||||
@@ -42,44 +45,51 @@ Gothenburg, 17-28 August 2009
|
||||
Then you should consider attending the GF Resource Grammar Summer School
|
||||
in Gothenburg on 17-28 August 2009.
|
||||
|
||||
The GF Resource Grammar Library is an open-source computational grammar resource
|
||||
that currently covers 12 languages. The Summer School is a part of a
|
||||
collaborative effort to extend the library to all of the 23 official
|
||||
EU languages. Also other languages chosen by the participants are welcome.
|
||||
The GF Resource Grammar Library is an open-source computational grammar
|
||||
resource that currently covers 12 languages. It has been created in
|
||||
a collaborative effort using the GF (Grammatical Framework) grammar formalism.
|
||||
The Summer School aims to boost the extension of the library to new languages.
|
||||
|
||||
The missing EU languages are:
|
||||
Czech, Dutch, Estonian, Greek, Hungarian, Irish, Latvian, Lithuanian,
|
||||
Maltese, Portuguese, Slovak, and Slovenian. There is also more work to
|
||||
Particularly in focus are the missing 12 of the 23 official languages of the
|
||||
European Union: \textit{Czech, Dutch,
|
||||
Estonian, Greek, Hungarian, Irish, Latvian, Lithuanian,
|
||||
Maltese, Portuguese, Slovak, and Slovenian}. There is also more work to
|
||||
be done on Polish and Romanian.
|
||||
Any other languages chosen by the participants are also welcome.
|
||||
Good knowledge of the language is essential, but you don't need to be a
|
||||
native speaker.
|
||||
|
||||
The linguistic coverage of the library includes the inflectional morphology
|
||||
and basic syntax of each language. It can be used in GF applications
|
||||
and also ported to other formats. It can also be used for building other
|
||||
linguistic resources, such as morphological lexica and parsers.
|
||||
and basic syntax of each language. It can be used for parsing,
|
||||
generation, translation, multilingual web pages,
|
||||
speech recognition, dialogue systems, language teaching, morphological
|
||||
analysis, software localization, and lots of other things.
|
||||
Grammars written in GF can be converted to many different formats.
|
||||
The library is licensed under LGPL.
|
||||
|
||||
In the summer school, each language will be implemented by one or two students
|
||||
working together. A morphology implementation will be credited
|
||||
as a Chalmers course worth 7.5 ETCS points; adding a syntax implementation
|
||||
as a Chalmers University
|
||||
course worth 7.5 ETCS points; adding a syntax implementation
|
||||
will be worth more. The estimated total work load is 1-2 months for the
|
||||
morphology, and 3-6 months for the whole grammar.
|
||||
|
||||
Participation in the summer school is free.
|
||||
Registration is done via the courses's Google group,
|
||||
Registration is via the courses's Google group,
|
||||
|
||||
\begin{verbatim}
|
||||
http://groups.google.com/group/gf-resource-school-2009/
|
||||
\end{verbatim}
|
||||
The registration deadline is 15 June 2009.
|
||||
The registration deadline is 15 June 2009. An on-line course on GF (recommended,
|
||||
but not compulsory) starts on 20 April.
|
||||
|
||||
Some travel grants will be available. They are distributed on the basis of a
|
||||
GF programming contest in April and May.
|
||||
GF programming contest in May.
|
||||
|
||||
For more information, see the Google Group above, as well as the
|
||||
Summer School web page,
|
||||
For more information, see the Google Group and the Summer School web page,
|
||||
|
||||
\begin{verbatim}
|
||||
http://digitalgrammars.com/gf/doc/gf-summerschool.html
|
||||
http://digitalgrammars.com/gf/summerschool.html
|
||||
\end{verbatim}
|
||||
|
||||
% LaTeX2e code generated by txt2tags 2.4 (http://txt2tags.sf.net)
|
||||
107
next-lib/doc/German.dot
Normal file
107
next-lib/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
next-lib/doc/German.png
Normal file
BIN
next-lib/doc/German.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
75
next-lib/doc/Grammar.dot
Normal file
75
next-lib/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
next-lib/doc/Grammar.png
Normal file
BIN
next-lib/doc/Grammar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
68
next-lib/doc/Lang.dot
Normal file
68
next-lib/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
next-lib/doc/Lang.png
Normal file
BIN
next-lib/doc/Lang.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
16
next-lib/doc/Makefile
Normal file
16
next-lib/doc/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
.PHONY: abstract synopsis
|
||||
|
||||
all: synopsis abstract
|
||||
|
||||
index:
|
||||
txt2tags -thtml index.txt
|
||||
synopsis:
|
||||
runghc MkSynopsis.hs
|
||||
|
||||
categories-imagemap.html: categories.dot
|
||||
dot -Tcmapx $^ > $@
|
||||
|
||||
abstract:
|
||||
gfdoc -txthtml ../src/abstract/*.gf
|
||||
mv ../src/abstract/*.html abstract
|
||||
|
||||
244
next-lib/doc/MkSynopsis.hs
Normal file
244
next-lib/doc/MkSynopsis.hs
Normal file
@@ -0,0 +1,244 @@
|
||||
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 "B. Bringert and A. 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 = takeWhile (/="--#") $ 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 itf (takeWhile (/='_') name) 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
|
||||
|
||||
srcPath = ("../src" ++)
|
||||
|
||||
synopsis = "synopsis.txt"
|
||||
commonAPI = srcPath "/abstract/Common.gf"
|
||||
catAPI = srcPath "/abstract/Cat.gf"
|
||||
syntaxAPI = srcPath "/api/Constructors.gf"
|
||||
structuralAPI = srcPath "/abstract/Structural.gf"
|
||||
paradigmFiles = [
|
||||
("Bulgarian", srcPath "/bulgarian/ParadigmsBul.gf"),
|
||||
("Catalan", srcPath "/catalan/ParadigmsCat.gf"),
|
||||
("Danish", srcPath "/danish/ParadigmsDan.gf"),
|
||||
("English", srcPath "/english/ParadigmsEng.gf"),
|
||||
("Finnish", srcPath "/finnish/ParadigmsFin.gf"),
|
||||
("French", srcPath "/french/ParadigmsFre.gf"),
|
||||
("German", srcPath "/german/ParadigmsGer.gf"),
|
||||
-- ("Interlingua", srcPath "/interlingua/ParadigmsIna.gf"),
|
||||
("Italian", srcPath "/italian/ParadigmsIta.gf"),
|
||||
("Norwegian", srcPath "/norwegian/ParadigmsNor.gf"),
|
||||
("Romanian", srcPath "/romanian/ParadigmsRon.gf"),
|
||||
("Russian", srcPath "/russian/ParadigmsRus.gf"),
|
||||
("Spanish", srcPath "/spanish/ParadigmsSpa.gf"),
|
||||
("Swedish", srcPath "/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)
|
||||
787
next-lib/doc/Resource-HOWTO.txt
Normal file
787
next-lib/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
next-lib/doc/Syntax.dot
Normal file
111
next-lib/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
next-lib/doc/Syntax.png
Normal file
BIN
next-lib/doc/Syntax.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
53
next-lib/doc/categories-imagemap.html
Normal file
53
next-lib/doc/categories-imagemap.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<map id="categories" name="categories">
|
||||
<area shape="poly" href="#Text" title="Text" alt="" coords="690,23 688,17 685,12 679,8 672,5 664,4 656,5 649,8 643,12 640,17 638,23 640,29 643,34 649,38 656,41 664,42 672,41 679,38 685,34 688,29"/>
|
||||
<area shape="poly" href="#Punct" title="Punct" alt="" coords="657,95 656,89 652,84 646,80 638,77 629,76 620,77 612,80 606,84 602,89 600,95 602,101 606,106 612,110 620,113 629,114 638,113 646,110 652,106 656,101"/>
|
||||
<area shape="poly" href="#Phr" title="Phr" alt="" coords="726,95 725,89 721,84 715,80 708,77 700,76 692,77 685,80 679,84 676,89 675,95 676,101 679,106 685,110 692,113 700,114 708,113 715,110 721,106 725,101"/>
|
||||
<area shape="poly" href="#PConj" title="PConj" alt="" coords="658,167 656,162 652,156 645,152 637,150 628,149 619,150 610,152 604,156 600,162 598,167 600,173 604,179 610,183 619,185 628,186 637,185 645,183 652,179 656,173"/>
|
||||
<area shape="poly" href="#Utt" title="Utt" alt="" coords="726,167 725,162 721,156 715,152 708,150 700,149 692,150 685,152 679,156 676,162 675,167 676,173 679,179 685,183 692,185 700,186 708,185 715,183 721,179 725,173"/>
|
||||
<area shape="poly" href="#Voc" title="Voc" alt="" coords="794,167 793,162 789,156 784,152 777,150 769,149 761,150 754,152 748,156 744,162 743,167 744,173 748,179 754,183 761,185 769,186 777,185 784,183 789,179 793,173"/>
|
||||
<area shape="poly" href="#Imp" title="Imp" alt="" coords="657,240 656,234 652,229 647,225 640,222 632,221 624,222 617,225 611,229 607,234 606,240 607,246 611,251 617,255 624,258 632,259 640,258 647,255 652,251 656,246"/>
|
||||
<area shape="poly" href="#S" title="S" alt="" coords="726,240 725,234 721,229 715,225 708,223 700,222 692,223 685,225 679,229 676,234 675,240 676,245 679,250 685,254 692,257 700,258 708,257 715,254 721,250 725,245"/>
|
||||
<area shape="poly" href="#QS" title="QS" alt="" coords="870,240 868,234 865,229 859,225 852,222 844,221 836,222 829,225 823,229 819,234 818,240 819,246 823,251 829,255 836,258 844,259 852,258 859,255 865,251 868,246"/>
|
||||
<area shape="poly" href="#Tense" title="Tense" alt="" coords="521,312 519,306 515,301 509,297 501,294 492,293 483,294 475,297 469,301 464,306 463,312 464,318 469,323 475,327 483,330 492,331 501,330 509,327 515,323 519,318"/>
|
||||
<area shape="poly" href="#Ant" title="Ant" alt="" coords="589,312 588,306 584,301 578,297 571,294 563,293 555,294 548,297 542,301 539,306 538,312 539,318 542,323 548,327 555,330 563,331 571,330 578,327 584,323 588,318"/>
|
||||
<area shape="poly" href="#Pol" title="Pol" alt="" coords="657,312 656,306 652,301 647,297 640,294 632,293 624,294 617,297 611,301 607,306 606,312 607,318 611,323 617,327 624,330 632,331 640,330 647,327 652,323 656,318"/>
|
||||
<area shape="poly" href="#Cl" title="Cl" alt="" coords="726,312 725,306 721,301 715,297 708,294 700,293 692,294 685,297 679,301 676,306 675,312 676,318 679,323 685,327 692,330 700,331 708,330 715,327 721,323 725,318"/>
|
||||
<area shape="poly" href="#ListS" title="ListS" alt="" coords="798,312 797,306 793,301 787,297 779,294 771,293 762,294 754,297 748,301 745,306 743,312 745,318 748,323 754,327 762,330 771,331 779,330 787,327 793,323 797,318"/>
|
||||
<area shape="poly" href="#Conj" title="Conj" alt="" coords="867,312 866,306 862,301 856,297 849,294 841,293 833,294 826,297 820,301 816,306 815,312 816,318 820,323 826,327 833,330 841,331 849,330 856,327 862,323 866,318"/>
|
||||
<area shape="poly" href="#QCl" title="QCl" alt="" coords="945,312 943,306 940,301 934,297 927,294 919,293 911,294 904,297 898,301 895,306 893,312 895,318 898,323 904,327 911,330 919,331 927,330 934,327 940,323 943,318"/>
|
||||
<area shape="poly" href="#NP" title="NP" alt="" coords="270,384 269,379 265,373 260,369 252,366 244,366 237,366 229,369 224,373 220,379 219,384 220,390 224,395 229,400 237,402 244,403 252,402 260,400 265,395 269,390"/>
|
||||
<area shape="poly" href="#VP" title="VP" alt="" coords="636,384 634,379 631,373 625,369 618,366 610,366 602,366 595,369 589,373 585,379 584,384 585,390 589,395 595,400 602,402 610,403 618,402 625,400 631,395 634,390"/>
|
||||
<area shape="rect" href="#Adv" title="Adv" alt="" coords="702,367,753,401"/>
|
||||
<area shape="poly" href="#Predet" title="Predet" alt="" coords="65,457 63,451 59,446 52,441 44,439 34,438 25,439 16,441 10,446 5,451 4,457 5,462 10,468 16,472 25,475 34,475 44,475 52,472 59,468 63,462"/>
|
||||
<area shape="poly" href="#Pron" title="Pron" alt="" coords="133,457 132,451 129,446 123,441 116,439 108,438 99,439 92,441 86,446 83,451 82,457 83,462 86,468 92,472 99,475 108,475 116,475 123,472 129,468 132,462"/>
|
||||
<area shape="rect" href="#PN" title="PN" alt="" coords="150,440,202,474"/>
|
||||
<area shape="poly" href="#Det" title="Det" alt="" coords="270,457 269,451 265,446 260,441 252,439 244,438 237,439 229,441 224,446 220,451 219,457 220,462 224,468 229,472 237,475 244,475 252,475 260,472 265,468 269,462"/>
|
||||
<area shape="poly" href="#CN" title="CN" alt="" coords="339,457 337,451 334,446 328,441 321,439 313,438 305,439 298,441 292,446 289,451 287,457 289,462 292,468 298,472 305,475 313,475 321,475 328,472 334,468 337,462"/>
|
||||
<area shape="poly" href="#ListNP" title="ListNP" alt="" coords="420,457 419,451 414,446 407,441 398,439 388,438 378,439 369,441 362,446 358,451 356,457 358,462 362,468 369,472 378,475 388,475 398,475 407,472 414,468 419,462"/>
|
||||
<area shape="poly" href="#AdV" title="AdV" alt="" coords="489,457 488,451 484,446 479,441 471,439 463,438 455,439 448,441 442,446 439,451 437,457 439,462 442,468 448,472 455,475 463,475 471,475 479,472 484,468 488,462"/>
|
||||
<area shape="rect" href="#V" title="V,V2,V3,V*,V2*" alt="" coords="506,440,616,474"/>
|
||||
<area shape="poly" href="#AP" title="AP" alt="" coords="685,457 684,451 680,446 674,441 667,439 659,438 651,439 644,441 639,446 635,451 634,457 635,462 639,468 644,472 651,475 659,475 667,475 674,472 680,468 684,462"/>
|
||||
<area shape="poly" href="#Subj" title="Subj" alt="" coords="753,457 752,451 749,446 743,441 736,439 728,438 720,439 713,441 707,446 703,451 702,457 703,462 707,468 713,472 720,475 728,475 736,475 743,472 749,468 752,462"/>
|
||||
<area shape="poly" href="#ListAdj" title="ListAdj" alt="" coords="837,457 836,451 831,446 824,441 814,439 804,438 794,439 784,441 777,446 772,451 770,457 772,462 777,468 784,472 794,475 804,475 814,475 824,472 831,468 836,462"/>
|
||||
<area shape="poly" href="#Art" title="Art" alt="" coords="90,529 89,523 85,518 80,514 73,511 65,510 57,511 50,514 44,518 40,523 39,529 40,535 44,540 50,544 57,547 65,548 73,547 80,544 85,540 89,535"/>
|
||||
<area shape="poly" href="#Quant" title="Quant" alt="" coords="166,529 165,523 161,518 154,514 146,511 137,510 128,511 120,514 113,518 109,523 108,529 109,535 113,540 120,544 128,547 137,548 146,547 154,544 161,540 165,535"/>
|
||||
<area shape="poly" href="#Num" title="Num" alt="" coords="237,529 235,523 232,518 226,514 218,511 210,510 202,511 195,514 189,518 185,523 184,529 185,535 189,540 195,544 202,547 210,548 218,547 226,544 232,540 235,535"/>
|
||||
<area shape="poly" href="#Ord" title="Ord" alt="" coords="305,529 304,523 300,518 295,514 288,511 280,510 272,511 265,514 259,518 255,523 254,529 255,535 259,540 265,544 272,547 280,548 288,547 295,544 300,540 304,535"/>
|
||||
<area shape="rect" href="#N" title="N,N2,N3" alt="" coords="323,512,387,546"/>
|
||||
<area shape="poly" href="#RS" title="RS" alt="" coords="456,529 454,523 451,518 445,514 438,511 430,510 422,511 415,514 409,518 406,523 404,529 406,535 409,540 415,544 422,547 430,548 438,547 445,544 451,540 454,535"/>
|
||||
<area shape="poly" href="#Card" title="Card" alt="" coords="236,601 235,595 231,590 226,586 218,583 210,582 202,583 195,586 189,590 186,595 184,601 186,607 189,612 195,616 202,619 210,620 218,619 226,616 231,612 235,607"/>
|
||||
<area shape="poly" href="#Numeral" title="Numeral,Digits" alt="" coords="216,674 214,668 206,662 194,658 179,656 162,655 145,656 130,658 118,662 110,668 107,674 110,679 118,685 130,689 145,691 162,692 179,691 194,689 206,685 214,679"/>
|
||||
<area shape="poly" href="#AdN" title="AdN" alt="" coords="285,674 283,668 280,662 274,658 267,656 259,655 251,656 244,658 238,662 234,668 233,674 234,679 238,685 244,689 251,691 259,692 267,691 274,689 280,685 283,679"/>
|
||||
<area shape="poly" href="#CAdv" title="CAdv" alt="" coords="288,746 286,740 282,735 276,731 268,728 259,727 250,728 242,731 235,735 231,740 230,746 231,752 235,757 242,761 250,764 259,765 268,764 276,761 282,757 286,752"/>
|
||||
<area shape="poly" href="#RCl" title="RCl" alt="" coords="456,601 454,595 451,590 445,586 438,583 430,582 422,583 415,586 409,590 406,595 404,601 406,607 409,612 415,616 422,619 430,620 438,619 445,616 451,612 454,607"/>
|
||||
<area shape="poly" href="#AdA" title="AdA" alt="" coords="617,529 615,523 612,518 606,514 599,511 591,510 583,511 576,514 570,518 566,523 565,529 566,535 570,540 576,544 583,547 591,548 599,547 606,544 612,540 615,535"/>
|
||||
<area shape="rect" href="#A" title="A, A2" alt="" coords="634,512,685,546"/>
|
||||
<area shape="poly" href="#ListAP" title="ListAP" alt="" coords="767,529 765,523 760,518 753,514 744,511 734,510 725,511 716,514 708,518 704,523 702,529 704,535 708,540 716,544 725,547 734,548 744,547 753,544 760,540 765,535"/>
|
||||
<area shape="poly" href="#IP" title="IP" alt="" coords="895,384 894,379 890,373 885,369 877,366 870,366 862,366 854,369 849,373 845,379 844,384 845,390 849,395 854,400 862,402 870,403 877,402 885,400 890,395 894,390"/>
|
||||
<area shape="poly" href="#IAdv" title="IAdv" alt="" coords="966,384 965,379 961,373 955,369 947,366 939,366 931,366 923,369 917,373 913,379 912,384 913,390 917,395 923,400 931,402 939,403 947,402 955,400 961,395 965,390"/>
|
||||
<area shape="poly" href="#ClSlash" title="ClSlash" alt="" coords="1050,384 1048,379 1043,373 1036,369 1026,366 1016,366 1006,366 996,369 989,373 984,379 982,384 984,390 989,395 996,400 1006,402 1016,403 1026,402 1036,400 1043,395 1048,390"/>
|
||||
<area shape="poly" href="#IDet" title="IDet" alt="" coords="906,457 904,451 901,446 895,441 888,439 880,438 872,439 865,441 859,446 856,451 854,457 856,462 859,468 865,472 872,475 880,475 888,475 895,472 901,468 904,462"/>
|
||||
<area shape="poly" href="#VPSlash" title="VPSlash" alt="" coords="1052,457 1050,451 1045,446 1037,441 1027,439 1016,438 1005,439 995,441 987,446 982,451 980,457 982,462 987,468 995,472 1005,475 1016,475 1027,475 1037,472 1045,468 1050,462"/>
|
||||
<area shape="poly" href="#IQuant" title="IQuant" alt="" coords="912,529 910,523 906,518 899,514 890,511 880,510 870,511 861,514 854,518 850,523 848,529 850,535 854,540 861,544 870,547 880,548 890,547 899,544 906,540 910,535"/>
|
||||
<area shape="poly" href="#RP" title="RP" alt="" coords="456,674 454,668 451,662 445,658 438,656 430,655 422,656 415,658 409,662 406,668 404,674 406,679 409,685 415,689 422,691 430,692 438,691 445,689 451,685 454,679"/>
|
||||
</map>
|
||||
19
next-lib/doc/categories-intro.txt
Normal file
19
next-lib/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.
|
||||
|
||||
|
||||
149
next-lib/doc/categories.dot
Normal file
149
next-lib/doc/categories.dot
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
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", 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 -> Art [style = "solid"];
|
||||
Det -> Quant [style = "solid"];
|
||||
Det -> Num [style = "solid"];
|
||||
Det -> Ord [style = "solid"];
|
||||
|
||||
|
||||
Art [label = "Art", style = "solid", shape = "ellipse"];
|
||||
Quant [label = "Quant", style = "solid", shape = "ellipse"];
|
||||
|
||||
|
||||
Num [style = "solid", shape = "ellipse"];
|
||||
Num -> Card [style = "solid"];
|
||||
|
||||
Card [style = "solid", shape = "ellipse"];
|
||||
Card -> Numerals [style = "solid"];
|
||||
Card -> AdN [style = "solid"];
|
||||
|
||||
AdN [style = "solid", shape = "ellipse"];
|
||||
AdN -> CAdv [style = "solid"];
|
||||
|
||||
Numerals [label = "Numeral,Digits", 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,V*,V2*", 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 -> ClSlash [style = "solid"];
|
||||
|
||||
IP [style = "solid", shape = "ellipse"];
|
||||
IP -> IDet [style = "solid"];
|
||||
|
||||
IDet [style = "solid", shape = "ellipse"];
|
||||
IDet -> IQuant [style = "solid"];
|
||||
|
||||
IQuant [style = "solid", shape = "ellipse"];
|
||||
|
||||
IAdv [style = "solid", shape = "ellipse"];
|
||||
|
||||
ClSlash [style = "solid", shape = "ellipse"];
|
||||
ClSlash -> VPSlash [style = "solid"];
|
||||
|
||||
VPSlash [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
next-lib/doc/categories.png
Normal file
BIN
next-lib/doc/categories.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
BIN
next-lib/doc/editor.png
Normal file
BIN
next-lib/doc/editor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
267
next-lib/doc/index.txt
Normal file
267
next-lib/doc/index.txt
Normal file
@@ -0,0 +1,267 @@
|
||||
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 December 2007: Browsing the library by syntax editor
|
||||
[directly on the web ../../../demos/resource-api/editor.html].
|
||||
|
||||
|
||||
|
||||
|
||||
==Authors==
|
||||
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Ali El Dada (Arabic modules),
|
||||
Magda Gerritsen and Ulrich Real (Russian paradigms and lexicon),
|
||||
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.
|
||||
|
||||
581
next-lib/doc/official.txt
Normal file
581
next-lib/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"
|
||||
48
next-lib/doc/paradigms.txt
Normal file
48
next-lib/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 ;
|
||||
```
|
||||
34
next-lib/doc/synopsis-browse.txt
Normal file
34
next-lib/doc/synopsis-browse.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
|
||||
|
||||
=Browsing the libraries with GF commands=
|
||||
|
||||
**New**: Browsing by syntax editor
|
||||
[directly on the web ../../../demos/resource-api/editor.html].
|
||||
|
||||
All of the following assume
|
||||
```
|
||||
cd $GF_LIB_PATH
|
||||
```
|
||||
To try out inflection paradigms:
|
||||
```
|
||||
> i -path=alltenses -retain alltenses/ParadigmsGer.gfo
|
||||
> cc mkN "Farbe"
|
||||
```
|
||||
To try out overloaded syntax, test lexicon, and inflection paradigms:
|
||||
```
|
||||
> i -path=alltenses -retain alltenses/TryGer.gfo
|
||||
> cc mkCl (mkNP this_Quant (mkN "Farbe")) (mkA "dunkel")
|
||||
```
|
||||
% To look for a syntax tree in the overload API by parsing:
|
||||
% ```
|
||||
% > i -path=alltenses alltenses/OverLangEng.gf
|
||||
% > 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
next-lib/doc/synopsis-example.txt
Normal file
51
next-lib/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) ;
|
||||
```
|
||||
26
next-lib/doc/synopsis-intro.txt
Normal file
26
next-lib/doc/synopsis-intro.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
|
||||
=Introduction=
|
||||
|
||||
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.
|
||||
|
||||
**New**: Browsing by syntax editor
|
||||
[directly on the web ../../../demos/resource-api/editor.html].
|
||||
|
||||
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
|
||||
|
||||
6693
next-lib/doc/synopsis.html
Normal file
6693
next-lib/doc/synopsis.html
Normal file
File diff suppressed because it is too large
Load Diff
1703
next-lib/doc/synopsis.txt
Normal file
1703
next-lib/doc/synopsis.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TryBul = SyntaxBul, LexiconBul, ParadigmsBul - [mkAdv] **
|
||||
open (P = ParadigmsBul), in {
|
||||
open (P = ParadigmsBul) in {
|
||||
|
||||
oper
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TryCat = SyntaxCat, LexiconCat, ParadigmsCat - [mkAdv] **
|
||||
open (P = ParadigmsCat), in {
|
||||
open (P = ParadigmsCat) in {
|
||||
|
||||
oper
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TryEng = SyntaxEng-[mkAdN], LexiconEng, ParadigmsEng - [mkAdv,mkAdN,mkOrd] **
|
||||
open (P = ParadigmsEng), in {
|
||||
open (P = ParadigmsEng) in {
|
||||
|
||||
oper
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TrySwe = SyntaxSwe, LexiconSwe, ParadigmsSwe - [mkAdv] **
|
||||
open (P = ParadigmsSwe), in {
|
||||
open (P = ParadigmsSwe) in {
|
||||
|
||||
oper
|
||||
|
||||
@@ -9,4 +9,4 @@ oper
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ lin
|
||||
Sg => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g
|
||||
} ;
|
||||
s2 = "-là"
|
||||
s2 = [] ---- "-là"
|
||||
} ;
|
||||
|
||||
---b that_NP = makeNP ["cela"] Masc Sg ;
|
||||
@@ -119,7 +119,7 @@ lin
|
||||
Sg => \\g,c => prepCase c ++ genForms "celui-ci" "celle-ci" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "celui-ci" "celle-ci" ! g
|
||||
} ;
|
||||
s2 = "-ci"
|
||||
s2 = [] ---- "-ci"
|
||||
} ;
|
||||
|
||||
---b this_NP = pn2np (mkPN ["ceci"] Masc) ;
|
||||
|
||||
Reference in New Issue
Block a user