mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 16:42:51 -06:00
structure document for 1.0
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
--1 A Basic Lexicon
|
||||
|
||||
-- This files gives a list of words whose purpose is to test the GF
|
||||
-- resource grammar. It covers all lexical categories of [Cat Cat.html].
|
||||
-- By containing some of the most common words,
|
||||
-- it is aimed to cover, with high probability, all morphological
|
||||
-- patterns in the different languages.
|
||||
|
||||
-- Using this lexicon for translation is not recommended. The linearizations
|
||||
-- of the words in different languages are not guaranteed to be translation
|
||||
-- equivalents.
|
||||
|
||||
abstract Basic = Cat ** {
|
||||
fun
|
||||
add_V3 : V3 ;
|
||||
@@ -129,6 +141,7 @@ abstract Basic = Cat ** {
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
paris_PN : PN ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
planet_N : N ;
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
-- - distributed conjunction: both X,...,X and X
|
||||
--
|
||||
--
|
||||
-- *Note*. This module uses right-recursive lists. If backward
|
||||
-- compatibility with API 0.9 is needed, use
|
||||
-- [SeqConjunction SeqConjunction.html].
|
||||
|
||||
abstract Conjunction = Cat ** {
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
--1 The Main Module of the Resource Grammar
|
||||
|
||||
-- This grammar is just a collection of the different modules,
|
||||
-- and the one that can be imported when one wants to test the
|
||||
-- grammar. A smaller top module is [Test Test.html].
|
||||
|
||||
abstract Lang =
|
||||
Noun,
|
||||
Verb,
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
--1 Test lexicon
|
||||
|
||||
-- This lexicon is used when developing a grammar, and called by
|
||||
-- [Test Test.html]. The full lexicon is divided between
|
||||
-- [Structural Structural.html], [Basic Basic.html], and [Numeral Numeral.html].
|
||||
|
||||
abstract Lex = Cat ** {
|
||||
|
||||
-- Words of open classes
|
||||
|
||||
fun
|
||||
walk_V : V ;
|
||||
help_V2 : V2 ;
|
||||
@@ -15,7 +23,7 @@ abstract Lex = Cat ** {
|
||||
warm_A : A ;
|
||||
close_A2 : A2 ;
|
||||
|
||||
-- structural
|
||||
-- Structural words
|
||||
|
||||
|
||||
only_Predet, all_Predet : Predet ;
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
--1 Symbolic expressions
|
||||
|
||||
-- *Note*. This module is not automatically included in the main
|
||||
-- grammar [Lang Lang.html].
|
||||
|
||||
abstract Math = Cat ** {
|
||||
|
||||
--3 Noun phrases with symbols
|
||||
--2 Noun phrases with symbols
|
||||
|
||||
fun
|
||||
|
||||
SymbPN : Symb -> PN ; -- "x"
|
||||
IntPN : Int -> PN ; -- "27"
|
||||
CNIntNP : CN -> Int -> NP ; -- "level 53"
|
||||
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- "(the) (2) numbers x and y"
|
||||
SymbPN : Symb -> PN ; -- x
|
||||
IntPN : Int -> PN ; -- 27
|
||||
CNIntNP : CN -> Int -> NP ; -- level 53
|
||||
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||
|
||||
--3 Symbol lists
|
||||
--2 Symbol lists
|
||||
|
||||
-- A symbol list has at least two elements. The last two are separated
|
||||
-- by a conjunction ("and" in English), the others by commas.
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
--1 Conjunctions of left-recursive lists
|
||||
|
||||
abstract SeqConjunction = Cat ** {
|
||||
|
||||
-- This module is for backward compatibility with API 0.9.
|
||||
-- To be used instead of Conjunction.
|
||||
-- To be used instead of [Conjunction Conjunction.html].
|
||||
|
||||
fun
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
--1 Tense, Polarity, and Anteriority
|
||||
|
||||
-- This module defines the abstract parameters of tense, polarity, and
|
||||
-- anteriority, which are used in [Tensed Tensed.html] to generate different
|
||||
-- forms of sentences. Together they give 2 x 4 x 4 = 16 sentence forms.
|
||||
|
||||
-- These tenses are defined for all languages in the library. More tenses
|
||||
-- can be defined in the language extensions, e.g. the "passé simple" of
|
||||
-- Romance languages.
|
||||
|
||||
abstract Tense = {
|
||||
|
||||
cat
|
||||
@@ -6,8 +16,8 @@ abstract Tense = {
|
||||
Ant ;
|
||||
|
||||
fun
|
||||
PPos, PNeg : Pol ;
|
||||
TPres, TPast, TFut, TCond : Tense ;
|
||||
ASimul, AAnter : Ant ;
|
||||
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||
TPres, TPast, TFut, TCond : Tense ; -- I sleep/slept/will sleep/would sleep
|
||||
ASimul, AAnter : Ant ; -- I sleep/have slept
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
--1 Tensed forms of sentences, questions, and relative clauses
|
||||
|
||||
-- This module defines the 2 x 4 x 4 = 16 forms generated by different
|
||||
-- combinations of tense, polarity, and
|
||||
-- anteriority, which are defined in [Tense Tense.html].
|
||||
-- A variant with just the polarity variation is given in
|
||||
-- [Untensed Untensed.html].
|
||||
|
||||
abstract Tensed = Cat, Tense ** {
|
||||
|
||||
fun
|
||||
@@ -5,4 +13,24 @@ abstract Tensed = Cat, Tense ** {
|
||||
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
|
||||
UseRCl : Tense -> Ant -> Pol -> RCl -> RS ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-- Examples for English $S$:
|
||||
{-
|
||||
Pres Simul Pos ODir : he sleeps
|
||||
Pres Simul Neg ODir : he doesn't sleep
|
||||
Pres Anter Pos ODir : he has slept
|
||||
Pres Anter Neg ODir : he hasn't slept
|
||||
Past Simul Pos ODir : he slept
|
||||
Past Simul Neg ODir : he didn't sleep
|
||||
Past Anter Pos ODir : he had slept
|
||||
Past Anter Neg ODir : he hadn't slept
|
||||
Fut Simul Pos ODir : he will sleep
|
||||
Fut Simul Neg ODir : he won't sleep
|
||||
Fut Anter Pos ODir : he will have slept
|
||||
Fut Anter Neg ODir : he won't have slept
|
||||
Cond Simul Pos ODir : he would sleep
|
||||
Cond Simul Neg ODir : he wouldn't sleep
|
||||
Cond Anter Pos ODir : he would have slept
|
||||
Cond Anter Neg ODir : he wouldn't have slept
|
||||
-}
|
||||
@@ -1,9 +1,17 @@
|
||||
--1 The Reduced Top Module of the Resource Grammar
|
||||
|
||||
-- This grammar is just a collection of the different modules,
|
||||
-- and one that can be imported when one wants to test a reduced version
|
||||
-- of the grammar. The complete top module is [Lang Lang.html].
|
||||
|
||||
-- The main constructs missing are tenses of sentences, numerals, and
|
||||
-- comprehensive lexicon.
|
||||
|
||||
abstract Test =
|
||||
Noun,
|
||||
Verb,
|
||||
Adjective,
|
||||
Adverb,
|
||||
-- Numeral,
|
||||
Sentence,
|
||||
Question,
|
||||
Relative,
|
||||
@@ -11,5 +19,8 @@ abstract Test =
|
||||
Phrase,
|
||||
Untensed,
|
||||
-- Tensed,
|
||||
-- Structural,
|
||||
-- Basic,
|
||||
-- Numeral,
|
||||
Lex
|
||||
** {} ;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
--1 Untensed forms of sentences, questions, and relative clauses
|
||||
|
||||
-- This module defines just positive and negative present tense forms.
|
||||
-- Am alternative with full variation in polarity, tense, and anteriority is
|
||||
-- given in [Untensed Untensed.html].
|
||||
|
||||
abstract Untensed = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
Reference in New Issue
Block a user