forked from GitHub/gf-core
synopsis with better intro and Urdu improvements
This commit is contained in:
@@ -1,33 +1,54 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
=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
|
||||
The GF Resource Grammar Library is the standard library for Grammatical Framework.
|
||||
It covers the morphology and basic syntax of currently 16 languages.
|
||||
|
||||
This document contains the most important parts of the GF Resource Grammar API,
|
||||
as needed by a GF application programmer.
|
||||
It has been machine-generated from the source files; there are links
|
||||
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 nicest
|
||||
possible format.
|
||||
|
||||
The current status of resource grammar completion for different languages is shown
|
||||
in [``status.html`` ./status.html].
|
||||
|
||||
The [first chapter #toc2] shows the categories, with links to the functions for
|
||||
The main contents are:
|
||||
- [Chapter 1 #toc2]: categories, with links to the functions for
|
||||
constructing trees in them.
|
||||
- [Chapter 2 #toc5]: syntactic construction functions, with cross-links and
|
||||
examples.
|
||||
- [Chapter 3 #toc83]: morphological paradigms.
|
||||
- [Chapter 4 #toc100]: how to "browse" the library by
|
||||
loading the grammars into the ``gf`` command editor.
|
||||
- [Chapter 5 #toc101]: a brief example of how application grammars can
|
||||
use the resource modules.
|
||||
- [Detailed table of contents #toc102].
|
||||
|
||||
The [second chapter #toc5] shows the construction functions, with cross-links and
|
||||
examples. Most examples can be seen in multiple languages by hovering the
|
||||
|
||||
Many examples in [Chapter 2 #toc5] can be seen in multiple languages by hovering the
|
||||
mouse over the example, as shown in the following screenshot:
|
||||
|
||||
[hovering.png]
|
||||
|
||||
The [third chapter #toc83] shows morphological paradigms.
|
||||
Other relevant documents:
|
||||
- [``status.html`` ./status.html]: the current status of different languages
|
||||
and the authors of each grammar
|
||||
- [Resource Grammar Tutorial http://www.grammaticalframework.org/doc/gf-lrec-2010.pdf]
|
||||
as presented in LREC-2010.
|
||||
- Paper "The GF Resource Grammar Library" by A. Ranta
|
||||
(//Linguistic Issues in Language Technology//, 2 (2), 2009). An overview of
|
||||
the library with linguistic motivations.
|
||||
[PDF http://elanguage.net/journals/index.php/lilt/article/viewFile/214/158]
|
||||
- Paper "Grammars as Software Libraries" by A. Ranta
|
||||
(In Y. Bertot, G. Huet, J-J. Lévy, and G. Plotkin (eds.),
|
||||
//From Semantics to Computer Science//, Cambridge University Press,
|
||||
Cambridge, pp. 281--308, 2009).
|
||||
The library from a software engineering point of view.
|
||||
[PDF http://www.cse.chalmers.se/~aarne/old/articles/libraries-kahn.pdf]
|
||||
|
||||
The [fourth chapter #toc100] gives instructions on how to "browse" the library by
|
||||
loading the grammars into the ``gf`` command editor.
|
||||
|
||||
The [last chapter #toc101] 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
|
||||
|
||||
The [table of contents #toc102] is at the end of the file.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,14 +49,20 @@ oper
|
||||
|
||||
|
||||
-- Proper names
|
||||
mkPN : Str -> PN = \s -> let n = regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||
personalPN : Str -> Str -> Str -> Str -> Number -> Gender -> UPerson -> Pron = \s1,s2,s3,sp,nn,g,p -> let n = mkPron s1 s2 s3 in {s = n.s ; a = toAgr nn p g ; ps = sp ; lock_Pron = <>};
|
||||
demoPN : Str -> Str -> Str -> Quant = \s1,s2,s3 -> let n = makeDemonPronForm s1 s2 s3 in {s = n.s ; a = defaultAgr ; lock_Quant = <>};
|
||||
mkDet : Str -> Str -> Str -> Str -> Number -> Det = \s1,s2,s3,s4,nb -> let dt = makeDet s1 s2 s3 s4 nb in {s = dt.s ; n = nb ; lock_Det = <>};
|
||||
mkIP : (x1,x2,x3:Str) -> Number -> Gender -> IP = \s1,s2,s3,n,g -> let p = mkIntPronForm s1 s2 s3 in { s = p.s ; n = n ; g = g ; lock_IP = <>};
|
||||
mkPN : Str -> PN = \s -> let n
|
||||
= regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ;
|
||||
personalPN : Str -> Str -> Str -> Str -> Number -> Gender -> UPerson -> Pron
|
||||
= \s1,s2,s3,sp,nn,g,p -> let n = mkPron s1 s2 s3 in {s = n.s ; a = toAgr nn p g ; ps = sp ; lock_Pron = <>};
|
||||
demoPN : Str -> Str -> Str -> Quant
|
||||
= \s1,s2,s3 -> let n = makeDemonPronForm s1 s2 s3 in {s = n.s ; a = defaultAgr ; lock_Quant = <>};
|
||||
mkDet : Str -> Str -> Str -> Str -> Number -> Det
|
||||
= \s1,s2,s3,s4,nb -> let dt = makeDet s1 s2 s3 s4 nb in {s = dt.s ; n = nb ; lock_Det = <>};
|
||||
mkIP : (x1,x2,x3:Str) -> Number -> Gender -> IP
|
||||
= \s1,s2,s3,n,g -> let p = mkIntPronForm s1 s2 s3 in { s = p.s ; n = n ; g = g ; lock_IP = <>};
|
||||
|
||||
-- AdN
|
||||
mkAdN : Str -> AdN = \s -> {s = s ; p = False ; lock_AdN = <>} ;
|
||||
mkAdN : Str -> AdN
|
||||
= \s -> {s = s ; p = False ; lock_AdN = <>} ;
|
||||
--2 Adjectives
|
||||
|
||||
mkA = overload {
|
||||
@@ -81,7 +87,7 @@ oper
|
||||
mkV2 : V -> Str -> V2 -- e.g bnd krna
|
||||
= \v,p -> v ** {c2 = {s = p ; c = VTrans} ; lock_V2 = <>} ;
|
||||
} ;
|
||||
dirV2 : V -> V2 = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ;
|
||||
dirV2 : V -> V2 = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; --%
|
||||
|
||||
mkV3 : V -> Str -> Str -> V3; -- e.g bycna
|
||||
mkV3 v p q = v ** { c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
@@ -119,7 +125,7 @@ oper
|
||||
-- mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ;a = p.a ; lock_Quant = <>};
|
||||
-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier;
|
||||
-- } ;
|
||||
mkIQuant : Str -> IQuant = \s -> makeIQuant s ;
|
||||
mkIQuant : Str -> IQuant = \s -> makeIQuant s ; --%
|
||||
|
||||
|
||||
--2 Conjunctions
|
||||
@@ -130,21 +136,21 @@ oper
|
||||
mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument)
|
||||
} ;
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ;
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ; --%
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; --%
|
||||
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ; --%
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ; --%
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> --%
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
|
||||
-- mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS; -- e.g drna
|
||||
mkVS v = v ;
|
||||
-- mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV = -- e.g cahna
|
||||
\v -> lin VV (v ** {isAux = False});
|
||||
mkVV : V -> VV -- e.g cahna
|
||||
= \v -> lin VV (v ** {isAux = False});
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
-- mkAdv x = lin Adv (ss x) ;
|
||||
|
||||
Reference in New Issue
Block a user