mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-15 15:59:32 -06:00
Danish ordinals
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
--1 The category system
|
||||
|
||||
-- The category system is central to the library in the sense
|
||||
-- that the other modules ($Adjective$, $Adverb$, $Noun$, $Verb$ etc)
|
||||
-- communicate through it. This means that a e.g. a function using
|
||||
-- $NP$s in $Verb$ need not know how $NP$s are constructed in $Noun$:
|
||||
-- it is enough that both $Verb$ and $Noun$ use the same type $NP$,
|
||||
-- which is given here in $Cat$.
|
||||
--
|
||||
-- Some categories are inherited from [Common Common.html].
|
||||
-- The reason they are defined there is that they have the same
|
||||
-- implementation in all languages in the resource (typically,
|
||||
-- just a string). These categories are
|
||||
-- $AdA, AdN, AdV, Adv, Ant, CAdv, IAdv, PConj, Phr$,
|
||||
-- $Pol, SC, Tense, Text, Utt, Voc$.
|
||||
--
|
||||
-- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$
|
||||
-- are defined on $Conjunction$ and only used locally there.
|
||||
|
||||
|
||||
abstract Cat = Common ** {
|
||||
|
||||
@@ -84,7 +100,9 @@ abstract Cat = Common ** {
|
||||
|
||||
--2 Words of open classes
|
||||
|
||||
-- These are constructed in [Lexicon Lexicon.html] and in additional lexicon modules.
|
||||
-- These are constructed in [Lexicon Lexicon.html] and in
|
||||
-- additional lexicon modules.
|
||||
|
||||
V ; -- one-place verb e.g. "sleep"
|
||||
V2 ; -- two-place verb e.g. "love"
|
||||
V3 ; -- three-place verb e.g. "show"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
--1 Infrastructure with common implementations.
|
||||
|
||||
-- This module defines the categories that uniformly have the linearization
|
||||
-- ${s : Str}$ in all languages. They are given lock fields that guarantee
|
||||
-- grammatical correctness via type checking.
|
||||
-- ${s : Str}$ in all languages.
|
||||
|
||||
-- Moreover, this module defines the abstract parameters of tense, polarity, and
|
||||
-- anteriority, which are used in [Phrase Phrase.html] to generate different
|
||||
@@ -49,11 +48,11 @@ abstract Common = {
|
||||
Ant ; -- anteriority: simultaneous, anterior
|
||||
|
||||
fun
|
||||
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||
|
||||
TPres : Tense ;
|
||||
ASimul : Ant ;
|
||||
TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent
|
||||
AAnter : Ant ; -- I have slept --# notpresent
|
||||
TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent
|
||||
AAnter : Ant ; -- I have slept --# notpresent
|
||||
|
||||
}
|
||||
|
||||
@@ -141,11 +141,11 @@ oper
|
||||
|
||||
|
||||
mkTal : (x1,_,_,_,x5 : Str) -> LinDigit =
|
||||
\två, tolv, tjugo, andra, tolfte ->
|
||||
\två, tolv, tjugo, andra, tyvende ->
|
||||
{s = table {
|
||||
ental => cardOrd två andra ;
|
||||
ton => cardOrd tolv tolfte ;
|
||||
tiotal => cardReg tjugo
|
||||
ton => cardReg tolv ;
|
||||
tiotal => cardOrd tjugo tyvende
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,47 +1,55 @@
|
||||
concrete NumeralDan of Numeral = CatDan ** open ResScand, MorphoDan in {
|
||||
|
||||
|
||||
-- AR 12/10/2002 following www.geocities.com/tsca.geo/dansk/dknummer.html
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||
Sub100, Sub1000, Sub1000000 =
|
||||
{s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
lin num x = x ;
|
||||
|
||||
n2 = mkTal "to" "tolv" "tjue" "andre" "tolfte" ;
|
||||
n3 = mkTal "tre" "tretten" "tretti" "tredje" "trettende" ;
|
||||
n4 = mkTal "fire" "fjorten" "førti" "fjerde" "fjortende" ;
|
||||
n5 = mkTal "fem" "femten" "femti" "femte" "femtende" ;
|
||||
n6 = mkTal "seks" "seksten" "seksti" "sjette" "sextende" ;
|
||||
n7 = mkTal "sju" "sytten" "sytti" "syvende" "syttende" ;
|
||||
n8 = mkTal "åtte" "atten" "åtti" "åttende" "attende" ;
|
||||
n9 = mkTal "ni" "nitten" "nitti" "niende" "nittende" ;
|
||||
lin n2 = mkTal "to" "tolv" "tyve" "anden" "tyvende" ;
|
||||
lin n3 = mkTal "tre" "tretten" "tredive" "tredje" "tredivte" ;
|
||||
lin n4 = mkTal "fire" "fjorten" "fyrre" "fjerde" "fyrretyvende" ;
|
||||
lin n5 = mkTal "fem" "femten" "halvtreds" "femte" "halvtredsindstyvende" ;
|
||||
lin n6 = mkTal "seks" "seksten" "tres" "sjette" "tredsindstyvende" ;
|
||||
lin n7 = mkTal "syv" "sytten" "halvfjerds" "syvende""halvfjerdsindstyvende" ;
|
||||
lin n8 = mkTal "otte" "atten" "firs" "ottende""firsindstyvende" ;
|
||||
lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ;
|
||||
|
||||
pot01 = {
|
||||
s = \\f => table {
|
||||
NCard g => case g of {Neutr => "ett" ; _ => "en"} ;
|
||||
NCard g => case g of {Neutr => "et" ; _ => "en"} ;
|
||||
_ => "første"
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ;
|
||||
pot110 = numPl (cardReg "ti") ;
|
||||
pot111 = numPl (cardOrd "elve" "elfte") ;
|
||||
pot111 = numPl (cardOrd "elleve" "elvte") ;
|
||||
pot1to19 d = numPl (d.s ! ton) ;
|
||||
pot0as1 n = {s = n.s ! ental ; n = n.n} ;
|
||||
pot1 d = numPl (d.s ! tiotal) ;
|
||||
pot1plus d e = {s = \\g => d.s ! tiotal ! invNum ++ e.s ! ental ! g ; n = Pl} ;
|
||||
|
||||
pot1plus d e = {
|
||||
s = \\g => e.s ! ental ! invNum ++ "og" ++ d.s ! tiotal ! g ; n = Pl} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d =
|
||||
numPl (\\g => d.s ! ental ! invNum ++ cardOrd "hundre" "hundrede" ! g) ;
|
||||
pot2 d = numPl (\\_ => d.s ! ental ! invNum ++ "hundrede") ;
|
||||
pot2plus d e =
|
||||
{s = \\g => d.s ! ental ! invNum ++ "hundre" ++ "og" ++ e.s ! g ; n = Pl} ;
|
||||
{s = \\g => d.s ! ental ! invNum ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ;
|
||||
pot2as3 n = n ;
|
||||
pot3 n =
|
||||
numPl (\\g => n.s ! invNum ++ cardOrd "tusen" "tusende" ! g) ;
|
||||
pot3plus n m =
|
||||
{s = \\g => n.s ! invNum ++ "tusen" ++ "og" ++ m.s ! g ; n = Pl} ;
|
||||
pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ;
|
||||
pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ;
|
||||
|
||||
}
|
||||
|
||||
{-
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||
Sub100, Sub1000, Sub1000000 =
|
||||
{s : CardOrd => Str ; n : Number} ;
|
||||
-}
|
||||
|
||||
@@ -19,15 +19,16 @@ yet been "officially" released. The release will be made in combination
|
||||
with a new version of GF itself, since the grammars use new features
|
||||
not available in GF 2.4.
|
||||
|
||||
V. 1.0 is not yet available for Russian and Danish: for them,
|
||||
we refer to [v. 0.9 ../../resource/].
|
||||
**New**. V. 1.0 is now (26 May) available Russian and Danish.
|
||||
But the modules still need some testing, especially the Danish
|
||||
lexicon (corrections welcome!).
|
||||
|
||||
|
||||
==Authors==
|
||||
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Janna Khegai (Russian modules, forthcoming),
|
||||
Janna Khegai (Russian modules),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalia (Spanish cardinals),
|
||||
Harald Hammarstrom (German morphology),
|
||||
@@ -45,11 +46,13 @@ Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Ali El Dada,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Saara Myllyntausta,
|
||||
Wanjiku Ng'ang'a,
|
||||
Jordi Saludes.
|
||||
|
||||
@@ -141,21 +144,24 @@ The documentation of the individual modules:
|
||||
|
||||
===The language-dependent APIs===
|
||||
|
||||
- [ParadigmsDan gfdoc/ParadigmsDan.html]: Danish lexical paradigms
|
||||
- [ParadigmsEng gfdoc/ParadigmsEng.html]: English lexical paradigms
|
||||
- [ParadigmsFin gfdoc/ParadigmsFin.html]: Finnish lexical paradigms
|
||||
- [ParadigmsFre gfdoc/ParadigmsFre.html]: French lexical paradigms
|
||||
- [ParadigmsIta gfdoc/ParadigmsIta.html]: Italian lexical paradigms
|
||||
- [ParadigmsGer gfdoc/ParadigmsGer.html]: German lexical paradigms
|
||||
- [ParadigmsNor gfdoc/ParadigmsNor.html]: Norwegian lexical paradigms
|
||||
- [ParadigmsRus gfdoc/ParadigmsRus.html]: Russian lexical paradigms
|
||||
- [ParadigmsSpa gfdoc/ParadigmsSpa.html]: Spanish lexical paradigms
|
||||
- [ParadigmsSwe gfdoc/ParadigmsSwe.html]: Swedish lexical paradigms
|
||||
|
||||
|
||||
|
||||
- [IrregDan gfdoc/IrregDan.gf]: Danish irregular verbs (very incomplete)
|
||||
- [IrregEng gfdoc/IrregEng.gf]: English irregular verbs
|
||||
- [IrregFre gfdoc/IrregFre.gf]: French irregular verbs
|
||||
% - [IrregGer gfdoc/IrregGer.gf]: German irregular verbs
|
||||
- [IrregNor gfdoc/IrregNor.gf]: Norwegian irregular verbs
|
||||
- [IrregNor gfdoc/IrregNor.gf]: Norwegian irregular verbs (very incomplete)
|
||||
- [IrregSwe gfdoc/IrregSwe.gf]: Swedish irregular verbs
|
||||
|
||||
|
||||
@@ -199,7 +205,8 @@ library. Use one (or several) of the following packages instead:
|
||||
- ``lib/alltenses`` the complete ground-API library with all forms
|
||||
- ``lib/present`` a pruned ground-API library with present tense only
|
||||
- ``lib/mathematical`` special-purpose API for mathematical applications
|
||||
- ``lib/multimodal`` special-purpose API for multimodal dialogue applications
|
||||
- ``lib/multimodal`` the complete ground-API with demonstratives for
|
||||
multimodal dialogue applications
|
||||
|
||||
|
||||
===Linking applications to libraries===
|
||||
@@ -210,9 +217,9 @@ Notice, however, that both special-purpose APIs share modules with
|
||||
|
||||
|
||||
It is advisable to use the bare package names in paths pointing to the
|
||||
libraries. Here is an example, from ``examples/tram``:
|
||||
libraries. Here is an example, from ``examples/dialogue/LightsEng.gf``:
|
||||
```
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
--# -path=.:alltenses:multimodal:prelude
|
||||
```
|
||||
To reach these directories from anywhere, set the environment variable
|
||||
``GF_LIB_PATH`` to point to the directory ``GF/lib/``. For instance,
|
||||
@@ -244,7 +251,7 @@ both ``alltenses/LangEng`` and ``present/LangEng`` - the latter being
|
||||
much faster than the former. The ``-mcfg`` flag (multiple context-free grammar)
|
||||
must be used:
|
||||
```
|
||||
p -lang=LangEng -mcfg "this man is old"
|
||||
p -lang=LangEng -mcfg -parser=topdown "this man is old"
|
||||
```
|
||||
Parsing with the ``-mcfg`` flag takes a few extra seconds the first time during
|
||||
each session, but gets faster at later runs.
|
||||
@@ -264,11 +271,11 @@ based on the Swadesh list of 200 words. It is useful for
|
||||
things like language training.
|
||||
|
||||
|
||||
===Tram===
|
||||
===Dialogue===
|
||||
|
||||
The [examples/tram ../../../examples/tram]
|
||||
grammar set implements the user grammar of a
|
||||
multimodal dialogue system concerning public transport.
|
||||
The [examples/dialogue ../../../examples/dialogue]
|
||||
grammar set implements the user grammars of some
|
||||
multimodal dialogue system.
|
||||
Its purpose is to serve as a prototype for applications in the
|
||||
TALK project.
|
||||
|
||||
@@ -286,7 +293,7 @@ grammar writing.
|
||||
This bugs should be fixed before the final release of v. 1.0.
|
||||
|
||||
Danish
|
||||
- API 1.0 not implemented
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
English
|
||||
@@ -294,8 +301,7 @@ English
|
||||
|
||||
|
||||
Finnish
|
||||
- no possessive suffixes
|
||||
- wrong cases in passive constructions
|
||||
- wrong cases in some passive constructions
|
||||
|
||||
|
||||
French
|
||||
@@ -312,11 +318,12 @@ Italian
|
||||
|
||||
|
||||
Norwegian
|
||||
- word order in compound verbs sometimes wrong
|
||||
- the lexicon and chosen inflections are only partially verified
|
||||
|
||||
|
||||
Russian
|
||||
- API 1.0 not implemented
|
||||
- some functions missing
|
||||
- regular paradigms are missing
|
||||
|
||||
|
||||
Spanish
|
||||
@@ -324,7 +331,7 @@ Spanish
|
||||
|
||||
|
||||
Swedish
|
||||
- word order in compound verbs sometimes wrong
|
||||
-
|
||||
|
||||
|
||||
|
||||
@@ -348,5 +355,6 @@ French, Italian, and Spanish.
|
||||
Slides showing how the method is used.
|
||||
|
||||
[Multimodal Resource Grammars http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf].
|
||||
Slides showing how to use the multimodal resource library.
|
||||
Slides showing how to use the multimodal resource library. N.B. the library
|
||||
examples are from ``multimodal/old``, which is a reduced-size API.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user