restricted functor example

This commit is contained in:
aarne
2007-06-19 19:35:04 +00:00
parent 780276850c
commit badae80454
3 changed files with 20 additions and 22 deletions

View File

@@ -14,8 +14,6 @@ Changes in functionality since May 17, 2005, release of GF Version 2.2
<p>
<hr>
19/6 (AR)
Extended the functor syntax (<tt>with</tt> modules) so that the functor can have
restricted import and a module body (whose function is normally to complete restricted
@@ -49,6 +47,10 @@ multiplicative, which was nor usable. But now variants should work for any type.
<p>
<hr>
<p>
22/12 (AR) <b>Release of GF version 2.7</b>.
<p>

View File

@@ -256,8 +256,20 @@ MusicI are not satisfactory for some language. The resource grammar guarantees
that the linearizations are possible in all languages, in the sense of grammatical,
but they might of course be inadequate for stylistic reasons. Assume,
for the sake of argument, that adjectival modification does not sound good in
English, but that a relative clause would be preferrable. One can then start as
before,
English, but that a relative clause would be preferrable. One can then use
restricted inheritance of the functor:
```
concrete MusicEng of Music =
MusicI - [PropKind]
with
(Syntax = SyntaxEng),
(MusicLex = MusicLexEng) **
open SyntaxEng in {
lin
PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ;
}
```
The lexicon is as expected:
```
concrete MusicLexEng of MusicLex =
CatEng ** open ParadigmsEng in {
@@ -265,22 +277,6 @@ before,
song_N = mkN "song" ;
american_A = mkA "American" ;
}
concrete MusicEng0 of Music = MusicI with
(Syntax = SyntaxEng),
(MusicLex = MusicLexEng) ;
```
The module ``MusicEng0`` would not be used on the top level, however, but
another module would be built on top of it, with a restricted import from
``MusicEng0``. ``MusicEng`` inherits everything from ``MusicEng0``
except ``PropKind``, and
gives its own definition of this function:
```
concrete MusicEng of Music = MusicEng0 - [PropKind] **
open SyntaxEng in {
lin
PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ;
}
```

View File

@@ -1,7 +1,7 @@
concrete MusicLexFin of MusicLex =
CatFin ** open ParadigmsFin in {
lin
song_N = regN "kappale" ; ---- mkN
american_A = regA "amerikkalainen" ; ---- mkA
song_N = mkN "kappale" ;
american_A = mkA "amerikkalainen" ;
}