mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
resource = resource-1.0
This commit is contained in:
@@ -1,195 +0,0 @@
|
||||
airplane_N
|
||||
answer_V2S
|
||||
apartment_N
|
||||
apple_N
|
||||
art_N
|
||||
ask_V2Q
|
||||
baby_N
|
||||
bad_ADeg
|
||||
bank_N
|
||||
beautiful_ADeg
|
||||
become_VA
|
||||
beer_N
|
||||
beg_VV
|
||||
be_V
|
||||
big_ADeg
|
||||
bike_N
|
||||
bird_N
|
||||
black_ADeg
|
||||
blue_ADeg
|
||||
boat_N
|
||||
book_N
|
||||
boot_N
|
||||
boss_N
|
||||
boy_N
|
||||
bread_N
|
||||
break_V2
|
||||
broad_ADeg
|
||||
brother_N2
|
||||
brown_ADeg
|
||||
butter_N
|
||||
buy_V2
|
||||
camera_N
|
||||
cap_N
|
||||
car_N
|
||||
carpet_N
|
||||
cat_N
|
||||
ceiling_N
|
||||
chair_N
|
||||
cheese_N
|
||||
child_N
|
||||
church_N
|
||||
city_N
|
||||
clean_ADeg
|
||||
clever_ADeg
|
||||
close_V2
|
||||
coat_N
|
||||
cold_ADeg
|
||||
come_V
|
||||
computer_N
|
||||
country_N
|
||||
cousin_N
|
||||
cow_N
|
||||
die_V
|
||||
dirty_ADeg
|
||||
doctor_N
|
||||
dog_N
|
||||
door_N
|
||||
drink_V2
|
||||
eat_V2
|
||||
enemy_N
|
||||
factory_N
|
||||
father_N2
|
||||
fear_VS
|
||||
find_V2
|
||||
fish_N
|
||||
floor_N
|
||||
forget_V2
|
||||
fridge_N
|
||||
friend_N
|
||||
fruit_N
|
||||
garden_N
|
||||
girl_N
|
||||
glove_N
|
||||
gold_N
|
||||
good_ADeg
|
||||
go_V
|
||||
green_ADeg
|
||||
harbour_N
|
||||
hate_V2
|
||||
hat_N
|
||||
have_V2
|
||||
hear_V2
|
||||
hill_N
|
||||
hope_VS
|
||||
horse_N
|
||||
hot_ADeg
|
||||
house_N
|
||||
important_ADeg
|
||||
industry_N
|
||||
iron_N
|
||||
king_N
|
||||
know_V2
|
||||
lake_N
|
||||
lamp_N
|
||||
learn_V2
|
||||
leather_N
|
||||
leave_V2
|
||||
like_V2
|
||||
listen_V2
|
||||
live_V
|
||||
long_ADeg
|
||||
lose_V2
|
||||
love_N
|
||||
love_V2
|
||||
man_N
|
||||
meat_N
|
||||
milk_N
|
||||
moon_N
|
||||
mother_N2
|
||||
mountain_N
|
||||
music_N
|
||||
narrow_ADeg
|
||||
new_ADeg
|
||||
newspaper_N
|
||||
oil_N
|
||||
old_ADeg
|
||||
open_V2
|
||||
paper_N
|
||||
peace_N
|
||||
pen_N
|
||||
planet_N
|
||||
plastic_N
|
||||
play_V2
|
||||
policeman_N
|
||||
priest_N
|
||||
queen_N
|
||||
radio_N
|
||||
read_V2
|
||||
red_ADeg
|
||||
religion_N
|
||||
restaurant_N
|
||||
river_N
|
||||
rock_N
|
||||
roof_N
|
||||
rubber_N
|
||||
run_V
|
||||
say_VS
|
||||
school_N
|
||||
science_N
|
||||
sea_N
|
||||
seek_V2
|
||||
see_V2
|
||||
sell_V3
|
||||
send_V3
|
||||
sheep_N
|
||||
ship_N
|
||||
shirt_N
|
||||
shoe_N
|
||||
shop_N
|
||||
short_ADeg
|
||||
silver_N
|
||||
sister_N
|
||||
sleep_V
|
||||
small_ADeg
|
||||
snake_N
|
||||
sock_N
|
||||
speak_V2
|
||||
star_N
|
||||
steel_N
|
||||
stone_N
|
||||
stove_N
|
||||
student_N
|
||||
stupid_ADeg
|
||||
sun_N
|
||||
switch8off_V2
|
||||
switch8on_V2
|
||||
table_N
|
||||
teacher_N
|
||||
teach_V2
|
||||
television_N
|
||||
thick_ADeg
|
||||
thin_ADeg
|
||||
train_N
|
||||
travel_V
|
||||
tree_N
|
||||
--trousers_N
|
||||
ugly_ADeg
|
||||
understand_V2
|
||||
university_N
|
||||
village_N
|
||||
wait_V2
|
||||
walk_V
|
||||
warm_ADeg
|
||||
war_N
|
||||
watch_V2
|
||||
water_N
|
||||
white_ADeg
|
||||
window_N
|
||||
wine_N
|
||||
win_V2
|
||||
woman_N
|
||||
wood_N
|
||||
write_V2
|
||||
yellow_ADeg
|
||||
young_ADeg
|
||||
@@ -1,5 +1,89 @@
|
||||
all:
|
||||
gf +RTS -K10M -M1012M <MkResource.gfs
|
||||
# gf +RTS -K10M <MkResource.gfs
|
||||
GF=gf
|
||||
RTS=+RTS -M800M -K100M
|
||||
RTSS=+RTS -M1000M -K100M
|
||||
GFCA=$(GF) -nocf
|
||||
GFCC=$(GF) -nocf -make
|
||||
GFC=$(GFCC) -src
|
||||
GFCP=$(GFC) -preproc=./mkPresent
|
||||
|
||||
|
||||
.PHONY: show-path all test alltenses pretest langs present mathematical multimodal compiled treebank stat gfdoc clean
|
||||
|
||||
all: show-path present alltenses langs multimodal mathematical compiled
|
||||
|
||||
show-path:
|
||||
@echo GF_LIB_PATH=$(GF_LIB_PATH)
|
||||
|
||||
test:
|
||||
echo "gr -cat=Text -number=11 -prob | tb" | $(GF) -nocf -probs=lang.gfprob langs.gfcm
|
||||
|
||||
pretest:
|
||||
echo "gr -cat=Cl -number=11 -prob | tb" | $(GF) -probs=lang.gfprob -path=present:prelude -nocf ../present/Lang???.gfc
|
||||
|
||||
alltenses:
|
||||
# $(GFC) arabic/LangAra.gf
|
||||
$(GFC) danish/Danish.gf
|
||||
$(GFC) english/English.gf
|
||||
$(GFC) finnish/Finnish.gf
|
||||
$(GFC) french/French.gf
|
||||
$(GFC) german/German.gf
|
||||
$(GFC) italian/Italian.gf
|
||||
$(GFC) norwegian/Norwegian.gf
|
||||
$(GFC) russian/Russian.gf
|
||||
$(GFC) spanish/Spanish.gf
|
||||
$(GFC) swedish/Swedish.gf
|
||||
cp -p */*.gfc */*.gfr ../alltenses
|
||||
|
||||
langs:
|
||||
echo "s ;; pm | wf langs.gfcm" | $(GFCA) -path=alltenses:prelude ../alltenses/Lang???.gfc $(RTSS)
|
||||
|
||||
|
||||
present:
|
||||
# $(GFCP) arabic/LangAra.gf
|
||||
$(GFCP) danish/Danish.gf
|
||||
$(GFCP) english/English.gf
|
||||
$(GFCP) finnish/Finnish.gf
|
||||
$(GFCP) french/French.gf
|
||||
$(GFCP) german/German.gf
|
||||
$(GFCP) italian/Italian.gf
|
||||
$(GFCP) norwegian/Norwegian.gf
|
||||
$(GFCP) russian/LangRus.gf
|
||||
$(GFCP) spanish/Spanish.gf
|
||||
$(GFCP) swedish/Swedish.gf
|
||||
mv */*.gfc */*.gfr ../present
|
||||
|
||||
mathematical:
|
||||
$(GF) -make -nocf -preproc=./mkPresent mathematical/Mathematical???.gf
|
||||
mv mathematical/*.gfc ../mathematical
|
||||
|
||||
multimodal:
|
||||
$(GF) -make -nocf multimodal/Multi???.gf
|
||||
mv multimodal/*.gfc ../multimodal
|
||||
|
||||
compiled:
|
||||
cd .. ; tar cvfz compiled.tgz alltenses/ mathematical/ multimodal/ present/ prelude/*.gf?
|
||||
|
||||
treebank:
|
||||
gf <mkTreebank.gfs
|
||||
|
||||
stat:
|
||||
wc */*.gfc
|
||||
|
||||
gfdoc:
|
||||
gfdoc -txthtml abstract/*.gf
|
||||
gfdoc -txthtml */Paradigms*.gf
|
||||
gfdoc -txthtml mathematical/Mathematical.gf
|
||||
gfdoc -txthtml mathematical/Symbol.gf
|
||||
gfdoc -txthtml mathematical/Predication.gf
|
||||
gfdoc -txthtml multimodal/Multi.gf
|
||||
gfdoc -txthtml ../prelude/*.gf
|
||||
mv abstract/*.html doc/gfdoc
|
||||
mv mathematical/*.html doc/gfdoc
|
||||
mv multimodal/*.html doc/gfdoc
|
||||
mv */Paradigms*.html doc/gfdoc
|
||||
cp */Irreg???.gf doc/gfdoc
|
||||
mv ../prelude/*.html doc/gfdoc
|
||||
|
||||
clean:
|
||||
rm -f */*.gfc */*.gfr
|
||||
-rm */*.gfc */*.gfr */*.gf~
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
i finnish/LangFin.gf
|
||||
s
|
||||
i french/LangFre.gf
|
||||
i italian/LangIta.gf
|
||||
i spanish/LangSpa.gf
|
||||
s
|
||||
i norwegian/LangNor.gf
|
||||
i swedish/LangSwe.gf
|
||||
s
|
||||
i english/LangEng.gf
|
||||
s
|
||||
pm | wf langs.gfcm
|
||||
@@ -1,27 +1,101 @@
|
||||
23/1/2005 -- 21/12/2005
|
||||
LICENSE: This library is free software licensed under GNU General
|
||||
Public License (GPL), see LICENSE.
|
||||
|
||||
GF Resource Grammar Library Version 0.9
|
||||
Author (c) Aarne Ranta 2005-2006.
|
||||
|
||||
The contents of this directory are open source software
|
||||
under GNU General Public License (See LICENCE).
|
||||
-- file GF/lib/resource-1.0/README
|
||||
-- created Thu Dec 1 22:21:21 CET 2005
|
||||
-- by A. Ranta, aarne@cs.chalmers.se
|
||||
|
||||
Authors (c): Janna Khegai (Russian), Aarne Ranta.
|
||||
This is a working directory for the next version of GF resource
|
||||
grammar library, incomplete in many ways but aimed to become the
|
||||
first "mature" release. The old releases (resource-0.6 and resource)
|
||||
will be kept available, but 'resource' will be renamed 'resource-0.9',
|
||||
and 'resource' will probably be made into a symbolic link to the
|
||||
current version.
|
||||
|
||||
For more information, see doc/gf-resource.html.
|
||||
To compile:
|
||||
|
||||
To compile a gfcm package, type 'make'. Then open the resource
|
||||
with either of
|
||||
make
|
||||
|
||||
gf langs.gfcm
|
||||
For translation from Eng to all others, try e.g.
|
||||
|
||||
gfeditor langs.gfcm
|
||||
gf -nocf langs.gfcm
|
||||
> p -cat=Phr -fcfg "I haven't seen her" | l -multi
|
||||
|
||||
VERSION NOTICE: this resource grammar library is at the moment of
|
||||
writing the most complete one. It supersedes and includes
|
||||
v 0.6 (../resource-0.6) in all other respects except that
|
||||
it is not implemented for German.
|
||||
To link to the library, use the precompiled packages
|
||||
|
||||
HOWEVER, this library is no longer developed, but the
|
||||
development has been moved to v 1.0 (../resource-1.0).
|
||||
V 1.0 will replace v 0.9 during Winter and Spring 2006.
|
||||
- ``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
|
||||
|
||||
The main changes from 0.9 to 1.0 are
|
||||
|
||||
1. Refactoring of module structure: there are many more modules now.
|
||||
However, the full API is still available as LangX.
|
||||
|
||||
2. Increased coverage. We have used the second CLE book ("Spoken
|
||||
Language Translation", by M. Rayner, D. Carter, P. Bouillon
|
||||
V. Digalakis, and M. Wirén, Cambridge UP, 2000) as guideline and
|
||||
goal.
|
||||
|
||||
3. Some constructions have been dropped out or modified. This concerns
|
||||
in particular the determiner structure in the module Noun. Also the
|
||||
number of verb subcategorization patterns is lower: predication can
|
||||
be done by adding adverbs instead. Also the division between A and ADeg
|
||||
is eliminated.
|
||||
|
||||
4. The implementation is more direct; there is no "SyntaxX" variant of
|
||||
each rule as in 0.9. The ease to find definitions and change them
|
||||
weighs many times more than the abstraction attained by indirection,
|
||||
in this case. Also compilation time and amount of generated code (gfr)
|
||||
decreases quite a bit.
|
||||
|
||||
5. The result is a lighter and more efficient resource library, just
|
||||
because of lessons learned from earlier implementations.
|
||||
Compared to 0.9, compilation times and gfc sizes have dropped by
|
||||
50% up to 70%.
|
||||
|
||||
Version 0.9 is hereby "frozen" to its current state, which means that
|
||||
extensions and bug fixes are not carried over to it. However, if
|
||||
requested, we might provide a reimplementation of the old API using
|
||||
the new.
|
||||
|
||||
When will it be ready? Today (25 February 2006) the implementation
|
||||
is complete for 8 languages (which excludes Danish and Russian).
|
||||
A number of bugs wait to be fixes, and a SourceForge release will
|
||||
be made some time in March.
|
||||
|
||||
BUT WE ALREADY RECOMMEND USING 1.0 INSTEAD OF THE OLDER VERSIONS.
|
||||
Notice that GF v.
|
||||
|
||||
---------- later history and status:
|
||||
|
||||
16/6 Close to complete, with 10 languages and a substantial part of
|
||||
Arabic.
|
||||
|
||||
25/2 Added directories for precompiled libraries directly under lib.
|
||||
See doc/index.html for more information.
|
||||
|
||||
21/2 Added modules Text and Idiom. Many bugs fixed, see TODO.
|
||||
|
||||
7/2 Finnish added.
|
||||
|
||||
3/2 Spanish added, except ordinal numerals. Much remains to do in Spa & Ita clitics.
|
||||
|
||||
1/2 Italian added.
|
||||
|
||||
26/1 Norwegian added.
|
||||
|
||||
24/1 French complete, as well as the Romance parametrized modules.
|
||||
|
||||
20/1 Main difficulties of French and Romance implemented. Also
|
||||
ParadigmsFre and fragments of LangFre.
|
||||
|
||||
17/1 All of English, Swedish, and German implemented. Some known bugs
|
||||
remain, also some ToDo API functions.
|
||||
|
||||
13/1/2006 All of English, most of Scandinavian/Swedish, and TestGer
|
||||
have now been implemented. Most abstract/ modules have been documented
|
||||
using gfdoc.
|
||||
|
||||
47
lib/resource/TODO
Normal file
47
lib/resource/TODO
Normal file
@@ -0,0 +1,47 @@
|
||||
TODO in Resource 1.0 implementation
|
||||
|
||||
6/2/2006
|
||||
|
||||
%Eng: non-contracted negations
|
||||
|
||||
%Eng: auxiliaries in standard API
|
||||
|
||||
%API: idiomatic expressions: ExistNP, ProgressiveVP, ImpersonalVP
|
||||
|
||||
%Spa: clitic order and changes
|
||||
|
||||
%Ita: clitic order and changes
|
||||
|
||||
%Ita: infinitive contractions
|
||||
|
||||
%Ita: articles in possessives
|
||||
|
||||
%Ger: constituents of infinitive VP
|
||||
|
||||
%Spa: ordinal numbers
|
||||
|
||||
%Nor: Ext: possessives
|
||||
|
||||
%Spa: zero subjects
|
||||
|
||||
%Ita: zero subjects
|
||||
|
||||
Fin: zero subjects
|
||||
|
||||
%Spa: verb constructors in Paradigms or list of irregular verbs
|
||||
|
||||
%Ita: verb constructors in Paradigms
|
||||
|
||||
API: mathematical/: math-specific lexicon
|
||||
|
||||
API: multimodal/: dialogue-specific lexicon
|
||||
|
||||
%API: swadesh/: build a swadesh-related API and migrate lexica
|
||||
|
||||
%API: mathematical/: symbolic formulas as Cl
|
||||
|
||||
%API: text construction
|
||||
|
||||
%All: punctuation
|
||||
|
||||
%API: apposition, e.g. Det -> CN -> [PN] -> NP
|
||||
30
lib/resource/abstract/Adjective.gf
Normal file
30
lib/resource/abstract/Adjective.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--1 Adjective: Adjectives and Adjectival Phrases
|
||||
|
||||
abstract Adjective = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- The principal ways of forming an adjectival phrase are
|
||||
-- positive, comparative, relational, reflexive-relational, and
|
||||
-- elliptic-relational.
|
||||
-- (The superlative use is covered in [Noun Noun.html].$SuperlA$.)
|
||||
|
||||
PositA : A -> AP ; -- warm
|
||||
ComparA : A -> NP -> AP ; -- warmer than Spain
|
||||
ComplA2 : A2 -> NP -> AP ; -- divisible by 2
|
||||
ReflA2 : A2 -> AP ; -- divisible by itself
|
||||
UseA2 : A2 -> A ; -- divisible
|
||||
|
||||
-- Sentence and question complements defined for all adjectival
|
||||
-- phrases, although the semantics is only clear for some adjectives.
|
||||
|
||||
SentAP : AP -> SC -> AP ; -- great that she won, uncertain if she did
|
||||
|
||||
-- An adjectival phrase can be modified by an *adadjective*, such as "very".
|
||||
|
||||
AdAP : AdA -> AP -> AP ; -- very uncertain
|
||||
|
||||
-- The formation of adverbs from adjective (e.g. "quickly") is covered
|
||||
-- by [Adverb Adverb.html].
|
||||
|
||||
}
|
||||
33
lib/resource/abstract/Adverb.gf
Normal file
33
lib/resource/abstract/Adverb.gf
Normal file
@@ -0,0 +1,33 @@
|
||||
--1 Adverb: Adverbs and Adverbial Phrases
|
||||
|
||||
abstract Adverb = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- The two main ways of forming adverbs are from adjectives and by
|
||||
-- prepositions from noun phrases.
|
||||
|
||||
PositAdvAdj : A -> Adv ; -- quickly
|
||||
PrepNP : Prep -> NP -> Adv ; -- in the house
|
||||
|
||||
-- Comparative adverbs have a noun phrase or a sentence as object of
|
||||
-- comparison.
|
||||
|
||||
ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more quickly than John
|
||||
ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more quickly than he runs
|
||||
|
||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||
|
||||
AdAdv : AdA -> Adv -> Adv ; -- very quickly
|
||||
|
||||
-- Subordinate clauses can function as adverbs.
|
||||
|
||||
SubjS : Subj -> S -> Adv ; -- when he arrives
|
||||
AdvSC : SC -> Adv ; -- that he arrives ---- REMOVE?
|
||||
|
||||
-- Comparison adverbs also work as numeral adverbs.
|
||||
|
||||
AdnCAdv : CAdv -> AdN ; -- more (than five)
|
||||
|
||||
|
||||
}
|
||||
123
lib/resource/abstract/Cat.gf
Normal file
123
lib/resource/abstract/Cat.gf
Normal file
@@ -0,0 +1,123 @@
|
||||
--1 Cat: 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 ** {
|
||||
|
||||
cat
|
||||
|
||||
--2 Sentences and clauses
|
||||
|
||||
-- Constructed in [Sentence Sentence.html], and also in
|
||||
-- [Idiom Idiom.html].
|
||||
|
||||
S ; -- declarative sentence e.g. "she lived here"
|
||||
QS ; -- question e.g. "where did she live"
|
||||
RS ; -- relative e.g. "in which she lived"
|
||||
Cl ; -- declarative clause, with all tenses e.g. "she looks at this"
|
||||
Slash ; -- clause missing NP (S/NP in GPSG) e.g. "she looks at"
|
||||
Imp ; -- imperative e.g. "look at this"
|
||||
|
||||
--2 Questions and interrogatives
|
||||
|
||||
-- Constructed in [Question Question.html].
|
||||
|
||||
QCl ; -- question clause, with all tenses e.g. "why does she walk"
|
||||
IP ; -- interrogative pronoun e.g. "who"
|
||||
IComp ; -- interrogative complement of copula e.g. "where"
|
||||
IDet ; -- interrogative determiner e.g. "which"
|
||||
|
||||
--2 Relative clauses and pronouns
|
||||
|
||||
-- Constructed in [Relative Relative.html].
|
||||
|
||||
RCl ; -- relative clause, with all tenses e.g. "in which she lives"
|
||||
RP ; -- relative pronoun e.g. "in which"
|
||||
|
||||
--2 Verb phrases
|
||||
|
||||
-- Constructed in [Verb Verb.html].
|
||||
|
||||
VP ; -- verb phrase e.g. "is very warm"
|
||||
Comp ; -- complement of copula, such as AP e.g. "very warm"
|
||||
|
||||
--2 Adjectival phrases
|
||||
|
||||
-- Constructed in [Adjective Adjective.html].
|
||||
|
||||
AP ; -- adjectival phrase e.g. "very warm"
|
||||
|
||||
--2 Nouns and noun phrases
|
||||
|
||||
-- Constructed in [Noun Noun.html].
|
||||
-- Many atomic noun phrases e.g. "everybody"
|
||||
-- are constructed in [Structural Structural.html].
|
||||
-- The determiner structure is
|
||||
-- ``` Predet (QuantSg | QuantPl Num) Ord
|
||||
-- as defined in [Noun Noun.html].
|
||||
|
||||
CN ; -- common noun (without determiner) e.g. "red house"
|
||||
NP ; -- noun phrase (subject or object) e.g. "the red house"
|
||||
Pron ; -- personal pronoun e.g. "she"
|
||||
Det ; -- determiner phrase e.g. "those seven"
|
||||
Predet; -- predeterminer (prefixed Quant) e.g. "all"
|
||||
QuantSg;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
||||
QuantPl;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
||||
Quant ; -- quantifier with both sg and pl e.g. "this/these"
|
||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||
|
||||
--2 Numerals
|
||||
|
||||
-- Constructed in [Numeral Numeral.html].
|
||||
|
||||
Numeral;-- cardinal or ordinal, e.g. "five/fifth"
|
||||
|
||||
--2 Structural words
|
||||
|
||||
-- Constructed in [Structural Structural.html].
|
||||
|
||||
Conj ; -- conjunction, e.g. "and"
|
||||
DConj ; -- distributed conj. e.g. "both - and"
|
||||
Subj ; -- subjunction, e.g. "if"
|
||||
Prep ; -- preposition, or just case e.g. "in"
|
||||
|
||||
--2 Words of open classes
|
||||
|
||||
-- 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"
|
||||
VV ; -- verb-phrase-complement verb e.g. "want"
|
||||
VS ; -- sentence-complement verb e.g. "claim"
|
||||
VQ ; -- question-complement verb e.g. "ask"
|
||||
VA ; -- adjective-complement verb e.g. "look"
|
||||
V2A ; -- verb with NP and AP complement e.g. "paint"
|
||||
|
||||
A ; -- one-place adjective e.g. "warm"
|
||||
A2 ; -- two-place adjective e.g. "divisible"
|
||||
|
||||
N ; -- common noun e.g. "house"
|
||||
N2 ; -- relational noun e.g. "son"
|
||||
N3 ; -- three-place relational noun e.g. "connection"
|
||||
PN ; -- proper name e.g. "Paris"
|
||||
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
--1 Abstract Syntax Categories for Multilingual Resource Grammar
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2004
|
||||
--
|
||||
-- Although concrete syntax differs a lot between different languages,
|
||||
-- many structures can be treated as common, on the level
|
||||
-- of abstraction that GF provides.
|
||||
-- What we will present in the following is a linguistically oriented abstract
|
||||
-- syntax that has been successfully defined for the following languages:
|
||||
--
|
||||
--* $Eng$lish
|
||||
--* $Fin$nish
|
||||
--* $Fre$nch
|
||||
--* $Ger$man
|
||||
--* $Ita$lian
|
||||
--* $Rus$sian
|
||||
--* $Swe$dish
|
||||
--
|
||||
-- The three-letter prefixes are used in file names all over the resource
|
||||
-- grammar library; we refer to them commonly as $X$ below.
|
||||
--!
|
||||
-- The grammar has been applied to define language
|
||||
-- fragments on technical or near-to-technical domains: database queries,
|
||||
-- video recorder dialogue systems, software specifications, and a
|
||||
-- health-related phrase book. Each new application helped to identify some
|
||||
-- missing structures in the resource and suggested some additions, but the
|
||||
-- number of required additions was usually small.
|
||||
--
|
||||
-- To use the resource in applications, you need the following
|
||||
-- $cat$ and $fun$ rules in $oper$ form, completed by taking the
|
||||
-- $lincat$ and $lin$ judgements of a particular language. This is done
|
||||
-- by using, instead of this module, the $reuse$ module which has the name
|
||||
-- $ResourceX$. It is located in the subdirectory
|
||||
-- $lib/resource/lang$ where $lang$ is the full name of the language.
|
||||
|
||||
|
||||
abstract Categories = PredefAbs ** {
|
||||
--!
|
||||
--2 Categories
|
||||
--
|
||||
-- The categories of this resource grammar are mostly 'standard' categories
|
||||
-- of linguistics. Their is no claim that they correspond to semantic categories
|
||||
-- definable in type theory: to define such correspondences is the business
|
||||
-- of applications grammars. In general, the correspondence between linguistic
|
||||
-- and semantic categories is many-to-many.
|
||||
--
|
||||
-- Categories that may look special are $A2$, $N2$, and $V2$. They are all
|
||||
-- instances of endowing another category with a complement, which can be either
|
||||
-- a direct object (whose case may vary) or a prepositional phrase. Prepositional
|
||||
-- phrases that are not complements belong to the category
|
||||
-- $Adv$ of adverbs.
|
||||
--
|
||||
-- In each group below, some categories are *lexical* in the sense of only
|
||||
-- containing atomic elements. These elements are not necessarily expressed by
|
||||
-- one word in all languages; the essential thing is that they have no
|
||||
-- constituents. Thus they have no productions in this part of the
|
||||
-- resource grammar. The $ParadigmsX$ grammars provide ways of defining
|
||||
-- lexical elements.
|
||||
--
|
||||
-- Lexical categories are listed before other categories
|
||||
-- in each group and divided by an empty line.
|
||||
|
||||
--!
|
||||
--3 Nouns and noun phrases
|
||||
--
|
||||
|
||||
cat
|
||||
N ; -- simple common noun, e.g. "car"
|
||||
CN ; -- common noun phrase, e.g. "red car", "car that John owns"
|
||||
N2 ; -- function word, e.g. "mother (of)"
|
||||
N3 ; -- two-place function, e.g. "flight (from) (to)"
|
||||
|
||||
PN ; -- proper name, e.g. "John", "New York"
|
||||
NP ; -- noun phrase, e.g. "John", "all cars", "you"
|
||||
Det ; -- determiner, e.g. "every", "many"
|
||||
NDet ; -- det that admits a num, e.g. "all (the 5)"
|
||||
Num ; -- numeral, e.g. "three", "879"
|
||||
|
||||
--!
|
||||
--3 Adjectives and adjectival phrases
|
||||
--
|
||||
|
||||
A ; -- one-place adjective, e.g. "even"
|
||||
A2 ; -- two-place adjective, e.g. "divisible (by)"
|
||||
ADeg ; -- degree adjective, e.g. "big/bigger/biggest"
|
||||
|
||||
AP ; -- adjective phrase, e.g. "divisible by two", "bigger than John"
|
||||
|
||||
-- The difference between $A$ and $ADeg$ is that the former has no
|
||||
-- comparison forms.
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
|
||||
V ; -- one-place verb, e.g. "walk"
|
||||
V2 ; -- two-place verb, e.g. "love", "wait (for)", "switch on"
|
||||
V3 ; -- three-place verb, e.g. "give", "prefer (stg) (to stg)"
|
||||
VS ; -- sentence-compl. verb, e.g. "say", "prove"
|
||||
VV ; -- verb-compl. verb, e.g. "can", "want"
|
||||
|
||||
VP ; -- verb phrase, e.g. "switch the light on"
|
||||
VPI ; -- infinitive verb phrase e.g. "switch the light on", "not have run"
|
||||
VCl ; -- same (variable ant.) e.g. "walk"/"have walked"
|
||||
|
||||
--!
|
||||
--3 Adverbs and prepositions/cases
|
||||
--
|
||||
|
||||
Adv ; -- sentence adverb e.g. "now", "in the house"
|
||||
AdV ; -- verb adverb e.g. "always"
|
||||
AdA ; -- ad-adjective e.g. "very"
|
||||
AdC ; -- conjoining adverb e.g. "therefore", "otherwise"
|
||||
PP ; -- prepositional phrase e.g. "in London"
|
||||
Prep ; -- pre/postposition, case e.g. "after", Adessive
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
S ; -- sentence (fixed tense) e.g. "John walks", "John walked"
|
||||
Cl ; -- clause (variable tense) e.g. "John walks"/"John walked"
|
||||
Slash ; -- sentence without NP, e.g. "John waits for (...)"
|
||||
RP ; -- relative pronoun, e.g. "which", "the mother of whom"
|
||||
RCl ; -- relative clause, e.g. "who walks", "that I wait for"
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
IP ; -- interrogative pronoun, e.g. "who", "whose mother", "which car"
|
||||
IDet ; -- interrog. determiner, e.g. "which", "how many"
|
||||
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||
QCl ; -- question, e.g. "who walks"
|
||||
QS ; -- question w. fixed tense
|
||||
Imp ; -- imperative, e.g. "walk!"
|
||||
|
||||
--!
|
||||
--3 Coordination and subordination
|
||||
--
|
||||
|
||||
Conj ; -- conjunction, e.g. "and"
|
||||
ConjD ; -- distributed conj. e.g. "both - and"
|
||||
Subj ; -- subjunction, e.g. "if", "when"
|
||||
|
||||
ListS ; -- list of sentences
|
||||
ListAP ; -- list of adjectival phrases
|
||||
ListNP ; -- list of noun phrases
|
||||
ListAdv ;-- list of adverbs
|
||||
|
||||
--!
|
||||
--3 Complete utterances
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
Phr ; -- full phrase, e.g. "John walks.","Who walks?", "Wait for me!"
|
||||
Text ; -- sequence of phrases e.g. "One is odd. Therefore, two is even."
|
||||
|
||||
---- next
|
||||
|
||||
V2A ; -- paint the house red
|
||||
V2V ; -- promise John to come / ask John to come
|
||||
V2S ; -- tell John that it is raining
|
||||
VQ ; -- ask who comes
|
||||
V2Q ; -- ask John who comes
|
||||
VA ; -- look yellow
|
||||
|
||||
V0 ; -- (it) rains
|
||||
|
||||
AS ; -- (it is) important that he comes
|
||||
A2S ; -- (it is) important for me that he comes
|
||||
AV ; -- difficult to play
|
||||
A2V ; -- difficult for him to play
|
||||
|
||||
-- NB: it is difficult to play the sonata
|
||||
-- vs. it (the sonata) is difficult to play
|
||||
|
||||
--- also: John is easy (for you) to please vs. John is eager to please
|
||||
|
||||
|
||||
RS ; -- relative clause with fixed tense and polarity
|
||||
|
||||
TP ; -- tense x polarity selector
|
||||
Tense ; -- (abstract) tense
|
||||
Ant ; -- (abstract) anteriority
|
||||
Pol ; -- polarity (positive or negative)
|
||||
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
--!
|
||||
--1 Rules for predication forming clauses
|
||||
--
|
||||
-- This module treats predications in a shallow way, without right-branching
|
||||
-- $VP$ structures. This has the disadvantage of duplicating rules but the
|
||||
-- advantage of fast parsing due to elimination of discontinuous
|
||||
-- constituents. Also the canonical GF structures (in $.gfc$) files
|
||||
-- get smaller, because much more pruning of case alternatives can
|
||||
-- be performed at compile time.
|
||||
--
|
||||
-- Each of the rules below has the following structure:
|
||||
--
|
||||
-- "Subject -> Verb -> Complements -> Clause"
|
||||
--
|
||||
-- What complements are needed depends on the type of the verb.
|
||||
-- For instance, $V$ takes no complement, $V2$ takes one $NP$
|
||||
-- complement, $VS$ takes an $S$ complement, etc. There is an elegant
|
||||
-- way of expressing this using dependent types:
|
||||
--
|
||||
-- (v : VType) -> Subj -> Verb v -> Compl v -> Clause
|
||||
--
|
||||
-- Since there are 12 verb types in our category system, using this
|
||||
-- rule would be economical. The effect is amplified by another
|
||||
-- distinction that the rules make: there are separate sets of
|
||||
-- rules just differing in what type the subject and
|
||||
-- the resulting clause have. There are four different types:
|
||||
--
|
||||
--* $SPred$ (declarative clause, from $NP$ to $Cl$),
|
||||
--* $QPred$ (interrogative clause, from $IP$ to $QCl$),
|
||||
--* $RPred$ (relative clause, from $RP$ to $RCl$),
|
||||
--* $IPred$ (infinitive clause, from no subject to $VCl$).
|
||||
--
|
||||
-- The ultimate dependent type formalization of all the 4x12 rules is
|
||||
--
|
||||
-- (n : NType) -> (v : VType) -> Subj n -> Verb v -> Compl v -> Clause n
|
||||
--
|
||||
-- In the following, however, an expanded set of rules with no
|
||||
-- dependent types is shown.
|
||||
|
||||
abstract Clause = Categories ** {
|
||||
|
||||
fun
|
||||
SPredV : NP -> V -> Cl ; -- "John walks"
|
||||
SPredPassV : NP -> V -> Cl ; -- "John is seen"
|
||||
SPredV2 : NP -> V2 -> NP -> Cl ; -- "John sees Mary"
|
||||
SPredV3 : NP -> V3 -> NP -> NP -> Cl ; -- "John tells Mary everything"
|
||||
SPredReflV2 : NP -> V2 -> Cl ; -- "John loves himself"
|
||||
SPredVS : NP -> VS -> S -> Cl ; -- "John says that Mary runs"
|
||||
SPredVV : NP -> VV -> VPI -> Cl ; -- "John must walk"
|
||||
SPredVQ : NP -> VQ -> QS -> Cl ; -- "John asks who will come"
|
||||
SPredVA : NP -> VA -> AP -> Cl ; -- "John looks ill"
|
||||
SPredV2A : NP -> V2A -> NP -> AP -> Cl ; -- "John paints the house red"
|
||||
SPredSubjV2V : NP -> V2V -> NP -> VPI -> Cl ; -- "John promises Mary to leave"
|
||||
SPredObjV2V : NP -> V2V -> NP -> VPI -> Cl ; -- "John asks me to come"
|
||||
SPredV2S : NP -> V2S -> NP -> S -> Cl ; -- "John told me that it is good"
|
||||
SPredV2Q : NP -> V2Q -> NP -> QS -> Cl ; -- "John asked me if it is good"
|
||||
|
||||
SPredAP : NP -> AP -> Cl ; -- "John is old"
|
||||
SPredCN : NP -> CN -> Cl ; -- "John is a man"
|
||||
SPredNP : NP -> NP -> Cl ; -- "John is Bill"
|
||||
SPredAdv : NP -> Adv -> Cl ; -- "John is in France"
|
||||
|
||||
SPredProgVP : NP -> VPI -> Cl ; -- "he is eating"
|
||||
|
||||
QPredV : IP -> V -> QCl ; -- "who walks"
|
||||
QPredPassV : IP -> V -> QCl ; -- "who is seen"
|
||||
QPredV2 : IP -> V2 -> NP -> QCl ; -- "who sees Mary"
|
||||
QPredV3 : IP -> V3 -> NP -> NP -> QCl ; -- "who gives Mary food"
|
||||
QPredReflV2 : IP -> V2 -> QCl ; -- "who loves himself"
|
||||
QPredVS : IP -> VS -> S -> QCl ; -- "who says that Mary runs"
|
||||
QPredVV : IP -> VV -> VPI -> QCl ; -- "who must walk"
|
||||
QPredVQ : IP -> VQ -> QS -> QCl ; -- "who asks who will come"
|
||||
QPredVA : IP -> VA -> AP -> QCl ; -- "who looks ill"
|
||||
QPredV2A : IP -> V2A -> NP ->AP ->QCl ; -- "who paints the house red"
|
||||
QPredSubjV2V : IP -> V2V -> NP ->VPI ->QCl ; -- "who promises Mary to leave"
|
||||
QPredObjV2V : IP -> V2V -> NP -> VPI -> QCl ; -- "who asks me to come"
|
||||
QPredV2S : IP -> V2S -> NP -> S -> QCl ; -- "who told me that it is good"
|
||||
QPredV2Q : IP -> V2Q -> NP -> QS -> QCl ; -- "who asked me if it is good"
|
||||
|
||||
QPredAP : IP -> AP -> QCl ; -- "who is old"
|
||||
QPredCN : IP -> CN -> QCl ; -- "who is a man"
|
||||
QPredNP : IP -> NP -> QCl ; -- "who is Bill"
|
||||
QPredAdv : IP -> Adv -> QCl ; -- "who is in France"
|
||||
|
||||
QPredProgVP : IP -> VPI -> QCl ; -- "who is eating"
|
||||
|
||||
RPredV : RP -> V -> RCl ; -- "who walks"
|
||||
RPredPassV : RP -> V -> RCl ; -- "who is seen"
|
||||
RPredV2 : RP -> V2 -> NP -> RCl ; -- "who sees Mary"
|
||||
RPredV3 : RP -> V3 -> NP -> NP -> RCl ; -- "who gives Mary food"
|
||||
RPredReflV2 : RP -> V2 -> RCl ; -- "who loves himself"
|
||||
RPredVS : RP -> VS -> S -> RCl ; -- "who says that Mary runs"
|
||||
RPredVV : RP -> VV -> VPI -> RCl ; -- "who must walk"
|
||||
RPredVQ : RP -> VQ -> QS -> RCl ; -- "who asks who will come"
|
||||
RPredVA : RP -> VA -> AP -> RCl ; -- "who looks ill"
|
||||
RPredV2A : RP -> V2A -> NP -> AP -> RCl ; -- "who paints the house red"
|
||||
RPredSubjV2V : RP -> V2V -> NP -> VPI -> RCl ; -- "who promises Mary to leave"
|
||||
RPredObjV2V : RP -> V2V -> NP -> VPI -> RCl ; -- "who asks me to come"
|
||||
RPredV2S : RP -> V2S -> NP -> S -> RCl ; -- "who told me that it is good"
|
||||
RPredV2Q : RP -> V2Q -> NP -> QS -> RCl ; -- "who asked me if it is good"
|
||||
|
||||
RPredAP : RP -> AP -> RCl ; -- "who is old"
|
||||
RPredCN : RP -> CN -> RCl ; -- "who is a man"
|
||||
RPredNP : RP -> NP -> RCl ; -- "who is Bill"
|
||||
RPredAdv : RP -> Adv -> RCl ; -- "who is in France"
|
||||
|
||||
RPredProgVP : RP -> VPI -> RCl ; -- "who is eating"
|
||||
|
||||
IPredV : V -> VCl ; -- "walk"
|
||||
IPredPassV : V -> VCl ; -- "be seen"
|
||||
IPredV2 : V2 -> NP -> VCl ; -- "see Mary"
|
||||
IPredV3 : V3 -> NP -> NP -> VCl ; -- "give Mary food"
|
||||
IPredReflV2 : V2 -> VCl ; -- "love himself"
|
||||
IPredVS : VS -> S -> VCl ; -- "say that Mary runs"
|
||||
IPredVV : VV -> VPI -> VCl ; -- "want to walk"
|
||||
IPredVQ : VQ -> QS -> VCl ; -- "ask who will come"
|
||||
IPredVA : VA -> AP -> VCl ; -- "look ill"
|
||||
IPredV2A : V2A -> NP -> AP -> VCl ; -- "paint the house red"
|
||||
IPredSubjV2V : V2V -> NP -> VPI -> VCl ; -- "promise Mary to leave"
|
||||
IPredObjV2V : V2V -> NP -> VPI -> VCl ; -- "ask me to come"
|
||||
IPredV2S : V2S -> NP -> S -> VCl ; -- "tell me that it is good"
|
||||
IPredV2Q : V2Q -> NP -> QS -> VCl ; -- "ask me if it is good"
|
||||
|
||||
IPredAP : AP -> VCl ; -- "be old"
|
||||
IPredCN : CN -> VCl ; -- "be a man"
|
||||
IPredNP : NP -> VCl ; -- "be Bill"
|
||||
IPredAdv : Adv -> VCl ; -- "be in France"
|
||||
|
||||
IPredProgVP : VPI -> VCl ; -- "be eating"
|
||||
|
||||
|
||||
{-
|
||||
-- These rules *use* verb phrases.
|
||||
|
||||
PredVP : NP -> VP -> Cl ; -- "John walks"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
|
||||
PosVP, NegVP : Ant -> VP -> VPI ; -- to eat, not to eat
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
-}
|
||||
|
||||
} ;
|
||||
@@ -1,111 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete ClauseI of Clause = open Rules, Verbphrase in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
SPredV np v = PredVP np (UseV v) ;
|
||||
SPredPassV np v = PredVP np (UsePassV v) ;
|
||||
SPredV2 np v x = PredVP np (ComplV2 v x) ;
|
||||
SPredV3 np v x y = PredVP np (ComplV3 v x y) ;
|
||||
SPredReflV2 np v = PredVP np (ComplReflV2 v) ;
|
||||
SPredVS np v x = PredVP np (ComplVS v x) ;
|
||||
SPredVV np v x = PredVP np (ComplVV v x) ;
|
||||
SPredVQ np v x = PredVP np (ComplVQ v x) ;
|
||||
SPredVA np v x = PredVP np (ComplVA v x) ;
|
||||
SPredV2A np v x y = PredVP np (ComplV2A v x y) ;
|
||||
SPredSubjV2V np v x y = PredVP np (ComplSubjV2V v x y) ;
|
||||
SPredObjV2V np v x y = PredVP np (ComplObjV2V v x y) ;
|
||||
SPredV2S np v x y = PredVP np (ComplV2S v x y) ;
|
||||
SPredV2Q np v x y = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
SPredAP np v = PredVP np (PredAP v) ;
|
||||
SPredCN np v = PredVP np (PredCN v) ;
|
||||
SPredNP np v = PredVP np (PredNP v) ;
|
||||
SPredAdv np v = PredVP np (PredAdv v) ;
|
||||
|
||||
SPredProgVP np vp = PredVP np (PredProgVP vp) ;
|
||||
|
||||
QPredV np v = IntVP np (UseV v) ;
|
||||
QPredPassV np v = IntVP np (UsePassV v) ;
|
||||
QPredV2 np v x = IntVP np (ComplV2 v x) ;
|
||||
QPredV3 np v x y = IntVP np (ComplV3 v x y) ;
|
||||
QPredReflV2 np v = IntVP np (ComplReflV2 v) ;
|
||||
QPredVS np v x = IntVP np (ComplVS v x) ;
|
||||
QPredVV np v x = IntVP np (ComplVV v x) ;
|
||||
QPredVQ np v x = IntVP np (ComplVQ v x) ;
|
||||
QPredVA np v x = IntVP np (ComplVA v x) ;
|
||||
QPredV2A np v x y = IntVP np (ComplV2A v x y) ;
|
||||
QPredSubjV2V np v x y = IntVP np (ComplSubjV2V v x y) ;
|
||||
QPredObjV2V np v x y = IntVP np (ComplObjV2V v x y) ;
|
||||
QPredV2S np v x y = IntVP np (ComplV2S v x y) ;
|
||||
QPredV2Q np v x y = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
QPredAP np v = IntVP np (PredAP v) ;
|
||||
QPredCN np v = IntVP np (PredCN v) ;
|
||||
QPredNP np v = IntVP np (PredNP v) ;
|
||||
QPredAdv np v = IntVP np (PredAdv v) ;
|
||||
|
||||
QPredProgVP np vp = IntVP np (PredProgVP vp) ;
|
||||
|
||||
RPredV np v = RelVP np (UseV v) ;
|
||||
RPredPassV np v = RelVP np (UsePassV v) ;
|
||||
RPredV2 np v x = RelVP np (ComplV2 v x) ;
|
||||
RPredV3 np v x y = RelVP np (ComplV3 v x y) ;
|
||||
RPredReflV2 np v = RelVP np (ComplReflV2 v) ;
|
||||
RPredVS np v x = RelVP np (ComplVS v x) ;
|
||||
RPredVV np v x = RelVP np (ComplVV v x) ;
|
||||
RPredVQ np v x = RelVP np (ComplVQ v x) ;
|
||||
RPredVA np v x = RelVP np (ComplVA v x) ;
|
||||
RPredV2A np v x y = RelVP np (ComplV2A v x y) ;
|
||||
RPredSubjV2V np v x y = RelVP np (ComplSubjV2V v x y) ;
|
||||
RPredObjV2V np v x y = RelVP np (ComplObjV2V v x y) ;
|
||||
RPredV2S np v x y = RelVP np (ComplV2S v x y) ;
|
||||
RPredV2Q np v x y = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
RPredAP np v = RelVP np (PredAP v) ;
|
||||
RPredCN np v = RelVP np (PredCN v) ;
|
||||
RPredNP np v = RelVP np (PredNP v) ;
|
||||
RPredAdv np v = RelVP np (PredAdv v) ;
|
||||
|
||||
RPredProgVP np vp = RelVP np (PredProgVP vp) ;
|
||||
|
||||
IPredV v = UseVP (UseV v) ;
|
||||
IPredV2 v x = UseVP (ComplV2 v x) ;
|
||||
IPredPassV v = UseVP (UsePassV v) ;
|
||||
IPredV3 v x y = UseVP (ComplV3 v x y) ;
|
||||
IPredReflV2 v = UseVP (ComplReflV2 v) ;
|
||||
IPredVS v x = UseVP (ComplVS v x) ;
|
||||
IPredVV v x = UseVP (ComplVV v x) ;
|
||||
IPredVQ v x = UseVP (ComplVQ v x) ;
|
||||
IPredVA v x = UseVP (ComplVA v x) ;
|
||||
IPredV2A v x y = UseVP (ComplV2A v x y) ;
|
||||
IPredSubjV2V v x y = UseVP (ComplSubjV2V v x y) ;
|
||||
IPredObjV2V v x y = UseVP (ComplObjV2V v x y) ;
|
||||
IPredV2S v x y = UseVP (ComplV2S v x y) ;
|
||||
IPredV2Q v x y = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
IPredAP v = UseVP (PredAP v) ;
|
||||
IPredCN v = UseVP (PredCN v) ;
|
||||
IPredNP v = UseVP (PredNP v) ;
|
||||
IPredAdv v = UseVP (PredAdv v) ;
|
||||
|
||||
IPredProgVP vp = UseVP (PredProgVP vp) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete ClausePredI of Clause = open Predic in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
|
||||
SPredV np v = SPredVerb Vt_ np (UseV1 v) ComplNil ;
|
||||
SPredV2 np v x = SPredVerb (Vt CtN) np (UseV2 v) (ComplNP x) ;
|
||||
---- SPredV3 np v x y = SPredVerb (VtN CtN) np (UseV3 v) (ComplAdd (Vt CtN) x (ComplNP y)) ;
|
||||
---- SPredVS np v x = SPredVerb (Vt CtS) np (UseVS v) (ComplS x) ;
|
||||
|
||||
-- SPredPassV np v = PredVP np (UsePassV v) ;
|
||||
-- SPredReflV2 np v = PredVP np (ComplReflV2 v) ;
|
||||
{-
|
||||
SPredVV np v x = PredVP np (ComplVV v x) ;
|
||||
SPredVQ np v x = PredVP np (ComplVQ v x) ;
|
||||
SPredVA np v x = PredVP np (ComplVA v x) ;
|
||||
SPredV2A np v x y = PredVP np (ComplV2A v x y) ;
|
||||
SPredSubjV2V np v x y = PredVP np (ComplSubjV2V v x y) ;
|
||||
SPredObjV2V np v x y = PredVP np (ComplObjV2V v x y) ;
|
||||
SPredV2S np v x y = PredVP np (ComplV2S v x y) ;
|
||||
SPredV2Q np v x y = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
SPredAP np v = PredVP np (PredAP v) ;
|
||||
SPredCN np v = PredVP np (PredCN v) ;
|
||||
SPredNP np v = PredVP np (PredNP v) ;
|
||||
SPredAdv np v = PredVP np (PredAdv v) ;
|
||||
|
||||
SPredProgVP np vp = PredVP np (PredProgVP vp) ;
|
||||
|
||||
QPredV np v = IntVP np (UseV v) ;
|
||||
QPredPassV np v = IntVP np (UsePassV v) ;
|
||||
QPredV2 np v x = IntVP np (ComplV2 v x) ;
|
||||
QPredV3 np v x y = IntVP np (ComplV3 v x y) ;
|
||||
QPredReflV2 np v = IntVP np (ComplReflV2 v) ;
|
||||
QPredVS np v x = IntVP np (ComplVS v x) ;
|
||||
QPredVV np v x = IntVP np (ComplVV v x) ;
|
||||
QPredVQ np v x = IntVP np (ComplVQ v x) ;
|
||||
QPredVA np v x = IntVP np (ComplVA v x) ;
|
||||
QPredV2A np v x y = IntVP np (ComplV2A v x y) ;
|
||||
QPredSubjV2V np v x y = IntVP np (ComplSubjV2V v x y) ;
|
||||
QPredObjV2V np v x y = IntVP np (ComplObjV2V v x y) ;
|
||||
QPredV2S np v x y = IntVP np (ComplV2S v x y) ;
|
||||
QPredV2Q np v x y = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
QPredAP np v = IntVP np (PredAP v) ;
|
||||
QPredCN np v = IntVP np (PredCN v) ;
|
||||
QPredNP np v = IntVP np (PredNP v) ;
|
||||
QPredAdv np v = IntVP np (PredAdv v) ;
|
||||
|
||||
QPredProgVP np vp = IntVP np (PredProgVP vp) ;
|
||||
|
||||
RPredV np v = RelVP np (UseV v) ;
|
||||
RPredPassV np v = RelVP np (UsePassV v) ;
|
||||
RPredV2 np v x = RelVP np (ComplV2 v x) ;
|
||||
RPredV3 np v x y = RelVP np (ComplV3 v x y) ;
|
||||
RPredReflV2 np v = RelVP np (ComplReflV2 v) ;
|
||||
RPredVS np v x = RelVP np (ComplVS v x) ;
|
||||
RPredVV np v x = RelVP np (ComplVV v x) ;
|
||||
RPredVQ np v x = RelVP np (ComplVQ v x) ;
|
||||
RPredVA np v x = RelVP np (ComplVA v x) ;
|
||||
RPredV2A np v x y = RelVP np (ComplV2A v x y) ;
|
||||
RPredSubjV2V np v x y = RelVP np (ComplSubjV2V v x y) ;
|
||||
RPredObjV2V np v x y = RelVP np (ComplObjV2V v x y) ;
|
||||
RPredV2S np v x y = RelVP np (ComplV2S v x y) ;
|
||||
RPredV2Q np v x y = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
RPredAP np v = RelVP np (PredAP v) ;
|
||||
RPredCN np v = RelVP np (PredCN v) ;
|
||||
RPredNP np v = RelVP np (PredNP v) ;
|
||||
RPredAdv np v = RelVP np (PredAdv v) ;
|
||||
|
||||
RPredProgVP np vp = RelVP np (PredProgVP vp) ;
|
||||
|
||||
IPredV v = UseVP (UseV v) ;
|
||||
IPredV2 v x = UseVP (ComplV2 v x) ;
|
||||
IPredPassV v = UseVP (UsePassV v) ;
|
||||
IPredV3 v x y = UseVP (ComplV3 v x y) ;
|
||||
IPredReflV2 v = UseVP (ComplReflV2 v) ;
|
||||
IPredVS v x = UseVP (ComplVS v x) ;
|
||||
IPredVV v x = UseVP (ComplVV v x) ;
|
||||
IPredVQ v x = UseVP (ComplVQ v x) ;
|
||||
IPredVA v x = UseVP (ComplVA v x) ;
|
||||
IPredV2A v x y = UseVP (ComplV2A v x y) ;
|
||||
IPredSubjV2V v x y = UseVP (ComplSubjV2V v x y) ;
|
||||
IPredObjV2V v x y = UseVP (ComplObjV2V v x y) ;
|
||||
IPredV2S v x y = UseVP (ComplV2S v x y) ;
|
||||
IPredV2Q v x y = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
IPredAP v = UseVP (PredAP v) ;
|
||||
IPredCN v = UseVP (PredCN v) ;
|
||||
IPredNP v = UseVP (PredNP v) ;
|
||||
IPredAdv v = UseVP (PredAdv v) ;
|
||||
|
||||
IPredProgVP vp = UseVP (PredProgVP vp) ;
|
||||
-}
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
abstract ClauseVP = Rules, Clause, Verbphrase ** {
|
||||
|
||||
fun
|
||||
trCl : Cl -> Cl ;
|
||||
trQCl : QCl -> QCl ;
|
||||
trRCl : RCl -> RCl ;
|
||||
trVCl : VCl -> VCl ;
|
||||
|
||||
def
|
||||
trCl (SPredV np v) = PredVP np (UseV v) ;
|
||||
trCl (SPredPassV np v) = PredVP np (UsePassV v) ;
|
||||
trCl (SPredV2 np v x) = PredVP np (ComplV2 v x) ;
|
||||
trCl (SPredV3 np v x y) = PredVP np (ComplV3 v x y) ;
|
||||
trCl (SPredReflV2 np v) = PredVP np (ComplReflV2 v) ;
|
||||
trCl (SPredVS np v x) = PredVP np (ComplVS v x) ;
|
||||
trCl (SPredVV np v x) = PredVP np (ComplVV v x) ;
|
||||
trCl (SPredVQ np v x) = PredVP np (ComplVQ v x) ;
|
||||
trCl (SPredVA np v x) = PredVP np (ComplVA v x) ;
|
||||
trCl (SPredV2A np v x y) = PredVP np (ComplV2A v x y) ;
|
||||
trCl (SPredSubjV2V np v x y) = PredVP np (ComplSubjV2V v x y) ;
|
||||
trCl (SPredObjV2V np v x y) = PredVP np (ComplObjV2V v x y) ;
|
||||
trCl (SPredV2S np v x y) = PredVP np (ComplV2S v x y) ;
|
||||
trCl (SPredV2Q np v x y) = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
trCl (SPredAP np v) = PredVP np (PredAP v) ;
|
||||
trCl (SPredCN np v) = PredVP np (PredCN v) ;
|
||||
trCl (SPredNP np v) = PredVP np (PredNP v) ;
|
||||
trCl (SPredAdv np v) = PredVP np (PredAdv v) ;
|
||||
|
||||
trCl (SPredProgVP np vp) = PredVP np (PredProgVP vp) ;
|
||||
|
||||
trQCl (QPredV np v) = IntVP np (UseV v) ;
|
||||
trQCl (QPredPassV np v) = IntVP np (UsePassV v) ;
|
||||
trQCl (QPredV2 np v x) = IntVP np (ComplV2 v x) ;
|
||||
trQCl (QPredV3 np v x y) = IntVP np (ComplV3 v x y) ;
|
||||
trQCl (QPredReflV2 np v) = IntVP np (ComplReflV2 v) ;
|
||||
trQCl (QPredVS np v x) = IntVP np (ComplVS v x) ;
|
||||
trQCl (QPredVV np v x) = IntVP np (ComplVV v x) ;
|
||||
trQCl (QPredVQ np v x) = IntVP np (ComplVQ v x) ;
|
||||
trQCl (QPredVA np v x) = IntVP np (ComplVA v x) ;
|
||||
trQCl (QPredV2A np v x y) = IntVP np (ComplV2A v x y) ;
|
||||
trQCl (QPredSubjV2V np v x y) = IntVP np (ComplSubjV2V v x y) ;
|
||||
trQCl (QPredObjV2V np v x y) = IntVP np (ComplObjV2V v x y) ;
|
||||
trQCl (QPredV2S np v x y) = IntVP np (ComplV2S v x y) ;
|
||||
trQCl (QPredV2Q np v x y) = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
trQCl (QPredAP np v) = IntVP np (PredAP v) ;
|
||||
trQCl (QPredCN np v) = IntVP np (PredCN v) ;
|
||||
trQCl (QPredNP np v) = IntVP np (PredNP v) ;
|
||||
trQCl (QPredAdv np v) = IntVP np (PredAdv v) ;
|
||||
|
||||
trQCl (QPredProgVP np vp) = IntVP np (PredProgVP vp) ;
|
||||
|
||||
trRCl (RPredV np v) = RelVP np (UseV v) ;
|
||||
trRCl (RPredPassV np v) = RelVP np (UsePassV v) ;
|
||||
trRCl (RPredV2 np v x) = RelVP np (ComplV2 v x) ;
|
||||
trRCl (RPredV3 np v x y) = RelVP np (ComplV3 v x y) ;
|
||||
trRCl (RPredReflV2 np v) = RelVP np (ComplReflV2 v) ;
|
||||
trRCl (RPredVS np v x) = RelVP np (ComplVS v x) ;
|
||||
trRCl (RPredVV np v x) = RelVP np (ComplVV v x) ;
|
||||
trRCl (RPredVQ np v x) = RelVP np (ComplVQ v x) ;
|
||||
trRCl (RPredVA np v x) = RelVP np (ComplVA v x) ;
|
||||
trRCl (RPredV2A np v x y) = RelVP np (ComplV2A v x y) ;
|
||||
trRCl (RPredSubjV2V np v x y) = RelVP np (ComplSubjV2V v x y) ;
|
||||
trRCl (RPredObjV2V np v x y) = RelVP np (ComplObjV2V v x y) ;
|
||||
trRCl (RPredV2S np v x y) = RelVP np (ComplV2S v x y) ;
|
||||
trRCl (RPredV2Q np v x y) = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
trRCl (RPredAP np v) = RelVP np (PredAP v) ;
|
||||
trRCl (RPredCN np v) = RelVP np (PredCN v) ;
|
||||
trRCl (RPredNP np v) = RelVP np (PredNP v) ;
|
||||
trRCl (RPredAdv np v) = RelVP np (PredAdv v) ;
|
||||
|
||||
trRCl (RPredProgVP np vp) = RelVP np (PredProgVP vp) ;
|
||||
|
||||
trVCl (IPredV v) = UseVP (UseV v) ;
|
||||
trVCl (IPredV2 v x) = UseVP (ComplV2 v x) ;
|
||||
trVCl (IPredPassV v) = UseVP (UsePassV v) ;
|
||||
trVCl (IPredV3 v x y) = UseVP (ComplV3 v x y) ;
|
||||
trVCl (IPredReflV2 v) = UseVP (ComplReflV2 v) ;
|
||||
trVCl (IPredVS v x) = UseVP (ComplVS v x) ;
|
||||
trVCl (IPredVV v x) = UseVP (ComplVV v x) ;
|
||||
trVCl (IPredVQ v x) = UseVP (ComplVQ v x) ;
|
||||
trVCl (IPredVA v x) = UseVP (ComplVA v x) ;
|
||||
trVCl (IPredV2A v x y) = UseVP (ComplV2A v x y) ;
|
||||
trVCl (IPredSubjV2V v x y) = UseVP (ComplSubjV2V v x y) ;
|
||||
trVCl (IPredObjV2V v x y) = UseVP (ComplObjV2V v x y) ;
|
||||
trVCl (IPredV2S v x y) = UseVP (ComplV2S v x y) ;
|
||||
trVCl (IPredV2Q v x y) = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
trVCl (IPredAP v) = UseVP (PredAP v) ;
|
||||
trVCl (IPredCN v) = UseVP (PredCN v) ;
|
||||
trVCl (IPredNP v) = UseVP (PredNP v) ;
|
||||
trVCl (IPredAdv v) = UseVP (PredAdv v) ;
|
||||
|
||||
trVCl (IPredProgVP vp) = UseVP (PredProgVP vp) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
trRCl (IntVP) = intVerbPhrase ;
|
||||
trRCl (RelVP) = relVerbPhrase ;
|
||||
|
||||
|
||||
trRCl (PosVP tp) = predVerbGroup True tp.a ;
|
||||
trRCl (NegVP tp) = predVerbGroup False tp.a ;
|
||||
|
||||
trRCl (AdvVP) = adVerbPhrase ;
|
||||
trRCl (SubjVP) = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
61
lib/resource/abstract/Common.gf
Normal file
61
lib/resource/abstract/Common.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
--1 Common: Structures with Common Implementations.
|
||||
|
||||
-- This module defines the categories that uniformly have the linearization
|
||||
-- ${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
|
||||
-- forms of sentences. Together they give 4 x 2 x 2 = 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 in [``ExtraRomance`` ../romance/ExtraRomance.gf].
|
||||
|
||||
abstract Common = {
|
||||
|
||||
cat
|
||||
|
||||
--2 Top-level units
|
||||
|
||||
-- Constructed in [``Text`` Text.html]: $Text$.
|
||||
|
||||
Text ; -- text consisting of several phrases e.g. "He is here. Why?"
|
||||
|
||||
-- Constructed in [``Phrase`` Phrase.html]:
|
||||
|
||||
Phr ; -- phrase in a text e.g. "but be quiet please"
|
||||
Utt ; -- sentence, question, word... e.g. "be quiet"
|
||||
Voc ; -- vocative or "please" e.g. "my darling"
|
||||
PConj ; -- phrase-beginning conj. e.g. "therefore"
|
||||
|
||||
-- Constructed in [``Sentence`` Sentence.html]:
|
||||
|
||||
SC ; -- embedded sentence or question e.g. "that it rains"
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Constructed in [``Adverb`` Adverb.html].
|
||||
-- Many adverbs are constructed in [``Structural`` Structural.html].
|
||||
|
||||
Adv ; -- verb-phrase-modifying adverb, e.g. "in the house"
|
||||
AdV ; -- adverb directly attached to verb e.g. "always"
|
||||
AdA ; -- adjective-modifying adverb, e.g. "very"
|
||||
AdN ; -- numeral-modifying adverb, e.g. "more than"
|
||||
IAdv ; -- interrogative adverb e.g. "why"
|
||||
CAdv ; -- comparative adverb e.g. "more"
|
||||
|
||||
--2 Tense, polarity, and anteriority
|
||||
|
||||
Tense ; -- tense: present, past, future, conditional
|
||||
Pol ; -- polarity: positive, negative
|
||||
Ant ; -- anteriority: simultaneous, anterior
|
||||
|
||||
fun
|
||||
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
|
||||
|
||||
}
|
||||
52
lib/resource/abstract/Conjunction.gf
Normal file
52
lib/resource/abstract/Conjunction.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
--1 Conjunction: Coordination
|
||||
|
||||
-- Coordination is defined for many different categories; here is
|
||||
-- a sample. The rules apply to *lists* of two or more elements,
|
||||
-- and define two general patterns:
|
||||
-- - ordinary conjunction: X,...X and X
|
||||
-- - distributed conjunction: both X,...,X and X
|
||||
--
|
||||
--
|
||||
-- $VP$ conjunctions are not covered here, because their applicability
|
||||
-- depends on language. Some special cases are defined in
|
||||
-- [``Extra`` ../abstract/Extra.gf].
|
||||
|
||||
|
||||
abstract Conjunction = Cat ** {
|
||||
|
||||
--2 Rules
|
||||
|
||||
fun
|
||||
ConjS : Conj -> [S] -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> [AP] -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> [NP] -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> [Adv] -> Adv ; -- "quickly or slowly"
|
||||
|
||||
DConjS : DConj -> [S] -> S ; -- "either John walks or Mary runs"
|
||||
DConjAP : DConj -> [AP] -> AP ; -- "both even and prime"
|
||||
DConjNP : DConj -> [NP] -> NP ; -- "either John or Mary"
|
||||
DConjAdv : DConj -> [Adv] -> Adv; -- "both badly and slowly"
|
||||
|
||||
--2 Categories
|
||||
|
||||
-- These categories are only used in this module.
|
||||
|
||||
cat
|
||||
[S]{2} ;
|
||||
[Adv]{2} ;
|
||||
[NP]{2} ;
|
||||
[AP]{2} ;
|
||||
|
||||
--2 List constructors
|
||||
|
||||
-- The list constructors are derived from the list notation and therefore
|
||||
-- not given explicitly. But here are their type signatures:
|
||||
|
||||
-- BaseC : C -> C -> [C] ; -- for C = S, AP, NP, Adv
|
||||
-- ConsC : C -> [C] -> [C] ;
|
||||
}
|
||||
|
||||
--.
|
||||
-- *Note*. This module uses right-recursive lists. If backward
|
||||
-- compatibility with API 0.9 is needed, use
|
||||
-- [SeqConjunction SeqConjunction.html].
|
||||
@@ -1,23 +0,0 @@
|
||||
abstract Country = {
|
||||
|
||||
cat
|
||||
Country ; Nationality ; Language ;
|
||||
fun
|
||||
Denmark,
|
||||
England,
|
||||
Finland,
|
||||
France,
|
||||
Germany,
|
||||
Italy,
|
||||
Norway,
|
||||
Russia,
|
||||
Spain,
|
||||
Sweden
|
||||
: Country ;
|
||||
Danish,
|
||||
English
|
||||
: Nationality ;
|
||||
DanishLang,
|
||||
EnglishLang
|
||||
: Language ;
|
||||
} ;
|
||||
@@ -1,56 +0,0 @@
|
||||
interface DemRes = open Prelude, Resource in {
|
||||
|
||||
oper
|
||||
Pointing = {s5 : Str} ;
|
||||
|
||||
noPointing : Pointing = {s5 = []} ;
|
||||
|
||||
mkDemS : Cl -> DemAdverb -> Pointing -> MultiSentence = \cl,adv,p ->
|
||||
{s = table {
|
||||
MInd b => msS (UseCl (polar b) (AdvCl cl adv)) ;
|
||||
MQuest b => msQS (UseQCl (polar b) (QuestCl (AdvCl cl adv)))
|
||||
} ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
|
||||
polar : Bool -> TP = \b -> case b of {
|
||||
True => PosTP TPresent ASimul ;
|
||||
False => NegTP TPresent ASimul
|
||||
} ;
|
||||
|
||||
mkDemQ : QCl -> DemAdverb -> Pointing -> MultiQuestion = \cl,adv,p ->
|
||||
{s = \\b => msQS (UseQCl (polar b) cl) ++ adv.s ; --- (AdvQCl cl adv)) ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
mkDemImp : VCl -> DemAdverb -> Pointing -> MultiImperative = \cl,adv,p ->
|
||||
{s = table {
|
||||
True => msImp (PosImpVP cl) ++ adv.s ;
|
||||
False => msImp (NegImpVP cl) ++ adv.s
|
||||
} ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
|
||||
msS : S -> Str ;
|
||||
msQS : QS -> Str ;
|
||||
msImp : Imp -> Str ;
|
||||
|
||||
concatDem : (x,y : Pointing) -> Pointing = \x,y -> {
|
||||
s5 = x.s5 ++ y.s5
|
||||
} ;
|
||||
|
||||
mkDemType : Type -> Type = \t -> t ** Pointing ;
|
||||
|
||||
MultiSentence : Type = mkDemType {s : MSForm => Str} ;
|
||||
MultiQuestion : Type = mkDemType {s : Bool => Str} ;
|
||||
MultiImperative : Type = mkDemType {s : Bool => Str} ;
|
||||
|
||||
Demonstrative : Type = mkDemType NP ;
|
||||
DemAdverb : Type = mkDemType Adv ;
|
||||
|
||||
mkDAdv : Adv -> Pointing -> DemAdverb = \a,p ->
|
||||
a ** p ** {lock_Adv = a.lock_Adv} ;
|
||||
|
||||
param
|
||||
MSForm = MInd Bool | MQuest Bool ;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
abstract Demonstrative = Categories ** {
|
||||
|
||||
cat
|
||||
MS ; -- multimodal sentence or question
|
||||
MQS ; -- multimodal wh question
|
||||
MImp ; -- multimodal imperative
|
||||
DNP ; -- demonstrative noun phrase
|
||||
DAdv ; -- demonstrative adverbial
|
||||
[DAdv] ; -- list of demonstrative adverbials
|
||||
Point ; -- pointing gesture
|
||||
|
||||
fun
|
||||
MkPoint : String -> Point ;
|
||||
|
||||
DemV : V -> DNP -> [DAdv] -> MS ; -- this flies (here)
|
||||
DemV2 : V2 -> DNP -> DNP -> [DAdv] -> MS ; -- this takes that
|
||||
ModDemV : VV -> V -> DNP -> [DAdv] -> MS ; -- this wants to fly
|
||||
ModDemV2 : VV -> V2 -> DNP -> DNP -> [DAdv] -> MS ; -- this wants to take that
|
||||
|
||||
ImpDemV : V -> [DAdv] -> MImp ; -- fly (here)
|
||||
ImpDemV2 : V2 -> DNP -> [DAdv] -> MImp ; -- take that
|
||||
|
||||
QDemV : V -> IP -> [DAdv] -> MQS ; -- who flies (here)
|
||||
QDemV2 : V2 -> IP -> DNP -> [DAdv] -> MQS ; -- who takes that
|
||||
QDemSlashV2 : V2 -> DNP -> IP -> [DAdv] -> MQS ; -- whom does that take
|
||||
QModDemV : VV -> V -> IP -> [DAdv] -> MQS ; -- who wants to fly (here)
|
||||
QModDemV2 : VV -> V2 -> IP -> DNP -> [DAdv] -> MQS ; -- who wants to take that
|
||||
QModDemSlashV2 : VV -> V2 -> DNP -> IP -> [DAdv] -> MQS ; -- whom does that want to take
|
||||
|
||||
this_DNP : Point -> DNP ; -- this
|
||||
that_DNP : Point -> DNP ; -- that
|
||||
thisDet_DNP : Point -> CN -> DNP ; -- this car
|
||||
thatDet_DNP : Point -> CN -> DNP ; -- that car
|
||||
|
||||
here_DAdv : Point -> DAdv ; -- here
|
||||
here7from_DAdv : Point -> DAdv ; -- from here
|
||||
here7to_DAdv : Point -> DAdv ; -- to here
|
||||
|
||||
PrepDNP : Prep -> DNP -> DAdv ;
|
||||
|
||||
-- to test
|
||||
|
||||
point1, point2 : Point ;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete DemonstrativeI of Demonstrative =
|
||||
open Prelude, Resource, Basic, DemRes in {
|
||||
|
||||
lincat
|
||||
MS = MultiSentence ;
|
||||
MQS = MultiQuestion ;
|
||||
MImp = MultiImperative ;
|
||||
DNP = Demonstrative ;
|
||||
DAdv = DemAdverb ;
|
||||
[DAdv] = DemAdverb ;
|
||||
Point = Pointing ;
|
||||
|
||||
lin
|
||||
MkPoint s = {s5 = s.s} ;
|
||||
|
||||
DemV verb dem adv =
|
||||
mkDemS (SPredV dem verb) adv dem ;
|
||||
DemV2 verb su ob adv =
|
||||
mkDemS (SPredV2 su verb ob) adv (concatDem su ob) ;
|
||||
ModDemV vv verb dem adv =
|
||||
mkDemS (SPredVV dem vv (UseVCl PPos ASimul (IPredV verb))) adv dem ;
|
||||
ModDemV2 vv verb su ob adv =
|
||||
mkDemS (SPredVV su vv (UseVCl PPos ASimul (IPredV2 verb ob))) adv (concatDem su ob) ;
|
||||
|
||||
ImpDemV verb adv =
|
||||
mkDemImp (IPredV verb) adv noPointing ;
|
||||
ImpDemV2 verb ob adv =
|
||||
mkDemImp (IPredV2 verb ob) adv ob ;
|
||||
|
||||
QDemV verb ip adv =
|
||||
mkDemQ (QPredV ip verb) adv noPointing ;
|
||||
QDemV2 verb ip ob adv =
|
||||
mkDemQ (QPredV2 ip verb ob) adv ob ;
|
||||
QDemSlashV2 verb su ip adv =
|
||||
mkDemQ (IntSlash ip (SlashV2 su verb)) adv su ;
|
||||
QModDemV vv verb ip adv =
|
||||
mkDemQ (QPredVV ip vv (UseVCl PPos ASimul (IPredV verb))) adv noPointing ;
|
||||
QModDemV2 vv verb ip ob adv =
|
||||
mkDemQ (QPredVV ip vv (UseVCl PPos ASimul (IPredV2 verb ob))) adv ob ;
|
||||
QModDemSlashV2 vv verb su ip adv =
|
||||
mkDemQ (IntSlash ip (SlashVV2 su vv verb)) adv su ;
|
||||
|
||||
this_DNP p = this_NP ** p ;
|
||||
that_DNP p = that_NP ** p ;
|
||||
thisDet_DNP p cn = DetNP this_Det cn ** p ;
|
||||
thatDet_DNP p cn = DetNP that_Det cn ** p ;
|
||||
|
||||
here_DAdv p = mkDAdv here_Adv p ;
|
||||
here7from_DAdv p = mkDAdv here7from_Adv p ;
|
||||
here7to_DAdv p = mkDAdv here7to_Adv p ;
|
||||
|
||||
BaseDAdv = {s,s5 = [] ; lock_Adv = <>} ;
|
||||
ConsDAdv a as = {s = a.s ++ as.s ; s5 = a.s5 ++ as.s5 ; lock_Adv = <>} ;
|
||||
|
||||
PrepDNP p np = mkDAdv (AdvPP (PrepNP p np)) np ;
|
||||
|
||||
point1 = {s5 = "p1"} ;
|
||||
point2 = {s5 = "p2"} ;
|
||||
|
||||
}
|
||||
30
lib/resource/abstract/Extra.gf
Normal file
30
lib/resource/abstract/Extra.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--1 More syntax rules
|
||||
|
||||
-- This module defines syntax rules that are not implemented in all
|
||||
-- languages, but in more than one, so that it makes sense to offer a
|
||||
-- common API.
|
||||
|
||||
abstract Extra = Cat ** {
|
||||
|
||||
fun
|
||||
GenNP : NP -> Quant ; -- this man's
|
||||
ComplBareVS : VS -> S -> VP ; -- know you go
|
||||
|
||||
StrandRelSlash : RP -> Slash -> RCl ; -- that he lives in
|
||||
EmptyRelSlash : RP -> Slash -> RCl ; -- he lives in
|
||||
StrandQuestSlash : IP -> Slash -> QCl ; -- whom does John live with
|
||||
|
||||
-- $VP$ conjunction, which has different fragments implemented in
|
||||
-- different languages - never a full $VP$, though.
|
||||
|
||||
cat
|
||||
VPI ;
|
||||
[VPI] {2} ;
|
||||
|
||||
fun
|
||||
MkVPI : VP -> VPI ;
|
||||
ConjVPI : Conj -> [VPI] -> VPI ;
|
||||
ComplVPIVV : VV -> VPI -> VP ;
|
||||
|
||||
|
||||
}
|
||||
21
lib/resource/abstract/Grammar.gf
Normal file
21
lib/resource/abstract/Grammar.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
--1 Grammar: the Main Module of the Resource Grammar
|
||||
|
||||
-- This grammar is a collection of the different grammar modules,
|
||||
-- To test the resource, import [``Lang`` Lang.html], which also contains
|
||||
-- a lexicon.
|
||||
|
||||
abstract Grammar =
|
||||
Noun,
|
||||
Verb,
|
||||
Adjective,
|
||||
Adverb,
|
||||
Numeral,
|
||||
Sentence,
|
||||
Question,
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Text,
|
||||
Structural,
|
||||
Idiom
|
||||
** {} ;
|
||||
22
lib/resource/abstract/Idiom.gf
Normal file
22
lib/resource/abstract/Idiom.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--1 Idiom: Idiomatic Expressions
|
||||
|
||||
abstract Idiom = Cat ** {
|
||||
|
||||
-- This module defines constructions that are formed in fixed ways,
|
||||
-- often different even in closely related languages.
|
||||
|
||||
fun
|
||||
ImpersCl : VP -> Cl ; -- it rains
|
||||
GenericCl : VP -> Cl ; -- one sleeps
|
||||
|
||||
CleftNP : NP -> RS -> Cl ; -- it is you who did it
|
||||
CleftAdv : Adv -> S -> Cl ; -- it is yesterday she arrived
|
||||
|
||||
ExistNP : NP -> Cl ; -- there is a house
|
||||
ExistIP : IP -> QCl ; -- which houses are there
|
||||
|
||||
ProgrVP : VP -> VP ; -- be sleeping
|
||||
|
||||
ImpPl1 : VP -> Utt ; -- let's go
|
||||
|
||||
}
|
||||
@@ -1,31 +1,11 @@
|
||||
--# -path=.:../../prelude
|
||||
--1 Lang: a Test Module for the Resource Grammar
|
||||
|
||||
-- This grammar is for testing the resource as included in the
|
||||
-- language-independent API, consisting of a grammar and a lexicon.
|
||||
-- The grammar without a lexicon is [``Grammar`` Grammar.html],
|
||||
-- which may be more suitable to open in applications.
|
||||
|
||||
abstract Lang =
|
||||
Rules,
|
||||
Clause,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country,
|
||||
Math
|
||||
|
||||
** {
|
||||
|
||||
flags startcat=Phr ;
|
||||
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
Grammar,
|
||||
Lexicon
|
||||
** {} ;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
-- alternative API that is able to return VP's by parsing with Cl
|
||||
-- constructors and then computing. AR 14/11/2005
|
||||
--
|
||||
-- to import: 'i -noparse=vp.gfnoparse LangVPEng'
|
||||
-- to use: 'p -cat=Cl "I see her" | wt -c trCl'
|
||||
|
||||
abstract LangVP =
|
||||
Lang,
|
||||
Verbphrase,
|
||||
ClauseVP ** {
|
||||
} ;
|
||||
@@ -1,33 +1,47 @@
|
||||
abstract Basic = Categories ** {
|
||||
fun
|
||||
abstract Lexicon = Cat ** {
|
||||
fun
|
||||
add_V3 : V3 ;
|
||||
airplane_N : N ;
|
||||
answer_V2S : V2S ;
|
||||
already_Adv : Adv ;
|
||||
animal_N : N ;
|
||||
answer_V2S : V2 ;
|
||||
apartment_N : N ;
|
||||
apple_N : N ;
|
||||
art_N : N ;
|
||||
ask_V2Q : V2Q ;
|
||||
ashes_N : N ;
|
||||
ask_V2Q : V2 ;
|
||||
baby_N : N ;
|
||||
bad_ADeg : ADeg ;
|
||||
back_N : N ;
|
||||
bad_A : A ;
|
||||
bank_N : N ;
|
||||
beautiful_ADeg : ADeg ;
|
||||
bark_N : N ;
|
||||
beautiful_A : A ;
|
||||
become_VA : VA ;
|
||||
beer_N : N ;
|
||||
beg_V2V : V2V ;
|
||||
big_ADeg : ADeg ;
|
||||
beg_V2V : V2 ;
|
||||
belly_N : N ;
|
||||
big_A : A ;
|
||||
bike_N : N ;
|
||||
bird_N : N ;
|
||||
black_ADeg : ADeg ;
|
||||
blue_ADeg : ADeg ;
|
||||
bite_V2 : V2 ;
|
||||
black_A : A ;
|
||||
blood_N : N ;
|
||||
blow_V : V ;
|
||||
blue_A : A ;
|
||||
boat_N : N ;
|
||||
bone_N : N ;
|
||||
book_N : N ;
|
||||
boot_N : N ;
|
||||
boss_N : N ;
|
||||
boy_N : N ;
|
||||
bread_N : N ;
|
||||
break_V2 : V2 ;
|
||||
broad_ADeg : ADeg ;
|
||||
breast_N : N ;
|
||||
breathe_V : V ;
|
||||
broad_A : A ;
|
||||
brother_N2 : N2 ;
|
||||
brown_ADeg : ADeg ;
|
||||
brown_A : A ;
|
||||
burn_V : V ;
|
||||
butter_N : N ;
|
||||
buy_V2 : V2 ;
|
||||
camera_N : N ;
|
||||
@@ -41,183 +55,298 @@ abstract Basic = Categories ** {
|
||||
child_N : N ;
|
||||
church_N : N ;
|
||||
city_N : N ;
|
||||
clean_ADeg : ADeg ;
|
||||
clever_ADeg : ADeg ;
|
||||
clean_A : A ;
|
||||
clever_A : A ;
|
||||
close_V2 : V2 ;
|
||||
cloud_N : N ;
|
||||
coat_N : N ;
|
||||
cold_ADeg : ADeg ;
|
||||
cold_A : A ;
|
||||
come_V : V ;
|
||||
computer_N : N ;
|
||||
correct_A : A ;
|
||||
country_N : N ;
|
||||
count_V2 : V2 ;
|
||||
cousin_N : N ;
|
||||
cow_N : N ;
|
||||
cut_V2 : V2 ;
|
||||
day_N : N ;
|
||||
die_V : V ;
|
||||
dirty_ADeg : ADeg ;
|
||||
dig_V : V ;
|
||||
dirty_A : A ;
|
||||
distance_N3 : N3 ;
|
||||
doctor_N : N ;
|
||||
dog_N : N ;
|
||||
door_N : N ;
|
||||
do_V2 : V2 ;
|
||||
drink_V2 : V2 ;
|
||||
easy_A2V : A2V ;
|
||||
drink_V2 : V2 ;
|
||||
dry_A : A ;
|
||||
dull_A : A ;
|
||||
dust_N : N ;
|
||||
ear_N : N ;
|
||||
earth_N : N ;
|
||||
easy_A2V : A2 ;
|
||||
eat_V2 : V2 ;
|
||||
eat_V2 : V2 ;
|
||||
egg_N : N ;
|
||||
empty_A : A ;
|
||||
enemy_N : N ;
|
||||
empty_ADeg : ADeg ;
|
||||
eye_N : N ;
|
||||
factory_N : N ;
|
||||
fall_V : V ;
|
||||
far_Adv : Adv ;
|
||||
father_N2 : N2 ;
|
||||
fat_N : N ;
|
||||
fear_VS : VS ;
|
||||
fear_V2 : V2 ;
|
||||
feather_N : N ;
|
||||
fight_V2 : V2 ;
|
||||
find_V2 : V2 ;
|
||||
fingernail_N : N ;
|
||||
fire_N : N ;
|
||||
fish_N : N ;
|
||||
float_V : V ;
|
||||
floor_N : N ;
|
||||
flower_N : N ;
|
||||
flow_V : V ;
|
||||
fly_V : V ;
|
||||
fog_N : N ;
|
||||
foot_N : N ;
|
||||
forest_N : N ;
|
||||
forget_V2 : V2 ;
|
||||
freeze_V : V ;
|
||||
fridge_N : N ;
|
||||
friend_N : N ;
|
||||
fruit_N : N ;
|
||||
fun_AV : AV ;
|
||||
full_A : A ;
|
||||
fun
|
||||
fun_AV : A ;
|
||||
garden_N : N ;
|
||||
girl_N : N ;
|
||||
give_V3 : V3 ;
|
||||
glove_N : N ;
|
||||
gold_N : N ;
|
||||
good_ADeg : ADeg ;
|
||||
good_A : A ;
|
||||
go_V : V ;
|
||||
green_ADeg : ADeg ;
|
||||
grammar_N : N ;
|
||||
grass_N : N ;
|
||||
green_A : A ;
|
||||
guts_N : N ;
|
||||
hair_N : N ;
|
||||
hand_N : N ;
|
||||
harbour_N : N ;
|
||||
hate_V2 : V2 ;
|
||||
hat_N : N ;
|
||||
have_V2 : V2 ;
|
||||
head_N : N ;
|
||||
heart_N : N ;
|
||||
hear_V2 : V2 ;
|
||||
hear_V2 : V2 ;
|
||||
heavy_A : A ;
|
||||
hill_N : N ;
|
||||
hit_V2 : V2 ;
|
||||
hold_V2 : V2 ;
|
||||
hope_VS : VS ;
|
||||
horn_N : N ;
|
||||
horse_N : N ;
|
||||
hot_ADeg : ADeg ;
|
||||
hot_A : A ;
|
||||
house_N : N ;
|
||||
important_ADeg : ADeg ;
|
||||
hunt_V2 : V2 ;
|
||||
husband_N : N ;
|
||||
ice_N : N ;
|
||||
important_A : A ;
|
||||
industry_N : N ;
|
||||
iron_N : N ;
|
||||
jump_V : V ;
|
||||
kill_V2 : V2 ;
|
||||
king_N : N ;
|
||||
knee_N : N ;
|
||||
know_V2 : V2 ;
|
||||
know_V2 : V2 ;
|
||||
lake_N : N ;
|
||||
lamp_N : N ;
|
||||
language_N : N ;
|
||||
laugh_V : V ;
|
||||
leaf_N : N ;
|
||||
learn_V2 : V2 ;
|
||||
leather_N : N ;
|
||||
leave_V2 : V2 ;
|
||||
left_Ord : Ord ;
|
||||
leg_N : N ;
|
||||
lie_V : V ;
|
||||
like_V2 : V2 ;
|
||||
listen_V2 : V2 ;
|
||||
liver_N : N ;
|
||||
live_V : V ;
|
||||
long_ADeg : ADeg ;
|
||||
long_A : A ;
|
||||
lose_V2 : V2 ;
|
||||
louse_N : N ;
|
||||
love_N : N ;
|
||||
love_V2 : V2 ;
|
||||
man_N : N ;
|
||||
married_A2 : A2 ;
|
||||
meat_N : N ;
|
||||
meat_N : N ;
|
||||
milk_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
mountain_N : N ;
|
||||
mouth_N : N ;
|
||||
music_N : N ;
|
||||
narrow_ADeg : ADeg ;
|
||||
new_ADeg : ADeg ;
|
||||
name_N : N ;
|
||||
narrow_A : A ;
|
||||
near_A : A ;
|
||||
neck_N : N ;
|
||||
new_A : A ;
|
||||
newspaper_N : N ;
|
||||
night_N : N ;
|
||||
nose_N : N ;
|
||||
now_Adv : Adv ;
|
||||
number_N : N ;
|
||||
oil_N : N ;
|
||||
old_ADeg : ADeg ;
|
||||
old_A : A ;
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
paris_PN : PN ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
person_N : N ;
|
||||
planet_N : N ;
|
||||
plastic_N : N ;
|
||||
play_V2 : V2 ;
|
||||
play_V : V ;
|
||||
policeman_N : N ;
|
||||
priest_N : N ;
|
||||
probable_AS : AS ;
|
||||
probable_AS : A ;
|
||||
pull_V2 : V2 ;
|
||||
push_V2 : V2 ;
|
||||
put_V2 : V2 ;
|
||||
queen_N : N ;
|
||||
radio_N : N ;
|
||||
rain_V0 : V0 ;
|
||||
rain_N : N ;
|
||||
rain_V0 : V ;
|
||||
read_V2 : V2 ;
|
||||
red_ADeg : ADeg ;
|
||||
red_A : A ;
|
||||
religion_N : N ;
|
||||
restaurant_N : N ;
|
||||
right_Ord : Ord ;
|
||||
river_N : N ;
|
||||
road_N : N ;
|
||||
rock_N : N ;
|
||||
roof_N : N ;
|
||||
root_N : N ;
|
||||
rope_N : N ;
|
||||
rotten_A : A ;
|
||||
round_A : A ;
|
||||
rubber_N : N ;
|
||||
rub_V2 : V2 ;
|
||||
rule_N : N ;
|
||||
run_V : V ;
|
||||
salt_N : N ;
|
||||
sand_N : N ;
|
||||
say_VS : VS ;
|
||||
school_N : N ;
|
||||
science_N : N ;
|
||||
scratch_V2 : V2 ;
|
||||
sea_N : N ;
|
||||
seed_N : N ;
|
||||
seek_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
sell_V3 : V3 ;
|
||||
send_V3 : V3 ;
|
||||
sew_V : V ;
|
||||
sharp_A : A ;
|
||||
sheep_N : N ;
|
||||
ship_N : N ;
|
||||
shirt_N : N ;
|
||||
shoe_N : N ;
|
||||
shop_N : N ;
|
||||
short_ADeg : ADeg ;
|
||||
short_A : A ;
|
||||
silver_N : N ;
|
||||
sing_V : V ;
|
||||
sister_N : N ;
|
||||
sit_V : V ;
|
||||
skin_N : N ;
|
||||
sky_N : N ;
|
||||
sleep_V : V ;
|
||||
small_ADeg : ADeg ;
|
||||
small_A : A ;
|
||||
smell_V : V ;
|
||||
smoke_N : N ;
|
||||
smooth_A : A ;
|
||||
snake_N : N ;
|
||||
snow_N : N ;
|
||||
sock_N : N ;
|
||||
song_N : N ;
|
||||
speak_V2 : V2 ;
|
||||
spit_V : V ;
|
||||
split_V2 : V2 ;
|
||||
squeeze_V2 : V2 ;
|
||||
stab_V2 : V2 ;
|
||||
stand_V : V ;
|
||||
star_N : N ;
|
||||
steel_N : N ;
|
||||
stick_N : N ;
|
||||
stone_N : N ;
|
||||
stop_V : V ;
|
||||
stove_N : N ;
|
||||
straight_A : A ;
|
||||
student_N : N ;
|
||||
stupid_ADeg : ADeg ;
|
||||
stupid_A : A ;
|
||||
suck_V2 : V2 ;
|
||||
sun_N : N ;
|
||||
swell_V : V ;
|
||||
swim_V : V ;
|
||||
switch8off_V2 : V2 ;
|
||||
switch8on_V2 : V2 ;
|
||||
table_N : N ;
|
||||
tail_N : N ;
|
||||
talk_V3 : V3 ;
|
||||
teacher_N : N ;
|
||||
teach_V2 : V2 ;
|
||||
television_N : N ;
|
||||
thick_ADeg : ADeg ;
|
||||
thin_ADeg : ADeg ;
|
||||
thick_A : A ;
|
||||
thin_A : A ;
|
||||
think_V : V ;
|
||||
throw_V2 : V2 ;
|
||||
tie_V2 : V2 ;
|
||||
tongue_N : N ;
|
||||
tooth_N : N ;
|
||||
train_N : N ;
|
||||
travel_V : V ;
|
||||
tree_N : N ;
|
||||
---- trousers_N : N ;
|
||||
ugly_ADeg : ADeg ;
|
||||
turn_V : V ;
|
||||
ugly_A : A ;
|
||||
understand_V2 : V2 ;
|
||||
university_N : N ;
|
||||
village_N : N ;
|
||||
vomit_V : V ;
|
||||
wait_V2 : V2 ;
|
||||
walk_V : V ;
|
||||
warm_ADeg : ADeg ;
|
||||
warm_A : A ;
|
||||
war_N : N ;
|
||||
wash_V2 : V2 ;
|
||||
watch_V2 : V2 ;
|
||||
water_N : N ;
|
||||
white_ADeg : ADeg ;
|
||||
water_N : N ;
|
||||
wet_A : A ;
|
||||
white_A : A ;
|
||||
wide_A : A ;
|
||||
wife_N : N ;
|
||||
wind_N : N ;
|
||||
window_N : N ;
|
||||
wine_N : N ;
|
||||
wing_N : N ;
|
||||
win_V2 : V2 ;
|
||||
wipe_V2 : V2 ;
|
||||
woman_N : N ;
|
||||
wonder_VQ : VQ ;
|
||||
wood_N : N ;
|
||||
worm_N : N ;
|
||||
write_V2 : V2 ;
|
||||
yellow_ADeg : ADeg ;
|
||||
young_ADeg : ADeg ;
|
||||
year_N : N ;
|
||||
yellow_A : A ;
|
||||
young_A : A ;
|
||||
|
||||
do_V2 : V2 ;
|
||||
now_Adv : Adv ;
|
||||
already_Adv : Adv ;
|
||||
song_N : N ;
|
||||
add_V3 : V3 ;
|
||||
number_N : N ;
|
||||
put_V2 : V2 ;
|
||||
stop_V : V ;
|
||||
jump_V : V ;
|
||||
here_Adv : Adv ;
|
||||
here7to_Adv : Adv ;
|
||||
here7from_Adv : Adv ;
|
||||
there_Adv : Adv ;
|
||||
there7to_Adv : Adv ;
|
||||
there7from_Adv : Adv ;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
|
||||
|
||||
abstract Math = Categories ** {
|
||||
|
||||
--3 Noun phrases with symbols
|
||||
|
||||
fun
|
||||
SymbPN : String -> PN ; -- "x"
|
||||
IntPN : Int -> PN ; -- "27"
|
||||
IntNP : CN -> Int -> NP ; -- "level 53"
|
||||
|
||||
IndefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "(2) numbers x and y"
|
||||
DefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "the (2) numbers x and y"
|
||||
NDetSymbNP : NDet -> Num -> CN -> SymbList -> NP ; -- "some (3) points x, y and z"
|
||||
|
||||
--3 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.
|
||||
-- This produces "x, y and z", in English.
|
||||
|
||||
cat
|
||||
SymbList ;
|
||||
|
||||
fun
|
||||
SymbTwo : String -> String -> SymbList ;
|
||||
SymbMore : String -> SymbList -> SymbList ;
|
||||
|
||||
--3 Special forms of expression
|
||||
|
||||
-- This expression form is typical of mathematical texts.
|
||||
-- It is realized with different constructs in different languages, typically
|
||||
-- some kind of 3rd person imperative of the verb "be".
|
||||
|
||||
LetImp : NP -> NP -> Imp ; -- let x be a number
|
||||
|
||||
-- This rule is slightly overgenerating: "there exists every number x".
|
||||
-- The problem seems to be of semantic nature. By this we avoid having many rules.
|
||||
|
||||
ExistNP : NP -> Cl ; -- there exist (2) number(s) x and y
|
||||
|
||||
--3 Rules moved from $Rules$.
|
||||
|
||||
-- This rule is powerful but overgenerating.
|
||||
|
||||
SymbCN : CN -> String -> CN ; -- "number x"
|
||||
|
||||
-- This rule is simply wrong, and will be deprecated: the correct
|
||||
-- value type is $NP$.
|
||||
|
||||
IntCN : CN -> Int -> CN ; -- "level 53"
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Minimal = Categories ** {
|
||||
|
||||
-- a minimum sample of lexicon to test resource grammar with
|
||||
|
||||
fun
|
||||
-- nouns: count and mass, relational
|
||||
man_N : N ;
|
||||
wine_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
distance_N3 : N3 ;
|
||||
|
||||
-- proper names
|
||||
john_PN : PN ;
|
||||
|
||||
-- adjectives: with and without degree
|
||||
blue_ADeg : ADeg ;
|
||||
american_A : A ;
|
||||
|
||||
-- adjectives: noun phase, sentence, and verb complements
|
||||
married_A2 : A2 ;
|
||||
probable_AS : AS ;
|
||||
important_A2S : A2S ;
|
||||
easy_A2V : A2V ;
|
||||
|
||||
-- adverbs
|
||||
now_Adv : Adv ;
|
||||
|
||||
-- verbs
|
||||
walk_V : V ;
|
||||
love_V2 : V2 ;
|
||||
give_V3 : V3 ;
|
||||
believe_VS : VS ;
|
||||
try_VV : VV ;
|
||||
wonder_VQ : VQ ;
|
||||
become_VA : VA ;
|
||||
paint_V2A : V2A ;
|
||||
promise_V2V : V2V ;
|
||||
ask_V2Q : V2Q ;
|
||||
tell_V2S : V2S ;
|
||||
rain_V0 : V0 ;
|
||||
} ;
|
||||
@@ -1,30 +0,0 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Multimodal =
|
||||
Rules,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Demonstrative
|
||||
|
||||
** {
|
||||
|
||||
flags startcat=Phr ;
|
||||
|
||||
fun
|
||||
|
||||
-- Interface to $Demonstrative$.
|
||||
|
||||
DemNP : NP -> DNP ;
|
||||
DemAdv : Adv -> DAdv ;
|
||||
SentMS : Pol -> MS -> Phr ;
|
||||
QuestMS : Pol -> MS -> Phr ;
|
||||
QuestMQS : Pol -> MQS -> Phr ;
|
||||
ImpMImp : Pol -> MImp -> Phr ;
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
incomplete concrete MultimodalI of Multimodal =
|
||||
open Prelude, Resource, Basic, Lang, DemRes in {
|
||||
|
||||
lin
|
||||
DemNP np = np ** {s5 = [] ; lock_NP = <>} ;
|
||||
DemAdv adv = mkDAdv (adv ** {lock_Adv = <>}) {s5 = []} ;
|
||||
SentMS p ms = {s = p.s ++ ms.s ! MInd (p.p) ++ ";" ++ ms.s5} ;
|
||||
QuestMS p ms = {s = p.s ++ ms.s ! MQuest (p.p) ++ ";" ++ ms.s5} ;
|
||||
QuestMQS p ms = {s = p.s ++ ms.s ! p.p ++ ";" ++ ms.s5} ;
|
||||
ImpMImp p ms = {s = p.s ++ ms.s ! p.p ++ ";" ++ ms.s5} ;
|
||||
|
||||
AdvDate = AdvDate ;
|
||||
AdvTime = AdvTime ;
|
||||
|
||||
}
|
||||
|
||||
134
lib/resource/abstract/Noun.gf
Normal file
134
lib/resource/abstract/Noun.gf
Normal file
@@ -0,0 +1,134 @@
|
||||
--1 Noun: Nouns, noun phrases, and determiners
|
||||
|
||||
abstract Noun = Cat ** {
|
||||
|
||||
--2 Noun phrases
|
||||
|
||||
-- The three main types of noun phrases are
|
||||
-- - common nouns with determiners
|
||||
-- - proper names
|
||||
-- - pronouns
|
||||
--
|
||||
--
|
||||
fun
|
||||
DetCN : Det -> CN -> NP ; -- the man
|
||||
UsePN : PN -> NP ; -- John
|
||||
UsePron : Pron -> NP ; -- he
|
||||
|
||||
-- Pronouns are defined in the module [``Structural`` Structural.html].
|
||||
|
||||
-- A noun phrase already formed can be modified by a $Predet$erminer.
|
||||
|
||||
PredetNP : Predet -> NP -> NP; -- only the man
|
||||
|
||||
-- A noun phrase can also be postmodified by the past participle of a
|
||||
-- verb or by an adverb.
|
||||
|
||||
PPartNP : NP -> V2 -> NP ; -- the number squared
|
||||
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
|
||||
|
||||
--2 Determiners
|
||||
|
||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||
-- quantifier and two optional parts can be discerned.
|
||||
-- The cardinal numeral is only available for plural determiners.
|
||||
-- (This is modified from CLE by further dividing their $Num$ into
|
||||
-- cardinal and ordinal.)
|
||||
|
||||
DetSg : QuantSg -> Ord -> Det ; -- this best man
|
||||
DetPl : QuantPl -> Num -> Ord -> Det ; -- these five best men
|
||||
|
||||
-- Quantifiers that have both forms can be used in both ways.
|
||||
|
||||
SgQuant : Quant -> QuantSg ; -- this
|
||||
PlQuant : Quant -> QuantPl ; -- these
|
||||
|
||||
-- Pronouns have possessive forms. Genitives of other kinds
|
||||
-- of noun phrases are not given here, since they are not possible
|
||||
-- in e.g. Romance languages. They can be found in
|
||||
-- [``Extra`` ../abstract/Extra.gf].
|
||||
|
||||
PossPron : Pron -> Quant ; -- my (house)
|
||||
|
||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||
-- the "kernel" of a determiner.
|
||||
|
||||
NoNum : Num ;
|
||||
NoOrd : Ord ;
|
||||
|
||||
-- $Num$ consists of either digits or numeral words.
|
||||
|
||||
NumInt : Int -> Num ; -- 51
|
||||
NumNumeral : Numeral -> Num ; -- fifty-one
|
||||
|
||||
-- The construction of numerals is defined in [Numeral Numeral.html].
|
||||
|
||||
-- $Num$ can be modified by certain adverbs.
|
||||
|
||||
AdNum : AdN -> Num -> Num ; -- almost 51
|
||||
|
||||
-- $Ord$ consists of either digits or numeral words.
|
||||
|
||||
OrdInt : Int -> Ord ; -- 51st
|
||||
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||
|
||||
-- Superlative forms of adjectives behave syntactically in the same way as
|
||||
-- ordinals.
|
||||
|
||||
OrdSuperl : A -> Ord ; -- largest
|
||||
|
||||
-- Definite and indefinite constructions are sometimes realized as
|
||||
-- neatly distinct words (Spanish "un, unos ; el, los") but also without
|
||||
-- any particular word (Finnish; Swedish definites).
|
||||
|
||||
DefArt : Quant ; -- the (house), the (houses)
|
||||
IndefArt : Quant ; -- a (house), (houses)
|
||||
|
||||
-- Nouns can be used without an article as mass nouns. The resource does
|
||||
-- not distinguish mass nouns from other common nouns, which can result
|
||||
-- in semantically odd expressions.
|
||||
|
||||
MassDet : QuantSg ; -- (beer)
|
||||
|
||||
-- Other determiners are defined in [Structural Structural.html].
|
||||
|
||||
|
||||
|
||||
--2 Common nouns
|
||||
|
||||
-- Simple nouns can be used as nouns outright.
|
||||
|
||||
UseN : N -> CN ; -- house
|
||||
|
||||
-- Relational nouns take one or two arguments.
|
||||
|
||||
ComplN2 : N2 -> NP -> CN ; -- son of the king
|
||||
ComplN3 : N3 -> NP -> N2 ; -- flight from Moscow (to Paris)
|
||||
|
||||
-- Relational nouns can also be used without their arguments.
|
||||
-- The semantics is typically derivative of the relational meaning.
|
||||
|
||||
UseN2 : N2 -> CN ; -- son
|
||||
UseN3 : N3 -> CN ; -- flight
|
||||
|
||||
-- Nouns can be modified by adjectives, relative clauses, and adverbs
|
||||
-- (the last rule will give rise to many 'PP attachment' ambiguities
|
||||
-- when used in connection with verb phrases).
|
||||
|
||||
AdjCN : AP -> CN -> CN ; -- big house
|
||||
RelCN : CN -> RS -> CN ; -- house that John owns
|
||||
AdvCN : CN -> Adv -> CN ; -- house on the hill
|
||||
|
||||
-- Nouns can also be modified by embedded sentences and questions.
|
||||
-- For some nouns this makes little sense, but we leave this for applications
|
||||
-- to decide. Sentential complements are defined in [Verb Verb.html].
|
||||
|
||||
SentCN : CN -> SC -> CN ; -- fact that John smokes, question if he does
|
||||
|
||||
--2 Apposition
|
||||
|
||||
-- This is certainly overgenerating.
|
||||
|
||||
ApposCN : CN -> NP -> CN ; -- number x, numbers x and y
|
||||
|
||||
} ;
|
||||
@@ -1,11 +1,25 @@
|
||||
-- numerals from 1 to 999999 in decimal notation
|
||||
--1 Numerals
|
||||
|
||||
abstract Numerals = {
|
||||
-- This grammar defines numerals from 1 to 999999.
|
||||
-- The implementations are adapted from the
|
||||
-- [numerals library http://www.cs.chalmers.se/~aarne/GF/examples/numerals/]
|
||||
-- which defines numerals for 88 languages.
|
||||
-- The resource grammar implementations add to this inflection (if needed)
|
||||
-- and ordinal numbers.
|
||||
--
|
||||
-- *Note* 1. Number 1 as defined
|
||||
-- in the category $Numeral$ here should not be used in the formation of
|
||||
-- noun phrases, and should therefore be removed. Instead, one should use
|
||||
-- [Structural Structural.html]$.one_Quant$. This makes the grammar simpler
|
||||
-- because we can assume that numbers form plural noun phrases.
|
||||
--
|
||||
-- *Note* 2. The implementations introduce spaces between
|
||||
-- parts of a numeral, which is often incorrect - more work on
|
||||
-- (un)lexing is needed to solve this problem.
|
||||
|
||||
flags startcat=Numeral ;
|
||||
abstract Numeral = Cat ** {
|
||||
|
||||
cat
|
||||
Numeral ; -- 0..
|
||||
Digit ; -- 2..9
|
||||
Sub10 ; -- 1..9
|
||||
Sub100 ; -- 1..99
|
||||
@@ -31,4 +45,5 @@ fun
|
||||
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
|
||||
}
|
||||
43
lib/resource/abstract/Phrase.gf
Normal file
43
lib/resource/abstract/Phrase.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
--1 Phrase: Phrases and Utterances
|
||||
|
||||
abstract Phrase = Cat ** {
|
||||
|
||||
-- When a phrase is built from an utterance it can be prefixed
|
||||
-- with a phrasal conjunction (such as "but", "therefore")
|
||||
-- and suffixing with a vocative (typically a noun phrase).
|
||||
|
||||
fun
|
||||
PhrUtt : PConj -> Utt -> Voc -> Phr ; -- But go home my friend.
|
||||
|
||||
-- Utterances are formed from sentences, questions, and imperatives.
|
||||
|
||||
UttS : S -> Utt ; -- John walks
|
||||
UttQS : QS -> Utt ; -- is it good
|
||||
UttImpSg : Pol -> Imp -> Utt; -- (don't) help yourself
|
||||
UttImpPl : Pol -> Imp -> Utt; -- (don't) help yourselves
|
||||
|
||||
-- There are also 'one-word utterances'. A typical use of them is
|
||||
-- as answers to questions.
|
||||
-- *Note*. This list is incomplete. More categories could be covered.
|
||||
-- Moreover, in many languages e.g. noun phrases in different cases
|
||||
-- can be used.
|
||||
|
||||
UttIP : IP -> Utt ; -- who
|
||||
UttIAdv : IAdv -> Utt ; -- why
|
||||
UttNP : NP -> Utt ; -- this man
|
||||
UttAdv : Adv -> Utt ; -- here
|
||||
UttVP : VP -> Utt ; -- to sleep
|
||||
|
||||
-- The phrasal conjunction is optional. A sentence conjunction
|
||||
-- can also used to prefix an utterance.
|
||||
|
||||
NoPConj : PConj ;
|
||||
PConjConj : Conj -> PConj ; -- and
|
||||
|
||||
-- The vocative is optional. Any noun phrase can be made into vocative,
|
||||
-- which may be overgenerating (e.g. "I").
|
||||
|
||||
NoVoc : Voc ;
|
||||
VocNP : NP -> Voc ; -- my friend
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
abstract Predic = Categories ** {
|
||||
|
||||
cat
|
||||
VType ;
|
||||
CType ;
|
||||
Verb VType ;
|
||||
Compl VType ;
|
||||
|
||||
fun
|
||||
Vt_ : VType ;
|
||||
Vt : CType -> VType ;
|
||||
VtN : CType -> VType ;
|
||||
|
||||
CtN, CtS, CtV, CtQ, CtA : CType ;
|
||||
|
||||
SPredVerb : (v : VType) -> NP -> Verb v -> Compl v -> Cl ;
|
||||
|
||||
QPredVerb : (v : VType) -> IP -> Verb v -> Compl v -> QCl ;
|
||||
RPredVerb : (v : VType) -> RP -> Verb v -> Compl v -> RCl ;
|
||||
IPredVerb : (v : VType) -> Verb v -> Compl v -> VCl ;
|
||||
|
||||
Compl_ : Compl Vt_ ;
|
||||
ComplN : NP -> Compl (Vt CtN) ;
|
||||
ComplS : S -> Compl (Vt CtS) ;
|
||||
ComplQ : QS -> Compl (Vt CtQ) ;
|
||||
ComplA : AP -> Compl (Vt CtQ) ;
|
||||
|
||||
ComplAdd : (c : CType) -> NP -> Compl (Vt c) -> Compl (VtN c) ;
|
||||
|
||||
VeV1 : V -> Verb Vt_ ;
|
||||
VeV2 : V2 -> Verb (Vt CtN) ;
|
||||
VeVS : VS -> Verb (Vt CtS) ;
|
||||
VeV3 : V3 -> Verb (VtN CtN) ;
|
||||
VeV2S : V2S -> Verb (VtN CtS) ;
|
||||
VeV2Q : V2Q -> Verb (VtN CtQ) ;
|
||||
---- etc
|
||||
}
|
||||
|
||||
{-
|
||||
MkSlash3 : NG NtS -> VG (VtN CtN) -> CG (Vt CtN) -> Slash ;
|
||||
MkSlash2 : (c : CType) -> NG NtS -> VG (VtN c) -> CG (Vt c) -> Slash ;
|
||||
MkSlash1 : NG NtS -> VG (Vt CtN) -> Slash ;
|
||||
SlashQ : NG NtQ -> Slash -> SG NtQ ;
|
||||
-}
|
||||
29
lib/resource/abstract/Question.gf
Normal file
29
lib/resource/abstract/Question.gf
Normal file
@@ -0,0 +1,29 @@
|
||||
--1 Question: Questions and Interrogative Pronouns
|
||||
|
||||
abstract Question = Cat ** {
|
||||
|
||||
-- A question can be formed from a clause ('yes-no question') or
|
||||
-- with an interrogative.
|
||||
|
||||
fun
|
||||
QuestCl : Cl -> QCl ; -- does John walk
|
||||
QuestVP : IP -> VP -> QCl ; -- who walks
|
||||
QuestSlash : IP -> Slash -> QCl ; -- who does John love
|
||||
QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
QuestIComp : IComp -> NP -> QCl ; -- where is John
|
||||
|
||||
-- Interrogative pronouns can be formed with interrogative
|
||||
-- determiners.
|
||||
|
||||
IDetCN : IDet -> Num -> Ord -> CN -> IP; -- which five best songs
|
||||
AdvIP : IP -> Adv -> IP ; -- who in Europe
|
||||
|
||||
PrepIP : Prep -> IP -> IAdv ; -- with whom
|
||||
|
||||
CompIAdv : IAdv -> IComp ; -- where
|
||||
|
||||
|
||||
-- More $IP$, $IDet$, and $IAdv$ are defined in
|
||||
-- [``Structural`` Structural.html].
|
||||
|
||||
}
|
||||
26
lib/resource/abstract/Relative.gf
Normal file
26
lib/resource/abstract/Relative.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
--1 Relative clauses and pronouns
|
||||
|
||||
abstract Relative = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- The simplest way to form a relative clause is from a clause by
|
||||
-- a pronoun similar to "such that".
|
||||
|
||||
RelCl : Cl -> RCl ; -- such that John loves her
|
||||
|
||||
-- The more proper ways are from a verb phrase
|
||||
-- (formed in [``Verb`` Verb.html]) or a sentence
|
||||
-- with a missing noun phrase (formed in [``Sentence`` Sentence.html]).
|
||||
|
||||
RelVP : RP -> VP -> RCl ; -- who loves John
|
||||
RelSlash : RP -> Slash -> RCl ; -- whom John loves
|
||||
|
||||
-- Relative pronouns are formed from an 'identity element' by prefixing
|
||||
-- or suffixing (depending on language) prepositional phrases.
|
||||
|
||||
IdRP : RP ; -- which
|
||||
FunRP : Prep -> NP -> RP -> RP ; -- all the roots of which
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Resource = Rules, Clause, Structural ** {} ;
|
||||
@@ -1,243 +0,0 @@
|
||||
--!
|
||||
--2 Rules
|
||||
--
|
||||
-- This set of rules is minimal, in the sense of defining the simplest combinations
|
||||
-- of categories and not having redundant rules.
|
||||
-- When the resource grammar is used as a library, it will often be useful to
|
||||
-- access it through an intermediate library that defines more rules as
|
||||
-- 'macros' for combinations of the ones below.
|
||||
|
||||
abstract Rules = Categories ** {
|
||||
|
||||
--!
|
||||
--3 Nouns and noun phrases
|
||||
--
|
||||
|
||||
fun
|
||||
UseN : N -> CN ; -- "car"
|
||||
UsePN : PN -> NP ; -- "John"
|
||||
|
||||
-- These three rules have been moved to the module $Math$.
|
||||
{-
|
||||
SymbPN : String -> PN ; -- "x"
|
||||
SymbCN : CN -> String -> CN ; -- "number x"
|
||||
IntCN : CN -> Int -> CN ; -- "number 53"
|
||||
-}
|
||||
|
||||
IndefOneNP : CN -> NP ; -- "a car", "cars"
|
||||
IndefNumNP : Num -> CN -> NP ; -- "houses", "86 houses"
|
||||
DefOneNP : CN -> NP ; -- "the car"
|
||||
DefNumNP : Num -> CN -> NP ; -- "the cars", "the 86 cars"
|
||||
|
||||
DetNP : Det -> CN -> NP ; -- "every car"
|
||||
NDetNP : NDet -> Num -> CN -> NP ; -- "these (5) cars"
|
||||
NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
||||
MassNP : CN -> NP ; -- "wine"
|
||||
|
||||
AppN2 : N2 -> NP -> CN ; -- "successor of zero"
|
||||
AppN3 : N3 -> NP -> N2 ; -- "flight from Paris"
|
||||
UseN2 : N2 -> CN ; -- "successor"
|
||||
|
||||
ModAP : AP -> CN -> CN ; -- "red car"
|
||||
CNthatS : CN -> S -> CN ; -- "idea that the Earth is flat"
|
||||
|
||||
ModGenOne : NP -> CN -> NP ; -- "John's car"
|
||||
ModGenNum : Num -> NP -> CN -> NP ; -- "John's cars", "John's 86 cars"
|
||||
|
||||
UseInt : Int -> Num ; -- "32" --- assumes i > 1
|
||||
NoNum : Num ; -- no numeral modifier
|
||||
|
||||
--!
|
||||
--3 Adjectives and adjectival phrases
|
||||
--
|
||||
|
||||
UseA : A -> AP ; -- "red"
|
||||
ComplA2 : A2 -> NP -> AP ; -- "divisible by two"
|
||||
|
||||
PositADeg : ADeg -> AP ; -- "old"
|
||||
ComparADeg : ADeg -> NP -> AP ; -- "older than John"
|
||||
SuperlADeg : ADeg -> AP ; -- "the oldest"
|
||||
|
||||
ComplAV : AV -> VPI -> AP ; -- "eager to leave"
|
||||
ComplObjA2V : A2V -> NP -> VPI -> AP ; -- "easy for us to convince"
|
||||
|
||||
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
-- The main uses of verbs and verb phrases have been moved to the
|
||||
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
||||
-- $Clause$ (shallow many-place predication structure).
|
||||
|
||||
PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
||||
PredV0 : V0 -> Cl ; -- "it is raining"
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 : V2 -> V ; -- "loves"
|
||||
|
||||
ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
||||
|
||||
UseV2V : V2V -> VV ;
|
||||
UseV2S : V2S -> VS ;
|
||||
UseV2Q : V2Q -> VQ ;
|
||||
UseA2S : A2S -> AS ;
|
||||
UseA2V : A2V -> AV ;
|
||||
|
||||
-- Formation of tensed phrases.
|
||||
|
||||
AdjPart : V -> A ; -- past participle, e.g. "forgotten"
|
||||
|
||||
UseCl : TP -> Cl -> S ;
|
||||
UseRCl : TP -> RCl -> RS ;
|
||||
UseQCl : TP -> QCl -> QS ;
|
||||
|
||||
UseVCl : Pol -> Ant -> VCl -> VPI ;
|
||||
|
||||
PosTP : Tense -> Ant -> TP ;
|
||||
NegTP : Tense -> Ant -> TP ;
|
||||
|
||||
TPresent : Tense ;
|
||||
TPast : Tense ;
|
||||
TFuture : Tense ;
|
||||
TConditional : Tense ;
|
||||
|
||||
ASimul : Ant ;
|
||||
AAnter : Ant ;
|
||||
|
||||
PPos : Pol ;
|
||||
PNeg : Pol ;
|
||||
|
||||
--!
|
||||
--3 Adverbs
|
||||
--
|
||||
-- Here is how complex adverbs can be formed and used.
|
||||
|
||||
AdjAdv : A -> Adv ; -- "freely"
|
||||
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
||||
|
||||
AdvCN : CN -> Adv -> CN ; -- "house in London"
|
||||
AdvNP : NP -> Adv -> NP ; -- "the house in London"
|
||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||
AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
||||
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
||||
SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
||||
SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
||||
|
||||
IdRP : RP ; -- "which"
|
||||
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
||||
RelSlash : RP -> Slash -> RCl ; -- "that I wait for"/"for which I wait"
|
||||
ModRS : CN -> RS -> CN ; -- "man who walks"
|
||||
RelCl : Cl -> RCl ; -- "such that it is even"
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||
IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||
|
||||
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
QuestAdv : IAdv -> Cl -> QCl ; -- "why do you walk"
|
||||
|
||||
PosImpVP, NegImpVP : VCl -> Imp ; -- "(don't) be a man"
|
||||
|
||||
----rename these ??
|
||||
IndicPhrase : S -> Phr ; -- "I walk."
|
||||
QuestPhrase : QS -> Phr ; -- "Do I walk?"
|
||||
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
||||
|
||||
AdvCl : Cl -> Adv -> Cl ; -- "John walks in the park"
|
||||
AdvVPI : VPI -> Adv -> VPI ; -- "walk in the park"
|
||||
AdCPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||
AdvPhr : Adv -> S -> Phr ; -- "In India, there are tigers."
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
--
|
||||
-- We consider "n"-ary coordination, with "n" > 1. To this end, we have introduced
|
||||
-- a *list category* $ListX$ for each category $X$ whose expressions we want to
|
||||
-- conjoin. Each list category has two constructors, the base case being $TwoX$.
|
||||
|
||||
-- We have not defined coordination of all possible categories here,
|
||||
-- since it can be tricky in many languages. For instance, $VP$ coordination
|
||||
-- is linguistically problematic in German because $VP$ is a discontinuous
|
||||
-- category.
|
||||
|
||||
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
||||
|
||||
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
||||
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
||||
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
||||
ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
||||
|
||||
TwoS : S -> S -> ListS ;
|
||||
ConsS : ListS -> S -> ListS ;
|
||||
|
||||
TwoAP : AP -> AP -> ListAP ;
|
||||
ConsAP : ListAP -> AP -> ListAP ;
|
||||
|
||||
TwoNP : NP -> NP -> ListNP ;
|
||||
ConsNP : ListNP -> NP -> ListNP ;
|
||||
|
||||
TwoAdv : Adv -> Adv -> ListAdv ;
|
||||
ConsAdv : ListAdv -> Adv -> ListAdv ;
|
||||
|
||||
--!
|
||||
--3 Subordination
|
||||
--
|
||||
-- Subjunctions are different from conjunctions, but form
|
||||
-- a uniform category among themselves.
|
||||
|
||||
SubjS : Subj -> S -> S -> S ; -- "if 2 is odd, 3 is even"
|
||||
SubjImper : Subj -> S -> Imp -> Imp ; -- "if it is hot, use a glove!"
|
||||
SubjQS : Subj -> S -> QS -> QS ; -- "if you are new, who are you?"
|
||||
|
||||
-- This rule makes a subordinate clause into a sentence adverb, which
|
||||
-- can be attached to e.g. noun phrases. It might even replace the
|
||||
-- previous subjunction rules.
|
||||
|
||||
AdvSubj : Subj -> S -> Adv ; -- "when he arrives"
|
||||
|
||||
--!
|
||||
--2 One-word utterances
|
||||
--
|
||||
-- These are, more generally, *one-phrase utterances*. The list below
|
||||
-- is very incomplete.
|
||||
|
||||
PhrNP : NP -> Phr ; -- "Some man.", "John."
|
||||
PhrOneCN, PhrManyCN : CN -> Phr ; -- "A car.", "Cars."
|
||||
PhrIP : IAdv -> Phr ; -- "Who?"
|
||||
PhrIAdv : IAdv -> Phr ; -- "Why?"
|
||||
PhrVPI : VPI -> Phr ; -- "Tända ljus."
|
||||
|
||||
--!
|
||||
--2 Text formation
|
||||
--
|
||||
-- A text is a sequence of phrases. It is defined like a non-empty list.
|
||||
|
||||
OnePhr : Phr -> Text ;
|
||||
ConsPhr : Phr -> Text -> Text ;
|
||||
|
||||
--2 Special constructs.
|
||||
--
|
||||
-- These constructs tend to have language-specific syntactic realizations.
|
||||
|
||||
ExistCN : CN -> Cl ; -- "there is a bar"
|
||||
ExistNumCN : Num -> CN -> Cl ; -- "there are (86) bars"
|
||||
|
||||
OneNP : NP ; -- "one (walks)"
|
||||
|
||||
} ;
|
||||
@@ -1,49 +0,0 @@
|
||||
--1 Topological structure of Scandinavian sentences.
|
||||
--
|
||||
-- This is an alternative, more 'native' analysis than $Clause$ and
|
||||
-- $Verbphrase$, due to Diderichsen.
|
||||
--
|
||||
-- Sources:
|
||||
-- N. Jörgensen & J. Svensson, "Nusvensk grammatik" (Gleerups, 2001);
|
||||
-- R. Zola Christensen, "Dansk grammatik for svenskere"
|
||||
-- (Studentlitteratur 1999).
|
||||
|
||||
abstract Sats = Categories ** {
|
||||
|
||||
-- Idea: form primarily a $Sats$, which can then be lifted to a $Cl$
|
||||
-- and used elsewhere in grammar.
|
||||
|
||||
cat Sats ;
|
||||
|
||||
fun
|
||||
ClSats : Sats -> Cl ;
|
||||
|
||||
-- There will be $Sats$-forming functions for all subcategorization
|
||||
-- patterns of verbs.
|
||||
|
||||
SatsV : NP -> V -> Sats ;
|
||||
SatsV2 : NP -> V2 -> NP -> Sats ;
|
||||
SatsV3 : NP -> V3 -> NP -> NP -> Sats ;
|
||||
SatsReflV2 : NP -> V2 -> Sats ;
|
||||
SatsVS : NP -> VS -> S -> Sats ;
|
||||
SatsVQ : NP -> VQ -> QS -> Sats ;
|
||||
SatsV2S : NP -> V2S -> NP -> S -> Sats ;
|
||||
SatsV2Q : NP -> V2Q -> NP -> QS -> Sats ;
|
||||
|
||||
SatsAP : NP -> AP -> Sats ;
|
||||
SatsCN : NP -> CN -> Sats ;
|
||||
SatsNP : NP -> NP -> Sats ;
|
||||
SatsAdv : NP -> Adv -> Sats ;
|
||||
|
||||
-- To a $Sats$, you can insert a sentence adverbial ($AdV$, e.g. "ändå") or
|
||||
-- 'TSR' adverbial ($Adv$, e.g. "nu"; the name TSR is from Jörgensen
|
||||
-- and Svensson).
|
||||
|
||||
AdVSats : Sats -> AdV -> Sats ;
|
||||
AdvSats : Sats -> Adv -> Sats ;
|
||||
|
||||
-- We can also insert a verb-complement verb.
|
||||
|
||||
VVSats : Sats -> VV -> Sats ;
|
||||
|
||||
}
|
||||
85
lib/resource/abstract/Sentence.gf
Normal file
85
lib/resource/abstract/Sentence.gf
Normal file
@@ -0,0 +1,85 @@
|
||||
--1 Sentence: Sentences, Clauses, and Imperatives
|
||||
|
||||
abstract Sentence = Cat ** {
|
||||
|
||||
--2 Clauses
|
||||
|
||||
-- The $NP VP$ predication rule form a clause whose linearization
|
||||
-- gives a table of all tense variants, positive and negative.
|
||||
-- Clauses are converted to $S$ (with fixed tense) with the
|
||||
-- $UseCl$ function below.
|
||||
|
||||
fun
|
||||
PredVP : NP -> VP -> Cl ; -- John walks
|
||||
|
||||
-- Using an embedded sentence as a subject is treated separately.
|
||||
-- This can be overgenerating. E.g. "whether you go" as subject
|
||||
-- is only meaningful for some verb phrases.
|
||||
|
||||
PredSCVP : SC -> VP -> Cl ; -- that you go makes me happy
|
||||
|
||||
--2 Clauses missing object noun phrases
|
||||
|
||||
-- This category is a variant of the 'slash category' $S/NP$ of
|
||||
-- GPSG and categorial grammars, which in turn replaces
|
||||
-- movement transformations in the formation of questions
|
||||
-- and relative clauses. Except $SlashV2$, the construction
|
||||
-- rules can be seen as special cases of function composition, in
|
||||
-- the style of CCG.
|
||||
-- *Note* the set is not complete and lacks e.g. verbs with more than 2 places.
|
||||
|
||||
SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees
|
||||
SlashVVV2 : NP -> VV -> V2 -> Slash; -- (whom) he wants to see
|
||||
AdvSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow
|
||||
SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks
|
||||
|
||||
--2 Imperatives
|
||||
|
||||
-- An imperative is straightforwardly formed from a verb phrase.
|
||||
-- It has variation over positive and negative, singular and plural.
|
||||
-- To fix these parameters, see [Phrase Phrase.html].
|
||||
|
||||
ImpVP : VP -> Imp ; -- go
|
||||
|
||||
--2 Embedded sentences
|
||||
|
||||
-- Sentences, questions, and infinitival phrases can be used as
|
||||
-- subjects and (adverbial) complements.
|
||||
|
||||
EmbedS : S -> SC ; -- that you go
|
||||
EmbedQS : QS -> SC ; -- whether you go
|
||||
EmbedVP : VP -> SC ; -- to go
|
||||
|
||||
--2 Sentences
|
||||
|
||||
-- These are the 2 x 4 x 4 = 16 forms generated by different
|
||||
-- combinations of tense, polarity, and
|
||||
-- anteriority, which are defined in [``Common`` Common.html].
|
||||
|
||||
fun
|
||||
UseCl : Tense -> Ant -> Pol -> Cl -> S ;
|
||||
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
|
||||
UseRCl : Tense -> Ant -> Pol -> RCl -> RS ;
|
||||
|
||||
}
|
||||
|
||||
--.
|
||||
-- Examples for English $S$/$Cl$:
|
||||
{-
|
||||
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,41 +0,0 @@
|
||||
abstract Simple = Categories ** {
|
||||
|
||||
cat
|
||||
|
||||
Sentence ;
|
||||
|
||||
fun
|
||||
|
||||
PAffirm : Sentence -> Phr ;
|
||||
PNegate : Sentence -> Phr ;
|
||||
PQuestion : Sentence -> Phr ;
|
||||
PCommand : Imp -> Phr ;
|
||||
|
||||
SVerb : NP -> V -> Sentence ;
|
||||
STransVerb : NP -> V2 -> NP -> Sentence ;
|
||||
SAdjective : NP -> AP -> Sentence ;
|
||||
SAdverb : NP -> Adv -> Sentence ;
|
||||
|
||||
SModified : Sentence -> Adv -> Sentence ;
|
||||
|
||||
PIntV : IP -> V -> Phr ;
|
||||
PIntSubjV2 : IP -> V2 -> NP -> Phr ;
|
||||
PIntObjV2 : IP -> NP -> V2 -> Phr ;
|
||||
PIntAP : IP -> AP -> Phr ;
|
||||
PIntAdv : IP -> Adv -> Phr ;
|
||||
|
||||
NPDef : CN -> NP ;
|
||||
NPIndef : CN -> NP ;
|
||||
NPGroup : CN -> NP ;
|
||||
NPMass : CN -> NP ;
|
||||
NPName : PN -> NP ;
|
||||
|
||||
NSimple : N -> CN ;
|
||||
NModified : AP -> CN -> CN ;
|
||||
|
||||
ASimple : ADeg -> AP ;
|
||||
AVery : ADeg -> AP ;
|
||||
|
||||
AdvPrep : Prep -> NP -> Adv ;
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
resource SimpleAux = {
|
||||
|
||||
param
|
||||
SentenceForm = SAffirm | SNegate | SQuestion ;
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
incomplete concrete SimpleI of Simple =
|
||||
open Predef, Prelude, SimpleAux, Categories, Rules, Structural, Verbphrase in {
|
||||
|
||||
lincat
|
||||
|
||||
Sentence = {s : SentenceForm => Str} ;
|
||||
|
||||
lin
|
||||
PAffirm sent = ss (sent.s ! SAffirm) ** {lock_Phr = <>} ;
|
||||
PNegate sent = ss (sent.s ! SNegate) ** {lock_Phr = <>} ;
|
||||
PQuestion sent = ss (sent.s ! SQuestion) ** {lock_Phr = <>} ;
|
||||
PCommand = ImperOne ;
|
||||
|
||||
SVerb np v = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(UseV v))))
|
||||
}
|
||||
} ;
|
||||
|
||||
STransVerb np tv obj = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SNegate => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SQuestion =>
|
||||
toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np (ComplV2 tv obj))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdjective np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAP ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdverb np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAdv ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SModified s a = {s = \\f => s.s ! f ++ a.s ; lock_S = <>} ; ---
|
||||
|
||||
PIntV ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (UseV v))) ;
|
||||
PIntSubjV2 ip v np =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (ComplV2 v np))) ;
|
||||
PIntObjV2 ip np v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash ip (SlashV2 np v))) ;
|
||||
PIntAP ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAP v))) ;
|
||||
PIntAdv ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAdv v))) ;
|
||||
|
||||
NPDef = DefOneNP ;
|
||||
NPIndef = IndefOneNP ;
|
||||
NPGroup = IndefNumNP NoNum ;
|
||||
NPMass = MassNP ;
|
||||
NPName = UsePN ;
|
||||
|
||||
NSimple = UseN ;
|
||||
NModified = ModAP ;
|
||||
|
||||
ASimple = PositADeg ;
|
||||
AVery a = AdvAP very_Adv (PositADeg a) ;
|
||||
|
||||
AdvPrep p np = AdvPP (PrepNP p np) ;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract SimpleLang =
|
||||
Simple,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country
|
||||
|
||||
** {
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
@@ -1,103 +1,111 @@
|
||||
--1 GF Resource Grammar API for Structural Words
|
||||
--1 Structural: Structural Words
|
||||
--
|
||||
-- AR 21/11/2003
|
||||
--
|
||||
-- Here we have some words belonging to closed classes and appearing
|
||||
-- in all languages we have considered.
|
||||
-- Sometimes they are not really meaningful, e.g. $we_NP$ in Spanish
|
||||
-- should be replaced by masculine and feminine variants.
|
||||
-- Sometimes more distinctions are needed, e.g. $we_Pron$ in Spanish
|
||||
-- should be replaced by masculine and feminine variants, found in
|
||||
-- [``ExtraSpa`` ../spanish/ExtraSpa.gf].
|
||||
|
||||
abstract Structural = Categories, Numerals ** {
|
||||
abstract Structural = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- First mount the numerals.
|
||||
|
||||
UseNumeral : Numeral-> Num ;
|
||||
|
||||
-- Then an alphabetical list of structural words
|
||||
-- This is an alphabetical list of structural words
|
||||
|
||||
above_Prep : Prep ;
|
||||
after_Prep : Prep ;
|
||||
all8mass_Det : Det ;
|
||||
all_NDet : NDet ;
|
||||
almost_Adv : AdA ;
|
||||
all_Predet : Predet ;
|
||||
almost_AdA : AdA ;
|
||||
almost_AdN : AdN ;
|
||||
although_Subj : Subj ;
|
||||
always_AdV : AdV ;
|
||||
and_Conj : Conj ;
|
||||
because_Subj : Subj ;
|
||||
before_Prep : Prep ;
|
||||
behind_Prep : Prep ;
|
||||
between_Prep : Prep ;
|
||||
both_AndConjD : ConjD ;
|
||||
both7and_DConj : DConj ;
|
||||
but_PConj : PConj ;
|
||||
by8agent_Prep : Prep ;
|
||||
by8means_Prep : Prep ;
|
||||
can8know_VV : VV ;
|
||||
can_VV : VV ;
|
||||
during_Prep : Prep ;
|
||||
either8or_ConjD : ConjD ;
|
||||
either7or_DConj : DConj ;
|
||||
every_Det : Det ;
|
||||
everybody_NP : NP ;
|
||||
everything_NP : NP ;
|
||||
everywhere_Adv : Adv ;
|
||||
first_Ord : Ord ;
|
||||
few_Det : Det ;
|
||||
from_Prep : Prep ;
|
||||
he_NP : NP ;
|
||||
he_Pron : Pron ;
|
||||
here_Adv : Adv ;
|
||||
here7to_Adv : Adv ;
|
||||
here7from_Adv : Adv ;
|
||||
how_IAdv : IAdv ;
|
||||
how8many_IDet : IDet ;
|
||||
i_NP : NP ;
|
||||
i_Pron : Pron ;
|
||||
if_Subj : Subj ;
|
||||
in8front_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
it_NP : NP ;
|
||||
it_Pron : Pron ;
|
||||
less_CAdv : CAdv ;
|
||||
many_Det : Det ;
|
||||
most_Det : Det ;
|
||||
most8many_Det : Det ;
|
||||
more_CAdv : CAdv ;
|
||||
most_Predet : Predet ;
|
||||
much_Det : Det ;
|
||||
must_VV : VV ;
|
||||
no_Phr : Phr ;
|
||||
on_Prep : Prep ;
|
||||
one_Quant : QuantSg ;
|
||||
only_Predet : Predet ;
|
||||
or_Conj : Conj ;
|
||||
otherwise_Adv : AdC ;
|
||||
otherwise_PConj : PConj ;
|
||||
part_Prep : Prep ;
|
||||
please_Voc : Voc ;
|
||||
possess_Prep : Prep ;
|
||||
quite_Adv : AdA ;
|
||||
she_NP : NP ;
|
||||
so_Adv : AdA ;
|
||||
some_Det : Det ;
|
||||
some_NDet : NDet ;
|
||||
she_Pron : Pron ;
|
||||
so_AdA : AdA ;
|
||||
someSg_Det : Det ;
|
||||
somePl_Det : Det ;
|
||||
somebody_NP : NP ;
|
||||
something_NP : NP ;
|
||||
somewhere_Adv : Adv ;
|
||||
that_Det : Det ;
|
||||
that_Quant : Quant ;
|
||||
that_NP : NP ;
|
||||
therefore_Adv : AdC ;
|
||||
these_NDet : NDet ;
|
||||
they8fem_NP : NP ;
|
||||
they_NP : NP ;
|
||||
this_Det : Det ;
|
||||
there_Adv : Adv ;
|
||||
there7to_Adv : Adv ;
|
||||
there7from_Adv : Adv ;
|
||||
therefore_PConj : PConj ;
|
||||
these_NP : NP ;
|
||||
they_Pron : Pron ;
|
||||
this_Quant : Quant ;
|
||||
this_NP : NP ;
|
||||
those_NDet : NDet ;
|
||||
thou_NP : NP ;
|
||||
those_NP : NP ;
|
||||
through_Prep : Prep ;
|
||||
to_Prep : Prep ;
|
||||
too_Adv : AdA ;
|
||||
too_AdA : AdA ;
|
||||
under_Prep : Prep ;
|
||||
very_Adv : AdA ;
|
||||
very_AdA : AdA ;
|
||||
want_VV : VV ;
|
||||
we_NP : NP ;
|
||||
what8many_IP : IP ;
|
||||
what8one_IP : IP ;
|
||||
we_Pron : Pron ;
|
||||
whatPl_IP : IP ;
|
||||
whatSg_IP : IP ;
|
||||
when_IAdv : IAdv ;
|
||||
when_Subj : Subj ;
|
||||
where_IAdv : IAdv ;
|
||||
which8many_IDet : IDet ;
|
||||
which8one_IDet : IDet ;
|
||||
who8many_IP : IP ;
|
||||
who8one_IP : IP ;
|
||||
whichPl_IDet : IDet ;
|
||||
whichSg_IDet : IDet ;
|
||||
whoPl_IP : IP ;
|
||||
whoSg_IP : IP ;
|
||||
why_IAdv : IAdv ;
|
||||
with_Prep : Prep ;
|
||||
without_Prep : Prep ;
|
||||
ye_NP : NP ;
|
||||
yes_Phr : Phr ;
|
||||
you_NP : NP ;
|
||||
youSg_Pron : Pron ;
|
||||
youPl_Pron : Pron ;
|
||||
youPol_Pron : Pron ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
-- Swadesh 207
|
||||
abstract SwadeshLex = Categories ** {
|
||||
fun
|
||||
|
||||
-- Pronouns
|
||||
|
||||
i_NP : NP ;
|
||||
thou_NP : NP ;
|
||||
he_NP : NP ;
|
||||
we_NP : NP ;
|
||||
you_NP : NP ;
|
||||
they_NP : NP ;
|
||||
who8many_IP : IP ; -- only one who in Swadesh 207
|
||||
who8one_IP : IP ;
|
||||
what8many_IP : IP ; -- only one what in Swadesh 207
|
||||
what8one_IP : IP ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
that_Det : Det ;
|
||||
this_Det : Det ;
|
||||
all_NDet : NDet ;
|
||||
many_Det : Det ;
|
||||
some_Det : Det ;
|
||||
few_Det : Det ;
|
||||
other_Det : Det ;
|
||||
|
||||
-- Adverbs
|
||||
|
||||
here_Adv : Adv ;
|
||||
there_Adv : Adv ;
|
||||
where_IAdv : IAdv ;
|
||||
when_IAdv : IAdv ;
|
||||
how_IAdv : IAdv ;
|
||||
|
||||
-- Conjunctions
|
||||
|
||||
and_Conj : Conj ;
|
||||
|
||||
-- Prepositions
|
||||
|
||||
at_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
with_Prep : Prep ;
|
||||
|
||||
-- not -- ?
|
||||
-- if -- ?
|
||||
-- because -- ?
|
||||
|
||||
-- Numerals
|
||||
|
||||
one_Num : Num ;
|
||||
two_Num : Num ;
|
||||
three_Num : Num ;
|
||||
four_Num : Num ;
|
||||
five_Num : Num ;
|
||||
|
||||
-- Adjectives
|
||||
|
||||
bad_ADeg : ADeg ;
|
||||
big_ADeg : ADeg ;
|
||||
black_ADeg : ADeg ;
|
||||
cold_ADeg : ADeg ;
|
||||
correct_ADeg : ADeg ;
|
||||
dirty_ADeg : ADeg ;
|
||||
dry_ADeg : ADeg ;
|
||||
dull_ADeg : ADeg ;
|
||||
far_ADeg : ADeg ;
|
||||
full_ADeg : ADeg ;
|
||||
good_ADeg : ADeg ;
|
||||
green_ADeg : ADeg ;
|
||||
heavy_ADeg : ADeg ;
|
||||
long_ADeg : ADeg ;
|
||||
narrow_ADeg : ADeg ;
|
||||
near_ADeg : ADeg ;
|
||||
new_ADeg : ADeg ;
|
||||
old_ADeg : ADeg ;
|
||||
red_ADeg : ADeg ;
|
||||
rotten_ADeg : ADeg ;
|
||||
round_ADeg : ADeg ;
|
||||
sharp_ADeg : ADeg ;
|
||||
short_ADeg : ADeg ;
|
||||
small_ADeg : ADeg ;
|
||||
smooth_ADeg : ADeg ;
|
||||
straight_ADeg : ADeg ;
|
||||
thick_ADeg : ADeg ;
|
||||
thin_ADeg : ADeg ;
|
||||
warm_ADeg : ADeg ;
|
||||
wet_ADeg : ADeg ;
|
||||
white_ADeg : ADeg ;
|
||||
wide_ADeg : ADeg ;
|
||||
yellow_ADeg : ADeg ;
|
||||
|
||||
left_A : A ;
|
||||
right_A : A ;
|
||||
|
||||
-- Nouns
|
||||
|
||||
animal_N : N ;
|
||||
ashes_N : N ;
|
||||
back_N : N ;
|
||||
bark_N : N ;
|
||||
belly_N : N ;
|
||||
bird_N : N ;
|
||||
blood_N : N ;
|
||||
bone_N : N ;
|
||||
breast_N : N ;
|
||||
child_N : N ;
|
||||
cloud_N : N ;
|
||||
day_N : N ;
|
||||
dog_N : N ;
|
||||
dust_N : N ;
|
||||
ear_N : N ;
|
||||
earth_N : N ;
|
||||
egg_N : N ;
|
||||
eye_N : N ;
|
||||
fat_N : N ;
|
||||
father_N : N ;
|
||||
feather_N : N ;
|
||||
fingernail_N : N ;
|
||||
fire_N : N ;
|
||||
fish_N : N ;
|
||||
flower_N : N ;
|
||||
fog_N : N ;
|
||||
foot_N : N ;
|
||||
forest_N : N ;
|
||||
fruit_N : N ;
|
||||
grass_N : N ;
|
||||
guts_N : N ;
|
||||
hair_N : N ;
|
||||
hand_N : N ;
|
||||
head_N : N ;
|
||||
heart_N : N ;
|
||||
horn_N : N ;
|
||||
husband_N : N ;
|
||||
ice_N : N ;
|
||||
knee_N : N ;
|
||||
lake_N : N ;
|
||||
leaf_N : N ;
|
||||
leg_N : N ;
|
||||
liver_N : N ;
|
||||
louse_N : N ;
|
||||
man_N : N ;
|
||||
meat_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N : N ;
|
||||
mountain_N : N ;
|
||||
mouth_N : N ;
|
||||
name_N : N ;
|
||||
neck_N : N ;
|
||||
night_N : N ;
|
||||
nose_N : N ;
|
||||
person_N : N ;
|
||||
rain_N : N ;
|
||||
river_N : N ;
|
||||
road_N : N ;
|
||||
root_N : N ;
|
||||
rope_N : N ;
|
||||
salt_N : N ;
|
||||
sand_N : N ;
|
||||
sea_N : N ;
|
||||
seed_N : N ;
|
||||
skin_N : N ;
|
||||
sky_N : N ;
|
||||
smoke_N : N ;
|
||||
snake_N : N ;
|
||||
snow_N : N ;
|
||||
star_N : N ;
|
||||
stick_N : N ;
|
||||
stone_N : N ;
|
||||
sun_N : N ;
|
||||
tail_N : N ;
|
||||
tongue_N : N ;
|
||||
tooth_N : N ;
|
||||
tree_N : N ;
|
||||
water_N : N ;
|
||||
wife_N : N ;
|
||||
wind_N : N ;
|
||||
wing_N : N ;
|
||||
woman_N : N ;
|
||||
worm_N : N ;
|
||||
year_N : N ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
bite_V : V ;
|
||||
blow_V : V ;
|
||||
breathe_V : V ;
|
||||
burn_V : V ;
|
||||
come_V : V ;
|
||||
count_V : V ;
|
||||
cut_V : V ;
|
||||
die_V : V ;
|
||||
dig_V : V ;
|
||||
drink_V : V ;
|
||||
eat_V : V ;
|
||||
fall_V : V ;
|
||||
fear_V : V ;
|
||||
fight_V : V ;
|
||||
float_V : V ;
|
||||
flow_V : V ;
|
||||
fly_V : V ;
|
||||
freeze_V : V ;
|
||||
give_V : V ;
|
||||
hear_V : V ;
|
||||
hit_V : V ;
|
||||
hold_V : V ;
|
||||
hunt_V : V ;
|
||||
kill_V : V ;
|
||||
know_V : V ;
|
||||
laugh_V : V ;
|
||||
lie_V : V ;
|
||||
live_V : V ;
|
||||
play_V : V ;
|
||||
pull_V : V ;
|
||||
push_V : V ;
|
||||
rub_V : V ;
|
||||
say_V : V ;
|
||||
scratch_V : V ;
|
||||
see_V : V ;
|
||||
sew_V : V ;
|
||||
sing_V : V ;
|
||||
sit_V : V ;
|
||||
sleep_V : V ;
|
||||
smell_V : V ;
|
||||
spit_V : V ;
|
||||
split_V : V ;
|
||||
squeeze_V : V ;
|
||||
stab_V : V ;
|
||||
stand_V : V ;
|
||||
suck_V : V ;
|
||||
swell_V : V ;
|
||||
swim_V : V ;
|
||||
think_V : V ;
|
||||
throw_V : V ;
|
||||
tie_V : V ;
|
||||
turn_V : V ;
|
||||
vomit_V : V ;
|
||||
walk_V : V ;
|
||||
wash_V : V ;
|
||||
wipe_V : V ;
|
||||
|
||||
}
|
||||
15
lib/resource/abstract/Text.gf
Normal file
15
lib/resource/abstract/Text.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
--1 Text: Texts
|
||||
|
||||
-- Texts are built from an empty text by adding $Phr$ases,
|
||||
-- using as constructors the punctuation marks ".", "?", and "!".
|
||||
-- Any punctuation mark can be attached to any kind of phrase.
|
||||
|
||||
abstract Text = Common ** {
|
||||
|
||||
fun
|
||||
TEmpty : Text ; --
|
||||
TFullStop : Phr -> Text -> Text ; -- John walks. ...
|
||||
TQuestMark : Phr -> Text -> Text ; -- Are you OK? ...
|
||||
TExclMark : Phr -> Text -> Text ; -- John walks! ...
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
abstract Time = Numerals ** {
|
||||
|
||||
-- Time grammar Abstract syntax. Modified by AR from Karin Cavallin.
|
||||
|
||||
cat
|
||||
|
||||
Date ;
|
||||
Time ;
|
||||
Hour ;
|
||||
Minute ;
|
||||
Weekday ;
|
||||
|
||||
fun
|
||||
|
||||
-- The variants: "two twenty", "twenty past two", "twenty to two"
|
||||
|
||||
DayDate : Weekday -> Date ;
|
||||
DayTimeDate : Weekday -> Time -> Date ;
|
||||
|
||||
FormalTime : Hour -> Minute -> Time ;
|
||||
PastTime : Hour -> Minute -> Time ;
|
||||
ToTime : Hour -> Minute -> Time ;
|
||||
ExactTime : Hour -> Time ;
|
||||
|
||||
-- These range from 1 to 99 and are thus overgenerating.
|
||||
|
||||
NumHour : Sub100 -> Hour ;
|
||||
NumMinute : Sub100 -> Minute ;
|
||||
|
||||
fun
|
||||
monday : Weekday ;
|
||||
tuesday : Weekday ;
|
||||
wednesday : Weekday ;
|
||||
thursday : Weekday ;
|
||||
friday : Weekday ;
|
||||
saturday : Weekday ;
|
||||
sunday : Weekday ;
|
||||
|
||||
{-
|
||||
Add:
|
||||
|
||||
years
|
||||
|
||||
dates: the x:th of y
|
||||
|
||||
relative weeks: next week, last week, in x weeks, x weeks ago
|
||||
|
||||
relative days: today, tomorrow, yesterday, the day before yesterday,
|
||||
the day after tomorrow, in x days, x days ago
|
||||
|
||||
relative time: in x minutes, in x hours
|
||||
|
||||
-}
|
||||
|
||||
} ;
|
||||
70
lib/resource/abstract/Verb.gf
Normal file
70
lib/resource/abstract/Verb.gf
Normal file
@@ -0,0 +1,70 @@
|
||||
--1 The construction of verb phrases
|
||||
|
||||
abstract Verb = Cat ** {
|
||||
|
||||
--2 Complementization rules
|
||||
|
||||
-- Verb phrases are constructed from verbs by providing their
|
||||
-- complements. There is one rule for each verb category.
|
||||
|
||||
fun
|
||||
UseV : V -> VP ; -- sleep
|
||||
ComplV2 : V2 -> NP -> VP ; -- use it
|
||||
ComplV3 : V3 -> NP -> NP -> VP ; -- send a message to her
|
||||
|
||||
ComplVV : VV -> VP -> VP ; -- want to run
|
||||
ComplVS : VS -> S -> VP ; -- know that she runs
|
||||
ComplVQ : VQ -> QS -> VP ; -- ask if she runs
|
||||
|
||||
ComplVA : VA -> AP -> VP ; -- look red
|
||||
ComplV2A : V2A -> NP -> AP -> VP ; -- paint the house red
|
||||
|
||||
--2 Other ways of forming verb phrases
|
||||
|
||||
-- Verb phrases can also be constructed reflexively and from
|
||||
-- copula-preceded complements.
|
||||
|
||||
ReflV2 : V2 -> VP ; -- use itself
|
||||
UseComp : Comp -> VP ; -- be warm
|
||||
|
||||
-- Passivization of two-place verbs is another way to use
|
||||
-- them. In many languages, the result is a participle that
|
||||
-- is used as complement to a copula ("is used"), but other
|
||||
-- auxiliary verbs are possible (Ger. "wird angewendet", It.
|
||||
-- "viene usato"), as well as special verb forms (Fin. "käytetään",
|
||||
-- Swe. "används").
|
||||
--
|
||||
-- *Note*. the rule can be overgenerating, since the $V2$ need not
|
||||
-- take a direct object.
|
||||
|
||||
PassV2 : V2 -> VP ; -- be used
|
||||
|
||||
-- Adverbs can be added to verb phrases. Many languages make
|
||||
-- a distinction between adverbs that are attached in the end
|
||||
-- vs. next to (or before) the verb.
|
||||
|
||||
AdvVP : VP -> Adv -> VP ; -- sleep here
|
||||
AdVVP : AdV -> VP -> VP ; -- always sleep
|
||||
|
||||
-- *Agents of passives* are constructed as adverbs with the
|
||||
-- preposition [Structural Structural.html]$.8agent_Prep$.
|
||||
|
||||
|
||||
--2 Complements to copula
|
||||
|
||||
-- Adjectival phrases, noun phrases, and adverbs can be used.
|
||||
|
||||
CompAP : AP -> Comp ; -- (be) small
|
||||
CompNP : NP -> Comp ; -- (be) a soldier
|
||||
CompAdv : Adv -> Comp ; -- (be) here
|
||||
|
||||
--2 Coercions
|
||||
|
||||
-- Verbs can change subcategorization patterns in systematic ways,
|
||||
-- but this is very much language-dependent. The following two
|
||||
-- work in all the languages we cover.
|
||||
|
||||
UseVQ : VQ -> V2 ; -- ask (a question)
|
||||
UseVS : VS -> V2 ; -- know (a secret)
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
--!
|
||||
--1 Rules for verbs and verb phrases
|
||||
--
|
||||
-- This module treats predications by means of deep right-branching
|
||||
-- $VP$ structures, which have the advantage of conciseness but the
|
||||
-- disadvantage of slow parsing due to discontinuous constituents.
|
||||
--
|
||||
-- The principal way of forming sentences ($S$) is by combining a noun phrase
|
||||
-- with a verb phrase (the $PredVP$ rule below). In addition to this, verb
|
||||
-- phrases have uses in relative clauses and questions. Verb phrases already
|
||||
-- have (or have not) a negation, but they are formed from verbal groups
|
||||
-- ($VG$), which have both positive and negative forms.
|
||||
|
||||
abstract Verbphrase = Categories ** {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
-- These rules produce verb phrases.
|
||||
|
||||
fun
|
||||
UseV : V -> VP ; -- "walks"
|
||||
UsePassV : V -> VP ; -- "is seen"
|
||||
ComplV2 : V2 -> NP -> VP ; -- "sees Mary"
|
||||
ComplV3 : V3 -> NP -> NP -> VP ; -- "tells Mary everything"
|
||||
ComplReflV2 : V2 -> VP ; -- "loves himself"
|
||||
ComplVS : VS -> S -> VP ; -- "says that Mary runs"
|
||||
ComplVV : VV -> VPI -> VP ; -- "must walk"
|
||||
ComplVQ : VQ -> QS -> VP ; -- "asks who will come"
|
||||
ComplVA : VA -> AP -> VP ; -- "looks ill"
|
||||
ComplV2A : V2A -> NP -> AP -> VP ; -- "paints the house red"
|
||||
ComplSubjV2V : V2V -> NP -> VPI -> VP ; -- "promises Mary to leave"
|
||||
ComplObjV2V : V2V -> NP -> VPI -> VP ; -- "asked him to go"
|
||||
ComplV2S : V2S -> NP -> S -> VP ; -- "told me that you came"
|
||||
ComplV2Q : V2Q -> NP -> QS -> VP ; -- "asks me if you come"
|
||||
|
||||
PredAP : AP -> VP ; -- "is old"
|
||||
PredCN : CN -> VP ; -- "is a man"
|
||||
PredNP : NP -> VP ; -- "is Bill"
|
||||
PredAdv : Adv -> VP ; -- "is in France", "is here"
|
||||
|
||||
PredProgVP : VPI -> VP ; -- "is eating fish"
|
||||
|
||||
-- These rules *use* verb phrases.
|
||||
|
||||
PredVP : NP -> VP -> Cl ; -- "John walks"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
|
||||
UseVP : VP -> VCl ; -- to eat, not to eat
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
|
||||
}
|
||||
45
lib/resource/arabic/AdjectiveAra.gf
Normal file
45
lib/resource/arabic/AdjectiveAra.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
s =
|
||||
table {
|
||||
Hum => a.s ;
|
||||
NoHum => \\g,n =>
|
||||
case n of {
|
||||
Pl => a.s ! Fem ! Sg ;
|
||||
_ => a.s ! g ! n
|
||||
}
|
||||
}
|
||||
};
|
||||
-- ComparA a np = {
|
||||
-- s = \\_ => a.s ! AAdj Compar ++ "تهَن" ++ np.s ! Nom ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
---- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
--
|
||||
-- ComplA2 a np = {
|
||||
-- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- ReflA2 a = {
|
||||
-- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- SentAP ap sc = {
|
||||
-- s = \\a => ap.s ! a ++ sc.s ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- AdAP ada ap = {
|
||||
-- s = \\a => ada.s ++ ap.s ! a ;
|
||||
-- isPre = ap.isPre
|
||||
-- } ;
|
||||
--
|
||||
-- UseA2 a = a ;
|
||||
--
|
||||
}
|
||||
21
lib/resource/arabic/AdverbAra.gf
Normal file
21
lib/resource/arabic/AdverbAra.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
|
||||
--
|
||||
-- lin
|
||||
-- PositAdvAdj a = {s = a.s ! AAdv} ;
|
||||
-- ComparAdvAdj cadv a np = {
|
||||
-- s = cadv.s ++ a.s ! AAdv ++ "تهَن" ++ np.s ! Nom
|
||||
-- } ;
|
||||
-- ComparAdvAdjS cadv a s = {
|
||||
-- s = cadv.s ++ a.s ! AAdv ++ "تهَن" ++ s.s
|
||||
-- } ;
|
||||
--
|
||||
-- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
|
||||
--
|
||||
-- AdAdv = cc2 ;
|
||||
--
|
||||
-- SubjS = cc2 ;
|
||||
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
|
||||
--
|
||||
-- AdnCAdv cadv = {s = cadv.s ++ "تهَن"} ;
|
||||
--
|
||||
}
|
||||
99
lib/resource/arabic/CatAra.gf
Normal file
99
lib/resource/arabic/CatAra.gf
Normal file
@@ -0,0 +1,99 @@
|
||||
concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
-- Phrase
|
||||
|
||||
Utt = {s : Gender => Str};
|
||||
-- Voc = {s : Str} ;
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
-- RS = {s : Agr => Str} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = {s : ResAra.Tense => Polarity => Order => Str} ;
|
||||
-- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ;
|
||||
Imp = {s : Polarity => Gender => ResAra.Number => Str} ;
|
||||
|
||||
-- Question
|
||||
|
||||
QCl = {s : ResAra.Tense => Polarity => QForm => Str} ;
|
||||
IP = {s : Str ; n : ResAra.Number} ;
|
||||
-- IAdv = {s : Str} ;
|
||||
-- IDet = {s : Str ; n : ResAra.Number} ;
|
||||
--
|
||||
---- Relative
|
||||
--
|
||||
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
|
||||
-- RP = {s : Case => Str ; a : RAgr} ;
|
||||
--
|
||||
-- Verb
|
||||
--
|
||||
{-
|
||||
VP = {
|
||||
s : Tense => Polarity => Order => Agr => Str;
|
||||
comp : NP
|
||||
};
|
||||
-}
|
||||
VP = ResAra.VP ;
|
||||
Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ;
|
||||
-- SC = {s : Str} ;
|
||||
--
|
||||
-- Adjective
|
||||
|
||||
AP = {s : Species => Gender => NTable } ;
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = ResAra.Noun;
|
||||
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
|
||||
Num, Ord = {s : Gender => State => Case => Str ;
|
||||
n : Size };
|
||||
Predet, QuantSg, QuantPl =
|
||||
{s : Species => Gender => Case => Str;
|
||||
n : ResAra.Number; d : State; isNum : Bool} ;
|
||||
Det = ResAra.Det ;
|
||||
-- {s : Species => Gender => Case => Str ; d : State; n : Size; isNum : Bool } ;
|
||||
Quant = {s : ResAra.Number => Species => Gender => Case => Str; d : State} ;
|
||||
|
||||
-- Adverb
|
||||
|
||||
-- Adv, AdV, AdA, AdS, AdN = {s : Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral = {s : Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
|
||||
|
||||
---- Structural
|
||||
--
|
||||
Conj = {s : Str ; n : ResAra.Number} ;
|
||||
-- DConj = {s1,s2 : Str ; n : ResAra.Number} ;
|
||||
-- PConj = {s : Str} ;
|
||||
-- CAdv = {s : Str} ;
|
||||
-- Subj = {s : Str} ;
|
||||
Prep = {s : Str} ;
|
||||
--
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A = ResAra.Verb ** {c2 : Str} ;
|
||||
V3 = ResAra.Verb ** {c2, c3 : Str} ;
|
||||
-- VV = {s : VVForm => Str ; isAux : Bool} ;
|
||||
--
|
||||
A = ResAra.Adj ;
|
||||
A2 = ResAra.Adj ** {c2 : Str} ;
|
||||
--
|
||||
N, N2 = ResAra.Noun ; --{s : ResAra.Number => State => Case => Str; g : Gender ; h = Species} ;
|
||||
-- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ;
|
||||
N3 = ResAra.Noun ** {c2,c3 : Str} ;
|
||||
PN = {s : Case => Str} ;
|
||||
|
||||
}
|
||||
45
lib/resource/arabic/ConjunctionAra.gf
Normal file
45
lib/resource/arabic/ConjunctionAra.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
concrete ConjunctionAra of Conjunction =
|
||||
CatAra ** open ResAra, Coordination, Prelude in {
|
||||
--
|
||||
-- flags optimize=all_subs ;
|
||||
--
|
||||
-- lin
|
||||
--
|
||||
-- ConjS = conjunctSS ;
|
||||
-- DConjS = conjunctDistrSS ;
|
||||
--
|
||||
-- ConjAdv = conjunctSS ;
|
||||
-- DConjAdv = conjunctDistrSS ;
|
||||
--
|
||||
-- ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
-- } ;
|
||||
-- DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
-- } ;
|
||||
--
|
||||
-- ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
-- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
--
|
||||
---- These fun's are generated from the list cat's.
|
||||
--
|
||||
-- BaseS = twoSS ;
|
||||
-- ConsS = consrSS comma ;
|
||||
-- BaseAdv = twoSS ;
|
||||
-- ConsAdv = consrSS comma ;
|
||||
-- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
-- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
--
|
||||
-- lincat
|
||||
-- [S] = {s1,s2 : Str} ;
|
||||
-- [Adv] = {s1,s2 : Str} ;
|
||||
-- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||
--
|
||||
}
|
||||
26
lib/resource/arabic/ExtAra.gf
Normal file
26
lib/resource/arabic/ExtAra.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
concrete ExtAra of ExtAraAbs = CatAra ** open ResAra in {
|
||||
--
|
||||
-- lincat
|
||||
--
|
||||
-- Aux = {s : Polarity => Str} ;
|
||||
--
|
||||
-- lin
|
||||
--
|
||||
-- PredAux np aux vp = mkClause (np.s ! Nom) np.a {
|
||||
-- s = \\t,ant,b,ord,agr =>
|
||||
-- let
|
||||
-- fin = aux.s ! b ;
|
||||
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
||||
-- {fin = x ; inf = y} ;
|
||||
-- in
|
||||
-- case ant of {
|
||||
-- Simul => vf fin [] ;
|
||||
-- Anter => vf fin "هَثي"
|
||||
-- } ;
|
||||
-- s2 = \\agr => infVP vp agr
|
||||
-- } ;
|
||||
--
|
||||
-- can_Aux = {s = \\p => posneg p "عَن"} ; ---- cannt
|
||||
-- must_Aux = {s = \\p => posneg p "مُست"} ;
|
||||
--
|
||||
}
|
||||
14
lib/resource/arabic/IdiomAra.gf
Normal file
14
lib/resource/arabic/IdiomAra.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
concrete IdiomAra of Idiom = CatAra ** open Prelude, ResAra in {
|
||||
--
|
||||
-- flags optimize=all_subs ;
|
||||
--
|
||||
-- lin
|
||||
-- ExistNP np =
|
||||
-- mkClause "تهري" (agrP3 np.a.n) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
-- ImpersCl vp = mkClause "ِت" (agrP3 Sg) vp ;
|
||||
-- GenericCl vp = mkClause "ْني" (agrP3 Sg) vp ;
|
||||
--
|
||||
-- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
--
|
||||
}
|
||||
|
||||
181
lib/resource/arabic/IrregAra.gf
Normal file
181
lib/resource/arabic/IrregAra.gf
Normal file
@@ -0,0 +1,181 @@
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
--
|
||||
concrete IrregAra of IrregAraAbs = CatAra ** open ParadigmsAra in {
|
||||
--
|
||||
--flags optimize=values ;
|
||||
--
|
||||
-- lin
|
||||
-- awake_V = irregV "َوَكي" "َوْكي" "َوْكن" ;
|
||||
-- bear_V = irregV "بَر" "بْري" "بْرن" ;
|
||||
-- beat_V = irregV "بَت" "بَت" "بَت" ;
|
||||
-- become_V = irregV "بعْمي" "بعَمي" "بعْمي" ;
|
||||
-- begin_V = irregV "بغِن" "بغَن" "بغُن" ;
|
||||
-- bend_V = irregV "بند" "بنت" "بنت" ;
|
||||
-- beset_V = irregV "بست" "بست" "بست" ;
|
||||
-- bet_V = irregDuplV "بت" "بت" "بت" ;
|
||||
-- bid_V = irregDuplV "بِد" (variants {"بِد" ; "بَدي"}) (variants {"بِد" ; "بِدّن"}) ;
|
||||
-- bind_V = irregV "بِند" "بُْند" "بُْند" ;
|
||||
-- bite_V = irregV "بِتي" "بِت" "بِتّن" ;
|
||||
-- bleed_V = irregV "بلّد" "بلد" "بلد" ;
|
||||
-- blow_V = irregV "بلْو" "بلو" "بلْون" ;
|
||||
-- break_V = irregV "برَك" "برْكي" "برْكن" ;
|
||||
-- breed_V = irregV "برّد" "برد" "برد" ;
|
||||
-- bring_V = irregV "برِنغ" "برُْغهت" "برُْغهت" ;
|
||||
-- broadcast_V = irregV "برَْدعَست" "برَْدعَست" "برَْدعَست" ;
|
||||
-- build_V = irregV "بُِلد" "بُِلت" "بُِلت" ;
|
||||
-- burn_V = irregV "بُرن" (variants {"بُرند" ; "بُرنت"}) (variants {"بُرند" ; "بُرنت"}) ;
|
||||
-- burst_V = irregV "بُرست" "بُرست" "بُرست" ;
|
||||
-- buy_V = irregV "بُي" "بُْغهت" "بُْغهت" ;
|
||||
-- cast_V = irregV "عَست" "عَست" "عَست" ;
|
||||
-- catch_V = irregV "عَتعه" "عَُغهت" "عَُغهت" ;
|
||||
-- choose_V = irregV "عهّْسي" "عهْسي" "عهْسن" ;
|
||||
-- cling_V = irregV "علِنغ" "علُنغ" "علُنغ" ;
|
||||
-- come_V = irregV "عْمي" "عَمي" "عْمي" ;
|
||||
-- cost_V = irregV "عْست" "عْست" "عْست" ;
|
||||
-- creep_V = irregV "عرّة" "عرةت" "عرةت" ;
|
||||
-- cut_V = irregDuplV "عُت" "عُت" "عُت" ;
|
||||
-- deal_V = irregV "دَل" "دَلت" "دَلت" ;
|
||||
-- dig_V = irregDuplV "دِغ" "دُغ" "دُغ" ;
|
||||
-- dive_V = irregV "دِثي" (variants {"دِثد" ; "دْثي"}) "دِثد" ;
|
||||
-- do_V = mkV "دْ" "دْس" "دِد" "دْني" "دِْنغ" ;
|
||||
-- draw_V = irregV "درَو" "درو" "درَون" ;
|
||||
-- dream_V = irregV "درَم" (variants {"درَمد" ; "درَمت"}) (variants {"درَمد" ; "درَمت"}) ;
|
||||
-- drive_V = irregV "درِثي" "درْثي" "درِثن" ;
|
||||
-- drink_V = irregV "درِنك" "درَنك" "درُنك" ;
|
||||
-- eat_V = irregV "َت" "َتي" "َتن" ;
|
||||
-- fall_V = irregV "فَلّ" "فلّ" "فَلّن" ;
|
||||
-- feed_V = irregV "فّد" "فد" "فد" ;
|
||||
-- feel_V = irregV "فّل" "فلت" "فلت" ;
|
||||
-- fight_V = irregV "فِغهت" "فُْغهت" "فُْغهت" ;
|
||||
-- find_V = irregV "فِند" "فُْند" "فُْند" ;
|
||||
-- fit_V = irregDuplV "فِت" "فِت" "فِت" ;
|
||||
-- flee_V = irregV "فلّ" "فلد" "فلد" ;
|
||||
-- fling_V = irregV "فلِنغ" "فلُنغ" "فلُنغ" ;
|
||||
-- fly_V = irregV "فلي" "فلو" "فلْون" ;
|
||||
-- forbid_V = irregDuplV "فْربِد" "فْربَدي" "فْربِدّن" ;
|
||||
-- forget_V = irregDuplV "فْرغت" "فْرغْت" "فْرغْتّن" ;
|
||||
-- forgive_V = irregV "فْرغِثي" "فْرغَثي" "فْرغِثن" ;
|
||||
-- forsake_V = irregV "فْرسَكي" "فْرسّْك" "فْرسَكن" ;
|
||||
-- freeze_V = irregV "فرّزي" "فرْزي" "فرْزن" ;
|
||||
-- get_V = irregDuplV "غت" "غْت" "غْتّن" ;
|
||||
-- give_V = irregV "غِثي" "غَثي" "غِثن" ;
|
||||
-- go_V = irregV "غْ" "ونت" "غْني" ;
|
||||
-- grind_V = irregV "غرِند" "غرُْند" "غرُْند" ;
|
||||
-- grow_V = irregV "غرْو" "غرو" "غرْون" ;
|
||||
-- hang_V = irregV "هَنغ" "هُنغ" "هُنغ" ;
|
||||
-- have_V = mkV "هَثي" "هَس" "هَد" "هَد" "هَثِنغ" ;
|
||||
-- hear_V = irregV "هَر" "هَرد" "هَرد" ;
|
||||
-- hide_V = irregV "هِدي" "هِد" "هِدّن" ;
|
||||
-- hit_V = irregDuplV "هِت" "هِت" "هِت" ;
|
||||
-- hold_V = irregV "هْلد" "هلد" "هلد" ;
|
||||
-- hurt_V = irregV "هُرت" "هُرت" "هُرت" ;
|
||||
-- keep_V = irregV "كّة" "كةت" "كةت" ;
|
||||
-- kneel_V = irregV "كنّل" "كنلت" "كنلت" ;
|
||||
-- knit_V = irregDuplV "كنِت" "كنِت" "كنِت" ;
|
||||
-- know_V = irregV "كنْو" "كنو" "كنْو" ;
|
||||
-- lay_V = irregV "لَي" "لَِد" "لَِد" ;
|
||||
-- lead_V = irregV "لَد" "لد" "لد" ;
|
||||
-- leap_V = irregV "لَة" (variants {"لَةد" ; "لةت"}) (variants {"لَةد" ; "لةت"}) ;
|
||||
-- learn_V = irregV "لَرن" (variants {"لَرند" ; "لَرنت"}) (variants {"لَرند" ; "لَرنت"}) ;
|
||||
-- leave_V = irregV "لَثي" "لفت" "لفت" ;
|
||||
-- lend_V = irregV "لند" "لنت" "لنت" ;
|
||||
-- let_V = irregDuplV "لت" "لت" "لت" ;
|
||||
-- lie_V = irregV "لِي" "لَي" "لَِن" ;
|
||||
-- light_V = irregV "لِغهت" (variants {"لِغهتد" ; "لِت"}) "لِغهتد" ;
|
||||
-- lose_V = irregV "لْسي" "لْست" "لْست" ;
|
||||
-- make_V = irregV "مَكي" "مَدي" "مَدي" ;
|
||||
-- mean_V = irregV "مَن" "مَنت" "مَنت" ;
|
||||
-- meet_V = irregV "مّت" "مت" "مت" ;
|
||||
-- misspell_V = irregV "مِسّةلّ" (variants {"مِسّةلّد" ; "مِسّةلت"}) (variants {"مِسّةلّد" ; "مِسّةلت"}) ;
|
||||
-- mistake_V = irregV "مِستَكي" "مِستّْك" "مِستَكن" ;
|
||||
-- mow_V = irregV "مْو" "مْود" (variants {"مْود" ; "مْون"}) ;
|
||||
-- overcome_V = irregV "ْثرعْمي" "ْثرعَمي" "ْثرعْمي" ;
|
||||
-- overdo_V = mkV "ْثردْ" "ْثردْس" "ْثردِد" "ْثردْني" "ْثردِْنغ" ;
|
||||
-- overtake_V = irregV "ْثرتَكي" "ْثرتّْك" "ْثرتَكن" ;
|
||||
-- overthrow_V = irregV "ْثرتهرْو" "ْثرتهرو" "ْثرتهرْون" ;
|
||||
-- pay_V = irregV "ةَي" "ةَِد" "ةَِد" ;
|
||||
-- plead_V = irregV "ةلَد" "ةلد" "ةلد" ;
|
||||
-- prove_V = irregV "ةرْثي" "ةرْثد" (variants {"ةرْثد" ; "ةرْثن"}) ;
|
||||
-- put_V = irregDuplV "ةُت" "ةُت" "ةُت" ;
|
||||
-- quit_V = irregDuplV "قُِت" "قُِت" "قُِت" ;
|
||||
-- read_V = irregV "رَد" "رَد" "رَد" ;
|
||||
-- rid_V = irregDuplV "رِد" "رِد" "رِد" ;
|
||||
-- ride_V = irregV "رِدي" "رْدي" "رِدّن" ;
|
||||
-- ring_V = irregV "رِنغ" "رَنغ" "رُنغ" ;
|
||||
-- rise_V = irregV "رِسي" "رْسي" "رِسن" ;
|
||||
-- run_V = irregDuplV "رُن" "رَن" "رُن" ;
|
||||
-- saw_V = irregV "سَو" "سَود" (variants {"سَود" ; "سَون"}) ;
|
||||
-- say_V = irregV "سَي" "سَِد" "سَِد" ;
|
||||
-- see_V = irregV "سّ" "سَو" "سّن" ;
|
||||
-- seek_V = irregV "سّك" "سُْغهت" "سُْغهت" ;
|
||||
-- sell_V = irregV "سلّ" "سْلد" "سْلد" ;
|
||||
-- send_V = irregV "سند" "سنت" "سنت" ;
|
||||
-- set_V = irregDuplV "ست" "ست" "ست" ;
|
||||
-- sew_V = irregV "سو" "سود" (variants {"سود" ; "سون"}) ;
|
||||
-- shake_V = irregV "سهَكي" "سهّْك" "سهَكن" ;
|
||||
-- shave_V = irregV "سهَثي" "سهَثد" (variants {"سهَثد" ; "سهَثن"}) ;
|
||||
-- shear_V = irregV "سهَر" "سهْري" "سهْرن" ;
|
||||
-- shed_V = irregDuplV "سهد" "سهد" "سهد" ;
|
||||
-- shine_V = irregV "سهِني" "سهْني" "سهْني" ;
|
||||
-- shoe_V = irregV "سهْي" "سهْد" (variants {"سهْد" ; "سهْد"}) ;
|
||||
-- shoot_V = irregV "سهّْت" "سهْت" "سهْت" ;
|
||||
-- show_V = irregV "سهْو" "سهْود" (variants {"سهْود" ; "سهْون"}) ;
|
||||
-- shrink_V = irregV "سهرِنك" "سهرَنك" "سهرُنك" ;
|
||||
-- shut_V = irregDuplV "سهُت" "سهُت" "سهُت" ;
|
||||
-- sing_V = irregV "سِنغ" "سَنغ" "سُنغ" ;
|
||||
-- sink_V = irregV "سِنك" "سَنك" "سُنك" ;
|
||||
-- sit_V = irregDuplV "سِت" "سَت" "سَت" ;
|
||||
-- sleep_V = irregV "سلّة" "سلةت" "سلةت" ;
|
||||
-- slay_V = irregV "سلَي" "سلو" "سلَِن" ;
|
||||
-- slide_V = irregV "سلِدي" "سلِد" "سلِد" ;
|
||||
-- sling_V = irregV "سلِنغ" "سلُنغ" "سلُنغ" ;
|
||||
-- slit_V = irregDuplV "سلِت" "سلِت" "سلِت" ;
|
||||
-- smite_V = irregV "سمِتي" "سمْتي" "سمِتّن" ;
|
||||
-- sow_V = irregV "سْو" "سْود" (variants {"سْود" ; "سْون"}) ;
|
||||
-- speak_V = irregV "سةَك" "سةْكي" "سةْكن" ;
|
||||
-- speed_V = irregV "سةّد" "سةد" "سةد" ;
|
||||
-- spend_V = irregV "سةند" "سةنت" "سةنت" ;
|
||||
-- spill_V = irregV "سةِلّ" (variants {"سةِلّد" ; "سةِلت"}) (variants {"سةِلّد" ; "سةِلت"}) ;
|
||||
-- spin_V = irregDuplV "سةِن" "سةُن" "سةُن" ;
|
||||
-- spit_V = irregDuplV "سةِت" (variants {"سةِت" ; "سةَت"}) "سةِت" ;
|
||||
-- split_V = irregDuplV "سةلِت" "سةلِت" "سةلِت" ;
|
||||
-- spread_V = irregV "سةرَد" "سةرَد" "سةرَد" ;
|
||||
-- spring_V = irregV "سةرِنغ" (variants {"سةرَنغ" ; "سةرُنغ"}) "سةرُنغ" ;
|
||||
-- stand_V = irregV "ستَند" "ستّْد" "ستّْد" ;
|
||||
-- steal_V = irregV "ستَل" "ستْلي" "ستْلن" ;
|
||||
-- stick_V = irregV "ستِعك" "ستُعك" "ستُعك" ;
|
||||
-- sting_V = irregV "ستِنغ" "ستُنغ" "ستُنغ" ;
|
||||
-- stink_V = irregV "ستِنك" "ستَنك" "ستُنك" ;
|
||||
-- stride_V = irregV "سترِدي" "سترْد" "سترِدّن" ;
|
||||
-- strike_V = irregV "سترِكي" "سترُعك" "سترُعك" ;
|
||||
-- string_V = irregV "سترِنغ" "سترُنغ" "سترُنغ" ;
|
||||
-- strive_V = irregV "سترِثي" "سترْثي" "سترِثن" ;
|
||||
-- swear_V = irregV "سوَر" "سوْري" "سوْرن" ;
|
||||
-- sweep_V = irregV "سوّة" "سوةت" "سوةت" ;
|
||||
-- swell_V = irregV "سولّ" "سولّد" (variants {"سولّد" ; "سوْلّن"}) ;
|
||||
-- swim_V = irregDuplV "سوِم" "سوَم" "سوُم" ;
|
||||
-- swing_V = irregV "سوِنغ" "سوُنغ" "سوُنغ" ;
|
||||
-- take_V = irregV "تَكي" "تّْك" "تَكن" ;
|
||||
-- teach_V = irregV "تَعه" "تَُغهت" "تَُغهت" ;
|
||||
-- tear_V = irregV "تَر" "تْري" "تْرن" ;
|
||||
-- tell_V = irregV "تلّ" "تْلد" "تْلد" ;
|
||||
-- think_V = irregV "تهِنك" "تهُْغهت" "تهُْغهت" ;
|
||||
-- thrive_V = irregV "تهرِثي" (variants {"تهرِثد" ; "تهرْثي"}) "تهرِثد" ;
|
||||
-- throw_V = irregV "تهرْو" "تهرو" "تهرْون" ;
|
||||
-- thrust_V = irregV "تهرُست" "تهرُست" "تهرُست" ;
|
||||
-- tread_V = irregV "ترَد" "ترْد" "ترْدّن" ;
|
||||
-- understand_V = irregV "ُندرستَند" "ُندرستّْد" "ُندرستّْد" ;
|
||||
-- uphold_V = irregV "ُةهْلد" "ُةهلد" "ُةهلد" ;
|
||||
-- upset_V = irregDuplV "ُةست" "ُةست" "ُةست" ;
|
||||
-- wake_V = irregV "وَكي" "وْكي" "وْكن" ;
|
||||
-- wear_V = irregV "وَر" "وْري" "وْرن" ;
|
||||
-- weave_V = irregV "وَثي" (variants {"وَثد" ; "وْثي"}) (variants {"وَثد" ; "وْثن"}) ;
|
||||
-- wed_V = irregDuplV "ود" "ود" "ود" ;
|
||||
-- weep_V = irregV "وّة" "وةت" "وةت" ;
|
||||
-- wind_V = irregV "وِند" "وُْند" "وُْند" ;
|
||||
-- win_V = irregDuplV "وِن" "وْن" "وْن" ;
|
||||
-- withhold_V = irregV "وِتهّْلد" "وِتهّلد" "وِتهّلد" ;
|
||||
-- withstand_V = irregV "وِتهستَند" "وِتهستّْد" "وِتهستّْد" ;
|
||||
-- wring_V = irregV "ورِنغ" "ورُنغ" "ورُنغ" ;
|
||||
-- write_V = irregV "ورِتي" "ورْتي" "ورِتّن" ;
|
||||
}
|
||||
22
lib/resource/arabic/LangAra.gf
Normal file
22
lib/resource/arabic/LangAra.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete LangAra of Lang =
|
||||
NounAra,
|
||||
VerbAra,
|
||||
AdjectiveAra,
|
||||
AdverbAra,
|
||||
NumeralAra,
|
||||
SentenceAra,
|
||||
QuestionAra,
|
||||
RelativeAra,
|
||||
ConjunctionAra,
|
||||
PhraseAra,
|
||||
TextX - [Utt],
|
||||
StructuralAra,
|
||||
IdiomAra,
|
||||
LexiconAra
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
360
lib/resource/arabic/LexiconAra.gf
Normal file
360
lib/resource/arabic/LexiconAra.gf
Normal file
@@ -0,0 +1,360 @@
|
||||
--# -path=.:prelude
|
||||
--
|
||||
concrete LexiconAra of Lexicon = CatAra ** open
|
||||
ParadigmsAra,
|
||||
ResAra,
|
||||
MorphoAra, --shouldn't open it here, only needed reg &sndf
|
||||
Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
airplane_N = sdfN "ط؟ر" "فاعِلة" Fem NoHum ;
|
||||
answer_V2S = dirV2 (v3 "جوب") ;
|
||||
apartment_N = regN "شقّ" "فِعّة" "فِعَل" Fem NoHum ;
|
||||
apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ;
|
||||
art_N = regN "فنّ" "فَعّ" "فُعُول" Masc NoHum ;
|
||||
ask_V2Q = dirV2 (v1 "س؟ل" a a) ;
|
||||
baby_N = regN "طفل" "فِعل" "أَفعال" Masc Hum;
|
||||
bad_A = regA "سي؟" "فَعِّل" ;
|
||||
bank_N = regN "بنك" "فَعل" "فُعُول" Masc NoHum ;
|
||||
beautiful_A = regA "جمل" "فَعِيل" ;
|
||||
become_VA = mkVA (v4 "صبح") ;
|
||||
beer_N = sdfN "بير" "فِعلة" Fem NoHum ;
|
||||
beg_V2V = dirV2 (v5 "وسل") ;
|
||||
big_A = regA "كبر" "فَعِيل" ;
|
||||
bike_N = sdfN "درج" "فَعّالة" Fem NoHum ;
|
||||
bird_N = regN "طير" "فَعل" "فُعُول" Masc NoHum;
|
||||
black_A = clrA "سود" ;
|
||||
blue_A = clrA "زرق" ;
|
||||
boat_N = regN "قرب" "فاعِل" "فَواعِل" Masc NoHum ;
|
||||
book_N = regN "كتب" "فِعال" "فُعُل" Masc NoHum ;
|
||||
boot_N = sdfN "جزم" "فَعلة" Fem NoHum ;
|
||||
boss_N = regN "دور" "مُفِيع" "مُفَعاء" Masc Hum ;
|
||||
boy_N = regN "صبي" "فَعِل" "فُعلان" Masc Hum ;
|
||||
bread_N = regN "خبز" "فُعل" "أَفعال" Masc NoHum ;
|
||||
break_V2 = dirV2 (v1 "كسر" a u) ;
|
||||
broad_A = regA "وسع" "فاعِل" ;
|
||||
brother_N2 = regN "؟خو" "فَع" "فِعلة" Masc Hum ; --FIXME
|
||||
brown_A = regA "بني" "فُعِّل";
|
||||
butter_N = sdfN "سبد" "فُعلة" Fem NoHum ;
|
||||
buy_V2 = dirV2 (v8 "شري") ;
|
||||
camera_N = sdfN "كمر" "فاعِيلا" Fem NoHum ; -- |Alö taSwIr
|
||||
cap_N = sdfN "قبع" "فُعَّلة" Fem NoHum ; --qalnUsö
|
||||
car_N = sdfN "سير" "فَعّالة" Fem NoHum ;
|
||||
carpet_N = sdfN "سجد" "فَعّالة" Fem NoHum ;
|
||||
cat_N = regN "هرّ" "فِعّة" "فِعَل" Fem NoHum ;
|
||||
ceiling_N = regN "سقف" "فَعل" "أَفعُل" Masc NoHum ;
|
||||
chair_N = regN "كرس" "فُعلِي" "فَعالِي" Masc NoHum ;
|
||||
cheese_N = regN "جبن" "فُعلة" "أَفعال" Fem NoHum ;
|
||||
child_N = regN "ولد" "فَعَل" "أَفعال" Masc Hum ;
|
||||
church_N = regN "كنس" "فَعِيلة" "فَعاٱِل" Fem Hum ;
|
||||
city_N = regN "مدن" "فَعِيلة" "فُعُل" Fem NoHum ;
|
||||
clean_A = regA "نظف" "فَعِيل" ;
|
||||
clever_A = regA "جهد" "مُفتَعِل" ;
|
||||
close_V2 = dirV2 (v4 "غلق") ;
|
||||
coat_N = regN "عطف" "مِفعَل" "مَفاعِل" Masc NoHum ;
|
||||
cold_A = regA "برد" "فاعِل" ;
|
||||
come_V = v1 "جي؟" a i ; --check
|
||||
computer_N = regN "حسب" "فاعُول" "فَواعِيل" Masc NoHum ;
|
||||
country_N = regN "بلد" "فَعَل" "فِعال" Masc NoHum ;
|
||||
cousin_N = regN "قرب" "فَعِيل" "أَفعِلاء" Masc Hum ; -- (<bn / bnt) (cam[ö] / xAl[ö])
|
||||
cow_N = sdfN "بقر" "فَعلة" Fem NoHum ;
|
||||
die_V = v1 "موت" a u ; --check
|
||||
dirty_A = regA "وسخ" "فَعِل" ;
|
||||
distance_N3 = mkN3 (sdfN "سوف" "مَفاعة" Fem NoHum) "مِن" "إِلَى" ;
|
||||
doctor_N = regN "طبّ" "فَعِيل" "أَفِعّاء" Masc Hum ;
|
||||
dog_N = regN "كلب" "فَعل" "فِعال" Masc NoHum ;
|
||||
door_N = regN "بوب" "فاع" "أَفعال" Masc NoHum ;
|
||||
drink_V2 = dirV2 (v1 "شرب" i a) ;
|
||||
easy_A2V = mkA2 (regA "سهل" "فَعل") "لِ" ;
|
||||
eat_V2 = dirV2 (v1 "؟كل" a u) ;
|
||||
empty_A = regA "فرج" "فاعِل" ;
|
||||
enemy_N = regN "عدو" "فَعُلّ" "أَفعاء" Masc Hum ;
|
||||
factory_N = regN "صنع" "مَفعَل" "مَفاعِل" Masc NoHum ;
|
||||
father_N2 = regN "؟ب" "فَع" "أَفعاء" Masc Hum;
|
||||
fear_VS = mkVS (v1 "خشي" i a );
|
||||
find_V2 = dirV2 (v1 "وجد" a i ) ;
|
||||
fish_N = regN "سمك" "فَعَلة" "أَفعال" Fem NoHum ;
|
||||
floor_N = regN "؟رض" "فَعل" "فَعالِي" Fem NoHum;
|
||||
forget_V2 = dirV2 (v1 "نسي" i a ) ;
|
||||
fridge_N = sdfN "برد" "فَعّال" Masc NoHum ;
|
||||
friend_N = regN "صدق" "فَعِيل" "أَفعِلاء" Masc Hum ; --SadIqö
|
||||
fruit_N = regN "فكه" "فاعِلة" "فَواعِل" Fem NoHum ;
|
||||
fun_AV = regA "متع" "مُفعِل" ;
|
||||
garden_N = regN "حدق" "فَعِيلة" "فَعاٱِل" Fem NoHum ;
|
||||
girl_N = regN "بنت" "فِعل" "فَعال" Fem Hum ;
|
||||
glove_N = sdfN "قفز" "فُعّال" Masc NoHum ;
|
||||
gold_N = sdfN "ذهب" "فَعَل" Masc NoHum ;
|
||||
good_A = regA "جود" "فَيِّع" ; -- Hasan, HisAn
|
||||
go_V = v1 "ذهب" a a ;
|
||||
green_A = clrA "خضر" ;
|
||||
harbour_N = regN "رف؟" "مَفعَل" "مَفاعِل" Masc NoHum ; --mInA', marsaY
|
||||
hate_V2 = dirV2 (v1 "كره" a i ) ;
|
||||
hat_N = sdfN "قبع" "فُعَّلة" Fem NoHum ;
|
||||
have_V2 = dirV2 (v1 "ملك" a i) ; --FIXME, have is PP in Arabic
|
||||
hear_V2 = dirV2 (v1 "سمع" i a) ;
|
||||
hill_N = regN "هضب" "فَعلة" "فِعال" Fem NoHum ; --tallö, rAbiyö
|
||||
hope_VS = mkVS (v1 "رجو" a u) ; --check
|
||||
horse_N = regN "حصن" "فِعال" "أَفعِلة" Masc NoHum ;
|
||||
hot_A = regA "سخن" "فاعِل" ; --HAr
|
||||
house_N = regN "بيت" "فَعل" "فُعُول" Masc NoHum ; --manzil
|
||||
important_A = regA "هيم" "فاعّ" ;
|
||||
industry_N = sdfN "صنع" "فِعالة" Fem NoHum ;
|
||||
iron_N = regN "حدّ" "فَعِيل" "فَعائِل" Masc NoHum ;
|
||||
king_N = regN "ملك" "فَعِل" "فُعُول" Masc Hum ;
|
||||
know_V2 = dirV2 (v1 "عرف" i a) ;
|
||||
lake_N = sdfN "بحر" "فُعَيلة" Fem NoHum ;
|
||||
lamp_N = regN "صبح" "مِفعال" "مَفاعِيل" Masc NoHum ; --qanDIl, fAnUs
|
||||
learn_V2 = dirV2 (v5 "علم") ;
|
||||
leather_N = regN "جلد" "فِعل" "فُعُول" Masc NoHum ;
|
||||
leave_V2 = dirV2 (v1 "ترك" a u) ;
|
||||
like_V2 = dirV2 (v1 "هوي" i a) ; --check
|
||||
listen_V2 = mkV2 (v8 "سمع") "إِلَى" ;
|
||||
live_V = v1 "عيش" a i ; --check
|
||||
long_A = regA "طول" "فَعِيل" ;
|
||||
lose_V2 = dirV2 (v1 "خسر" i a) ; --Dayyac, >aDAc
|
||||
love_N = regN "حبّ" "فُعّ" "فُعّ" Masc NoHum ; -- no plur
|
||||
love_V2 = dirV2 (v1 "حبّ" a i) ;
|
||||
man_N = regN "رجل" "فَعُل" "فِعال" Masc Hum ;
|
||||
married_A2 = mkA2 (regA "زوج" "مُتَفَعِّل") "مِن" ;
|
||||
meat_N = regN "لحم" "فَعلة" "فُعُول" Masc NoHum ;
|
||||
milk_N = regN "حلب" "فَعِيل" "فَعِيل" Masc NoHum ; --no plur
|
||||
moon_N = regN "قمر" "فَعَل" "أَفعال" Masc NoHum ;
|
||||
mother_N2 = sdfN "؟م" "فُعّ" Fem Hum ;
|
||||
mountain_N = regN "جبل" "فَعَل" "فِعال" Masc NoHum ;
|
||||
music_N = mkN (reg "مُوسِيقَى" "مُوسِيقَى") Fem NoHum ; --no plur
|
||||
narrow_A = regA "ضيق" "فَعِّل" ;
|
||||
new_A = regA "جدّ" "فَعِيل" ;
|
||||
newspaper_N = regN "صحف" "فَعِيلة" "فُعُل" Fem NoHum ;
|
||||
oil_N = regN "زيت" "فَعل" "فُعُول" Masc NoHum ;
|
||||
old_A = regA "قدم" "فَعِيل" ;
|
||||
open_V2 = dirV2 (v1 "فتح" a a ) ;
|
||||
paint_V2A = mkV2A (v1 "دهن" a u ) [] ;
|
||||
paper_N = regN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
|
||||
-- paris_PN = regPN "بارِيس" nonhuman ;
|
||||
peace_N = regN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
|
||||
pen_N = regN "قلم" "فَعَل" "أَفعال" Masc NoHum;
|
||||
planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal
|
||||
plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ;
|
||||
play_V2 = dirV2 (v1 "لعب" i a) ;
|
||||
policeman_N = sdmN "شرط" "فِعلِي" Masc Hum ;
|
||||
priest_N = regN "قسّ" "فِعِّيل" "أَفِعّة" Masc Hum ;
|
||||
probable_AS = mkAS (regA "مكن" "مُفعِل") ;
|
||||
queen_N = sdfN "ملك" "فَعِلة" Fem Hum ;
|
||||
radio_N = mkN (sndf "راديُو") Masc NoHum ;
|
||||
rain_V0 = mkV0 (v1 "مطر" a u) ;
|
||||
read_V2 = dirV2 (v1 "قر؟" a a ) ;
|
||||
red_A = clrA "حمر" ;
|
||||
religion_N = regN "دين" "فِعل" "أَفعال" Masc NoHum ;
|
||||
restaurant_N = regN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ;
|
||||
river_N = regN "نهر" "فَعل" "أَفعال" Masc NoHum ;
|
||||
rock_N = regN "صخر" "فَعلة" "فُعُول" Fem NoHum ;
|
||||
roof_N = regN "سطح" "فَعل" "أَفعُل" Masc NoHum ;
|
||||
rubber_N = regN "مطّ" "فَعّال" "فَعّال" Masc NoHum ; -- no hum
|
||||
run_V = v1 "ركض" a u ;
|
||||
say_VS = mkVS (v1 "قول" a u) ; --check
|
||||
school_N = regN "درس" "مَسفعَلة" "مَفاعِل" Masc NoHum ;
|
||||
science_N = regN "علم" "فِعل" "فُعُول" Masc NoHum ;
|
||||
sea_N = regN "بحر" "فَعل" "فُعُول" Masc NoHum ;
|
||||
seek_V2 = dirV2 (v1 "طلب" a u) ;
|
||||
see_V2 = dirV2 (v1 "ر؟ي" a a) ;
|
||||
sell_V3 = dirdirV3 (v1 "بيع" a i) ; --check
|
||||
send_V3 = dirdirV3 (v4 "رسل") ;
|
||||
sheep_N = regN "خرف" "فَعُول" "فِعال" Masc NoHum ;
|
||||
ship_N = regN "سفن" "فَعِيلة" "فُعُل" Fem NoHum ;
|
||||
shirt_N = regN "قمص" "فَعِيل" "فُعلان" Masc NoHum ;
|
||||
shoe_N = regN "حذو" "فِعاء" "أَفعِية" Masc NoHum ;
|
||||
shop_N = regN "تجر" "مَفعَل" "مَفاعِل" Masc NoHum ;
|
||||
short_A = regA "قصر" "فَعِيل" ;
|
||||
silver_N = regN "فضّ" "فِعّة" "فِعَل" Fem NoHum ;
|
||||
sister_N = regN "؟خو" "فُعت" "فَعَوات" Fem Hum ; --FIXME
|
||||
sleep_V = v1 "نوم" i a ; --check
|
||||
small_A = regA "صغر" "فَعِيل" ;
|
||||
snake_N = sdfN "حيّ" "فَعّة" Fem NoHum ;
|
||||
sock_N = regN "جرب" "فَوعَل" "فَواعِل" Masc NoHum ;
|
||||
speak_V2 = dirV2 (v5 "كلم") ;
|
||||
star_N = regN "نجم" "فَعل" "فُعُول" Masc NoHum ; --najmö
|
||||
steel_N = regN "فلذ" "فُوعال" "فَواعِل" Masc NoHum ;
|
||||
stone_N = regN "حجر" "فَعَل" "أَفعال" Masc NoHum ;
|
||||
stove_N = regN "وقد" "مَفعِل" "مَفاعِل" Masc NoHum ;
|
||||
student_N = regN "طلب" "فاعِل" "فُعّال" Masc Hum ; --tilmI*
|
||||
stupid_A = clrA "بله" ;
|
||||
sun_N = regN "شمس" "فَعل" "فُعُول" Fem NoHum ;
|
||||
switch8off_V2 = dirV2 (v4 "طف؟") ;
|
||||
switch8on_V2 = dirV2 (v4 "شعل") ;
|
||||
table_N = sdfN "طول" "فاعِلة" Fem NoHum ;
|
||||
talk_V3 = mkV3 (v5 "حدث") "لِ" "عَن" ;
|
||||
teacher_N = sdmN "علم" "مُفَعِّل" Masc Hum ; --mucal~imö
|
||||
teach_V2 = dirV2 (v2 "علم") ;
|
||||
television_N = mkN (sndf "تِلِفِزيُون") Masc NoHum ;
|
||||
thick_A = regA "سمك" "فَعِيل" ;
|
||||
thin_A = regA "رفع" "فَعِيل" ;
|
||||
train_N = sdfN "قطر" "فِعال" Masc NoHum;
|
||||
travel_V = v3 "سفر" ;
|
||||
tree_N = regN "شجر" "فَعلة" "أَفعال" Fem NoHum ;
|
||||
ugly_A = regA "قبح" "فَعِيل" ;
|
||||
understand_V2 = dirV2 (v1 "فهم" i a ) ;
|
||||
university_N = sdfN "جمع" "فاعِلة" Fem NoHum ;
|
||||
village_N = regN "قري" "فَعلة" "فُعَى" Fem NoHum ; --Daycö
|
||||
wait_V2 = dirV2 (v8 "نظر") ;
|
||||
walk_V = v1 "مشي" a i ; --check
|
||||
warm_A = regA "دف؟" "فاعِل" ;
|
||||
war_N = regN "حرب" "فَعل" "فُعُول" Fem NoHum ;
|
||||
watch_V2 = dirV2 (v3 "شهد") ;
|
||||
water_N = mkN (reg "ماء" "مِياه") Fem NoHum ; --"موه" "فاء" "فِياع" ??
|
||||
white_A = clrA "بيض" ;
|
||||
window_N = regN "نفذ" "فاعِلة" "فَواعِل" Fem NoHum ; --$ub~Ak
|
||||
wine_N = regN "خمر" "فَعل" "فُعُول" Masc NoHum ;
|
||||
win_V2 = dirV2 (v1 "ربح" a i) ;
|
||||
woman_N = mkN (reg "إِمرَأَة" "نِسوَة") Fem Hum ;
|
||||
wonder_VQ = mkVQ (v6 "س؟ل") ;
|
||||
wood_N = regN "خشب" "فَعَل" "أَفعال" Masc NoHum ;
|
||||
write_V2 = dirV2 (v1 "كتب" a u) ;
|
||||
yellow_A = clrA "صفر" ;
|
||||
young_A = regA "شبّ" "فاعّ" ;
|
||||
|
||||
do_V2 = dirV2 (v1 "فعل" a a ) ;
|
||||
now_Adv = mkAdv "الآن" ;
|
||||
already_Adv = mkAdv "سابِقاً" ;
|
||||
song_N = regN "غني" "أَفعِلة" "أَفاعِي" Fem NoHum ;
|
||||
add_V3 = dirV3 (v1 "جمع" a a) "وَ" ;
|
||||
number_N = regN "رقم" "فَعل" "أَفعال" Masc NoHum ; --cadad
|
||||
put_V2 = dirV2 (v1 "وضع" a a );
|
||||
stop_V = v5 "وقف" ;
|
||||
jump_V = v1 "قفز" a i ;
|
||||
|
||||
left_Ord = mkOrd "أَيسَر" "يُسرَى";
|
||||
right_Ord = mkOrd "أَيمَن" "يُمنَى" ;
|
||||
|
||||
far_Adv = mkAdv "بَعِيداً" ;
|
||||
correct_A = regA "صحّ" "فَعِيل" ;
|
||||
dry_A = regA "نشف" "فاعِل" ;
|
||||
dull_A = regA "بهت" "فاعِل" ;
|
||||
full_A = regA "مل؟" "فَعِيل" ;
|
||||
heavy_A = regA "ثقل" "فَعِيل" ;
|
||||
near_A = regA "قرب" "فَعِيل" ;
|
||||
rotten_A = regA "فسد" "فاعِل" ;
|
||||
round_A = regA "دور" "مُفَعَّل" ;
|
||||
sharp_A = regA "حدّ" "فاعّ" ;
|
||||
smooth_A = regA "نعم" "فاعِل" ;
|
||||
straight_A = regA "قوم" "مُستَفِيع" ;
|
||||
wet_A = regA "رطب" "فَعِل" ;
|
||||
wide_A = regA "وسع" "فاعِل" ;
|
||||
|
||||
animal_N = sdfN "حيّ" "فَعَوان" Masc NoHum ;
|
||||
ashes_N = regN "رمد" "فَعال" "أَفعِلة" Masc NoHum;
|
||||
back_N = regN "ظهر" "فَعل" "فُعُول" Masc NoHum;
|
||||
bark_N = regN "نبح" "فَعل" "فُعال" Masc NoHum;
|
||||
belly_N = regN "بطن" "فَعل" "فُعُول" Fem NoHum;
|
||||
blood_N = regN "دم" "فَع" "فِعاء" Masc NoHum;
|
||||
bone_N = regN "عظم" "فَعلة" "فِعال" Fem NoHum;
|
||||
breast_N = regN "صدر" "فَعل" "فُعُول" Masc NoHum;
|
||||
cloud_N = regN "غيم" "فَعلة" "فُعُول" Fem NoHum;
|
||||
day_N = regN "يوم" "فَعل" "أَفّاع" Masc NoHum;
|
||||
dust_N = regN "غبر" "فُعال" "أَفعِلة" Masc NoHum;
|
||||
ear_N = regN "؟ذن" "فُعل" "أَفعال" Fem NoHum;
|
||||
earth_N = regN "ترب" "فُعلة" "فُعَل" Fem NoHum;
|
||||
egg_N = sdfN "بيض" "فَعلة" Fem NoHum;
|
||||
eye_N = regN "عين" "فَعل" "فُعُول" Fem NoHum;
|
||||
fat_N = regN "دهن" "فُعل" "فُعُول" Masc NoHum ;
|
||||
feather_N = sdfN "ريش" "فِعلة" Fem NoHum;
|
||||
fingernail_N = regN "ظفر" "فُعل" "أَفاعِل" Masc NoHum;
|
||||
fire_N = regN "نور" "فاع" "فِيعان" Fem NoHum;
|
||||
flower_N = regN "زهر" "فَعلة" "فُعُول" Fem NoHum;
|
||||
fog_N = regN "ضبّ" "فَعال" "فَعال" Masc NoHum; --no plural ?
|
||||
foot_N = regN "قدم" "فَعَل" "أَفعال" Fem NoHum;
|
||||
forest_N = sdfN "غيب" "فاعة" Fem NoHum;
|
||||
grass_N = regN "عشب" "فُعلة" "أَفعال" Fem NoHum;
|
||||
guts_N = regN "حشو" "فَعا" "أَفعاء" Fem NoHum;
|
||||
hair_N = sdfN "شعر" "فَعلة" Fem NoHum ;
|
||||
hand_N = regN "يد" "فَع" "أَفاعِي" Fem NoHum ;
|
||||
head_N = regN "ر؟س" "فَعل" "فُعُول" Masc NoHum;
|
||||
heart_N = regN "قلب" "فَعل" "فُعُول" Masc NoHum;
|
||||
horn_N = regN "قرن" "فَعل" "فُعُول" Masc NoHum;
|
||||
husband_N = regN "زوج" "فَعل" "أَفعال" Masc NoHum;
|
||||
ice_N = regN "ثلج" "فَعل" "فُعُول" Masc NoHum;
|
||||
knee_N = regN "ركب" "فُعلة" "فُعَل" Fem NoHum;
|
||||
leaf_N = regN "ورق" "فَعَلة" "أَفعال" Fem NoHum;
|
||||
leg_N = regN "رجل" "فِعل" "أَفعُل" Fem NoHum;
|
||||
liver_N = regN "كبد" "فَعِل" "أَفعال" Masc NoHum ;
|
||||
louse_N = sdfN "قمل" "فَعلة" Fem NoHum;
|
||||
mouth_N = regN "فوه" "فُعل" "أَفعال" Masc NoHum ;
|
||||
name_N = regN "؟سم" "فِعل" "فَعالِي" Masc NoHum;
|
||||
neck_N = regN "رقب" "فَعَلة" "فِعال" Fem NoHum;
|
||||
night_N = regN "ليل" "فَعلة" "فَعالِي" Fem NoHum; --plural?
|
||||
nose_N = regN "؟نف" "فَعل" "فُعُول" Masc NoHum;
|
||||
person_N = regN "شخص" "فَعل" "أَفعال" Masc Hum;
|
||||
rain_N = regN "مطر" "فَعَل" "أَفعال" Masc NoHum;
|
||||
road_N = regN "طرق" "فَعِيل" "فُعُل" Fem NoHum;
|
||||
root_N = regN "جذر" "فَعل" "فُعُول" Masc NoHum ;
|
||||
rope_N = regN "حبل" "فَعل" "فِعال" Masc NoHum;
|
||||
salt_N = regN "ملح" "فِعل" "أَفعال" Masc NoHum;
|
||||
sand_N = regN "رمل" "فَعل" "فِعال" Masc NoHum;
|
||||
seed_N = regN "بذر" "فَعل" "فُعُول" Masc NoHum;
|
||||
skin_N = regN "جلد" "فِعل" "فُعُول" Masc NoHum;
|
||||
sky_N = sdfN "سمو" "فَعاء" Fem NoHum;
|
||||
smoke_N = regN "دخن" "فُعال" "أَفعِلة" Masc NoHum;
|
||||
snow_N = regN "ثلج" "فَعل" "فُعُول" Masc NoHum;
|
||||
stick_N = regN "عصو" "فَعا" "فِعِي" Masc NoHum ; --"عصو"
|
||||
tail_N = regN "ذنب" "فَعَل" "أَفعال" Masc NoHum;
|
||||
tongue_N = regN "لسن" "فِعال" "أَفعِلة" Masc NoHum;
|
||||
tooth_N = regN "سنّ" "فِعل" "أَفعال" Masc NoHum ;
|
||||
wife_N = sdfN "زوج" "فَعلة" Fem Hum;
|
||||
wind_N = regN "ريح" "فِعل" "فِعال" Fem NoHum;
|
||||
wing_N = regN "جنح" "فَعال" "أَفعِلة" Masc NoHum ;
|
||||
worm_N = regN "دود" "فُعلة" "فِيعان" Fem NoHum ;
|
||||
year_N = sdfN "سن" "فَعة" Fem NoHum ;
|
||||
|
||||
blow_V = v1 "نفخ" a u ;
|
||||
breathe_V = dirV2 (v5 "نفس") ;
|
||||
burn_V = v1 "حرق" a i ;
|
||||
dig_V = v1 "حفر" a i ;
|
||||
fall_V = v1 "وقع" a a ;
|
||||
float_V = v1 "عوم" a u ;
|
||||
flow_V = v1 "سيل" a i ;
|
||||
fly_V = v1 "طير" a i ;
|
||||
freeze_V = v2 "جمد" ;
|
||||
give_V3 = dirdirV3 (v4 "عطي") ;
|
||||
laugh_V = v1 "ضحك" i a ;
|
||||
lie_V = v1 "كذب" a i ;
|
||||
play_V = v1 "لعب" i a ;
|
||||
sew_V = v1 "خيط" a i ;
|
||||
sing_V = v2 "غني" ;
|
||||
sit_V = v1 "قعد" a u ;
|
||||
smell_V = v1 "شمّ" i a ;
|
||||
spit_V = v1 "بصق" a u ;
|
||||
stand_V = v1 "وقف" a i ;
|
||||
swell_V = v8 "نفخ" ;
|
||||
swim_V = v1 "سبح" a a ;
|
||||
think_V = v2 "فكر" ;
|
||||
turn_V = v1 "برم" a u ;
|
||||
vomit_V = v5 "قي؟" ;
|
||||
|
||||
bite_V2 = dirV2 ( v1 "عضّ" a a ) ;
|
||||
count_V2 = dirV2 (v1 "عدّ" a u) ;
|
||||
cut_V2 = dirV2 (v1 "قصّ" a u) ;
|
||||
fear_V2 = dirV2 (v1 "خوف" i a) ;
|
||||
fight_V2 = dirV2 (v3 "قتل") ;
|
||||
hit_V2 = dirV2 (v1 "ضرب" a i) ;
|
||||
hold_V2 = dirV2 (v1 "مسك" a i) ;
|
||||
hunt_V2 = dirV2 (v1 "صيد" a i) ;
|
||||
kill_V2 = dirV2 (v1 "قتل" a u) ;
|
||||
pull_V2 = dirV2 (v1 "سحب" a a) ;
|
||||
push_V2 = dirV2 (v1 "دفع" a a) ;
|
||||
rub_V2 = dirV2 ( v1 "فرك" a u ) ;
|
||||
scratch_V2 = dirV2 (v1 "خدش" a i) ;
|
||||
split_V2 = dirV2 ( v2 "قسم" ) ;
|
||||
squeeze_V2 = dirV2 (v1 "عصر" a i) ;
|
||||
stab_V2 = dirV2 ( v1 "طعن" a u) ;
|
||||
suck_V2 = dirV2 (v1 "مصّ" a u) ;
|
||||
throw_V2 = dirV2 (v1 "رمي" a i) ;
|
||||
tie_V2 = dirV2 (v1 "ربط" a u) ;
|
||||
wash_V2 = dirV2 ( v1 "غسل" a i ) ;
|
||||
wipe_V2 = dirV2 ( v1 "مسح" a a ) ;
|
||||
|
||||
-- other_A = regA "ْتهر" ;
|
||||
|
||||
} ;
|
||||
36
lib/resource/arabic/MorphoAra.gf
Normal file
36
lib/resource/arabic/MorphoAra.gf
Normal file
@@ -0,0 +1,36 @@
|
||||
resource MorphoAra = ResAra ** open Prelude in {
|
||||
|
||||
flags optimize = all ;--noexpand;
|
||||
|
||||
oper
|
||||
mkDet : Str -> Number -> State -> Det
|
||||
= \word,num,state ->
|
||||
{ s = \\_,_,c => word + vowel ! c ;
|
||||
n = numberToSize num;
|
||||
d = state;
|
||||
isNum = False
|
||||
};
|
||||
|
||||
mkQuantNum : Str -> Number -> State -> {
|
||||
s: Species => Gender => Case => Str; n: Number; d : State; isNum : Bool} =
|
||||
\waHid,num,state ->
|
||||
let waHida = waHid + "َة" in
|
||||
{ s = \\_,g,c =>
|
||||
let word =
|
||||
case g of {
|
||||
Masc => waHid;
|
||||
Fem => waHida
|
||||
} in Al ! state + word + dec1sg ! state ! c;
|
||||
n = num;
|
||||
d = state;
|
||||
isNum = True
|
||||
};
|
||||
|
||||
vowel : Case => Str =
|
||||
table {
|
||||
Nom => "ُ";
|
||||
Acc => "َ";
|
||||
Gen => "ِ"
|
||||
};
|
||||
|
||||
}
|
||||
96
lib/resource/arabic/NounAra.gf
Normal file
96
lib/resource/arabic/NounAra.gf
Normal file
@@ -0,0 +1,96 @@
|
||||
concrete NounAra of Noun = CatAra ** open ResAra, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
DetCN det cn =
|
||||
let {
|
||||
number = sizeToNumber det.n;
|
||||
determiner : Case -> Str = \c ->
|
||||
det.s ! cn.h ! (detGender cn.g det.n) ! c;
|
||||
noun : Case -> Str = \c ->
|
||||
cn.s ! number ! (nounState det.d number) ! (nounCase c det.n det.d)
|
||||
} in
|
||||
{ s = \\c =>
|
||||
case detAsAdj det.isNum det.n det.d of {
|
||||
False => determiner c ++ noun c;
|
||||
--FIXME use the adj -> cn -> cn rule from below instead of repeating code
|
||||
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c
|
||||
};
|
||||
a = { pgn = agrP3 cn.h cn.g number;
|
||||
isPron = False }
|
||||
};
|
||||
|
||||
-- UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||
UsePron p = p ;
|
||||
--
|
||||
-- PredetNP pred np = {
|
||||
-- s = \\c => pred.s ++ np.s ! c ;
|
||||
-- a = np.a
|
||||
-- } ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s = quant.s ; --++ ord.s
|
||||
n = One;
|
||||
d = quant.d;
|
||||
isNum = quant.isNum
|
||||
} ;
|
||||
|
||||
|
||||
DetPl quant num ord = {
|
||||
s = \\h,g,c =>
|
||||
quant.s ! h ! g ! c ++ num.s ! g ! (toDef quant.d num.n) ! c ;
|
||||
n = num.n;
|
||||
d = quant.d;
|
||||
isNum =
|
||||
case num.n of {
|
||||
None => False;
|
||||
_ => True
|
||||
};
|
||||
} ;
|
||||
|
||||
SgQuant quant = {s = quant.s ! Sg ; n = Sg; d = quant.d; isNum = False} ;
|
||||
PlQuant quant = {s = quant.s ! Pl ; n = Pl; d = quant.d; isNum = False} ;
|
||||
|
||||
|
||||
-- PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||
|
||||
NoNum, NoOrd = {s = \\_,_,_ => [] ;
|
||||
n = None} ;
|
||||
|
||||
-- NumInt n = n ;
|
||||
-- OrdInt n = {s = n.s ++ "ته"} ; ---
|
||||
|
||||
NumNumeral numeral = numeral ;
|
||||
-- OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
--
|
||||
-- AdNum adn num = {s = adn.s ++ num.s} ;
|
||||
--
|
||||
-- OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||
--
|
||||
DefArt = {s = \\_,_,_,_ => []; d = Def } ;
|
||||
|
||||
IndefArt = {s = \\_,_,_,_ => []; d = Indef} ;
|
||||
|
||||
MassDet = {s = \\_,_,_ => [] ; n = Sg; d = Indef; isNum = False} ;
|
||||
|
||||
UseN n = n ;
|
||||
-- UseN2 n = n ;
|
||||
-- UseN3 n = n ;
|
||||
--
|
||||
-- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||
-- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||
--
|
||||
AdjCN ap cn = {
|
||||
s = \\n,d,c =>
|
||||
cn.s ! n ! d ! c ++ ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c ;
|
||||
g = cn.g;
|
||||
h = cn.h
|
||||
};
|
||||
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
--
|
||||
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
--
|
||||
}
|
||||
119
lib/resource/arabic/NumeralAra.gf
Normal file
119
lib/resource/arabic/NumeralAra.gf
Normal file
@@ -0,0 +1,119 @@
|
||||
concrete NumeralAra of Numeral = CatAra **
|
||||
open Predef, Prelude, ResAra, MorphoAra in {
|
||||
|
||||
|
||||
|
||||
lincat
|
||||
|
||||
Digit = {s : DForm => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub10 = {s : DForm => Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub100 = {s : Gender => State => Case => Str ;
|
||||
n : Size} ;
|
||||
Sub1000 = {s : Gender => State => Case => Str ;
|
||||
n : Size } ;
|
||||
Sub1000000 = {s : Gender => State => Case => Str ;
|
||||
n : Size} ;
|
||||
|
||||
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
|
||||
lin n2 = num2 ** {n = Two };
|
||||
|
||||
|
||||
lin n3 = num3_10 "ثَلاث";
|
||||
lin n4 = num3_10 "أَربَع";
|
||||
lin n5 = num3_10 "خَمس";
|
||||
lin n6 = num3_10 "سِتّ";
|
||||
lin n7 = num3_10 "سَبع";
|
||||
lin n8 = num3_10 "ثَمانِي";
|
||||
lin n9 = num3_10 "تِسع";
|
||||
|
||||
|
||||
lin pot01 = num1_10 "واحِد" ** { n = One } ;
|
||||
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin pot110 =
|
||||
{ s= ((num3_10 "عَشر").s ! unit ) ;
|
||||
n = ThreeTen
|
||||
};
|
||||
lin pot111 =
|
||||
{ s = \\g,d,_ =>
|
||||
case g of {
|
||||
Masc => Al ! d + "أَحَدَ" ++ teen ! Masc ;
|
||||
Fem => Al ! d + "إِحدَى" ++ teen ! Fem
|
||||
};
|
||||
n = NonTeen
|
||||
};
|
||||
|
||||
lin pot1to19 dig =
|
||||
{ s = \\g,d,c =>
|
||||
case dig.n of {
|
||||
Two => Al ! d + num2.s ! unit ! g ! Const ! c ++ teen ! g ;
|
||||
_ => dig.s ! unit ! g ! (toDef d ThreeTen) ! Acc ++
|
||||
teen ! (genPolarity ! g)
|
||||
};
|
||||
n = case dig.n of {
|
||||
Two => NonTeen;
|
||||
_ => Teen
|
||||
}
|
||||
};
|
||||
|
||||
lin pot0as1 num =
|
||||
{ s= num.s ! unit;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
lin pot1 dig =
|
||||
{ s = dig.s ! ten;
|
||||
n = NonTeen
|
||||
};
|
||||
|
||||
lin pot1plus dig n = {
|
||||
s = \\g,d,c => n.s ! unit ! g ! d ! c
|
||||
++ "وَ" ++ dig.s ! ten ! g ! d ! c ;
|
||||
n = NonTeen
|
||||
};
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
|
||||
lin pot2 dig = {
|
||||
s = \\g,d,c =>
|
||||
case dig.n of {
|
||||
One => num100 ! d ! c ;
|
||||
Two => num200 ! d ! c ;
|
||||
_ => dig.s ! unit ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةِ"
|
||||
};
|
||||
n = Hundreds
|
||||
};
|
||||
|
||||
lin pot2plus m e = {
|
||||
s = \\g,d,c =>
|
||||
case m.n of {
|
||||
One => num100 ! d ! c;
|
||||
Two => num200 ! d ! c;
|
||||
_ => m.s ! unit ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةٌ"
|
||||
} ++ "وَ" ++ e.s ! g ! d ! c ;
|
||||
n = e.n
|
||||
};
|
||||
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
|
||||
lin pot3 m = {
|
||||
s = \\g,d,c =>
|
||||
case m.n of {
|
||||
One => num1000 ! (definite ! d) ! c;
|
||||
Two => num2000 ! (definite ! d) ! c;
|
||||
_ => m.s ! Fem ! (toDef d ThreeTen) ! c ++ "آلافٌ"
|
||||
} ;
|
||||
n = m.n
|
||||
};
|
||||
--lin pot3plus n m = {
|
||||
-- s = \\c => n.s ! NCard ++ "تهُْسَند" ++ m.s ! c ; n = Pl} ;
|
||||
|
||||
}
|
||||
39
lib/resource/arabic/OrthoAra.gf
Normal file
39
lib/resource/arabic/OrthoAra.gf
Normal file
@@ -0,0 +1,39 @@
|
||||
resource OrthoAra = open Prelude, Predef in {
|
||||
|
||||
oper
|
||||
|
||||
rectifyHmz: Str -> Str = \word ->
|
||||
case word of {
|
||||
l@(""|"ال") + "؟" + v@("َ"|"ُ") + tail => l + "أ" + v + tail;
|
||||
l@(""|"ال") + "؟" + v@("ِ") + tail => l + "إ" + v + tail;
|
||||
head + v1@("ِ"|"ُ"|"َ"|"ْ"|"ا"|"ي"|"و") + "؟" + v2@(""|"ُ"|"َ"|"ْ"|"ِ") => head + v1 + (tHmz v1) + v2;
|
||||
head + "؟" + tail => head + (bHmz (dp 2 head) (take 2 tail)) + tail; --last head , take 1 tail
|
||||
_ => word
|
||||
};
|
||||
|
||||
--hamza at beginning of word (head)
|
||||
hHmz : Str -> Str = \d ->
|
||||
case d of {
|
||||
"ِ" => "إ";
|
||||
_ => "أ"
|
||||
};
|
||||
|
||||
--hamza in middle of word (body)
|
||||
bHmz : Str -> Str -> Str = \d1,d2 ->
|
||||
case <d1,d2> of {
|
||||
<"ِ",_> | <_,"ِ"> => "ئ";
|
||||
<"ُ",_> | <_,"ُ"> => "ؤ";
|
||||
<"َ",_> | <_,"َ"> => "أ";
|
||||
_ => "ء"
|
||||
};
|
||||
|
||||
--hamza carrier sequence
|
||||
tHmz : Str -> Str = \d ->
|
||||
case d of {
|
||||
"ِ" => "ئ";
|
||||
"ُ" => "ؤ";
|
||||
"َ" => "أ";
|
||||
"ْ"|"ا"|"و"|"ي" => "ء"
|
||||
};
|
||||
|
||||
}
|
||||
533
lib/resource/arabic/ParadigmsAra.gf
Normal file
533
lib/resource/arabic/ParadigmsAra.gf
Normal file
@@ -0,0 +1,533 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 Arabic Lexical Paradigms
|
||||
--
|
||||
-- Ali El Dada 2005--2006
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoAra.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- The structure of functions for each word class $C$ is the following:
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module $IrregularAra$, which covers all irregularly inflected
|
||||
-- words.
|
||||
--
|
||||
-- The following modules are presupposed:
|
||||
|
||||
resource ParadigmsAra = open
|
||||
Predef,
|
||||
Prelude,
|
||||
MorphoAra,
|
||||
OrthoAra,
|
||||
CatAra
|
||||
in {
|
||||
|
||||
flags optimize = noexpand;
|
||||
|
||||
oper
|
||||
|
||||
--lexical paradigms for nouns
|
||||
|
||||
mkN : NTable -> Gender -> Species -> N =
|
||||
\nsc,gen,spec ->
|
||||
{ s = nsc;
|
||||
g = gen;
|
||||
h = spec;
|
||||
lock_N = <>
|
||||
};
|
||||
|
||||
--takes a root string, a singular pattern string, a broken plural
|
||||
--pattern string, a gender, and species. Gives a noun
|
||||
regN : Str -> Str -> Str -> Gender -> Species -> N =
|
||||
\root,sg,pl,gen,spec ->
|
||||
let { raw = regN' root sg pl gen spec} in
|
||||
{ s = \\n,d,c =>
|
||||
case root of {
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! n ! d ! c);
|
||||
_ => raw.s ! n ! d ! c
|
||||
};
|
||||
g = gen;
|
||||
h = spec ; lock_N = <>
|
||||
};
|
||||
|
||||
regN' : Str -> Str -> Str -> Gender -> Species -> N =
|
||||
\root,sg,pl,gen,spec ->
|
||||
let { kitAb = mkWord sg root;
|
||||
kutub = mkWord pl root
|
||||
} in mkN (reg kitAb kutub) gen spec;
|
||||
|
||||
--takes a root string, a singular pattern string, a gender,
|
||||
--and species. Gives a noun whose plural is sound feminine
|
||||
sdfN : Str -> Str -> Gender -> Species -> N =
|
||||
\root,sg,gen,spec ->
|
||||
let { kalima = mkWord sg root;
|
||||
} in mkN (sndf kalima) gen spec;
|
||||
|
||||
|
||||
--takes a root string, a singular pattern string, a gender,
|
||||
--and species. Gives a noun whose plural is sound masculine
|
||||
sdmN : Str -> Str -> Gender -> Species -> N =
|
||||
\root,sg,gen,spec ->
|
||||
let { mucallim = mkWord sg root;
|
||||
} in mkN (sndm mucallim) gen spec;
|
||||
|
||||
-- mkN3 : N -> Str -> Str -> N3 =
|
||||
-- \n,p,q -> n ** {c2 = p ; c3 = q; lock_N3 = <>} ;
|
||||
|
||||
--lexical paradigms for adjectives
|
||||
|
||||
--takes a root string and a pattern string
|
||||
regA : Str -> Str -> A =
|
||||
\root,pat ->
|
||||
let { raw = regA' root pat } in
|
||||
{ s = \\g,n,d,c =>
|
||||
case root of {
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! g ! n ! d ! c);
|
||||
_ => raw.s ! g ! n ! d ! c
|
||||
};
|
||||
lock_A = <>
|
||||
};
|
||||
|
||||
regA' : Str -> Str -> A =
|
||||
\root,pat ->
|
||||
let { kabIr = mkWord pat root
|
||||
} in {
|
||||
s = adj kabIr ;
|
||||
lock_A = <>
|
||||
};
|
||||
|
||||
--takes a root string only
|
||||
clrA : Str -> A =
|
||||
\root ->
|
||||
let { eaHmar = mkWord "أَفعَل" root;
|
||||
HamrA' = mkWord "فَعلاء" root;
|
||||
Humr = mkWord "فُعل" root
|
||||
} in {
|
||||
s = clr eaHmar HamrA' Humr;
|
||||
lock_A = <>
|
||||
};
|
||||
|
||||
--lexical paradigms for verbs
|
||||
|
||||
v1 : Str -> Vowel -> Vowel -> V =
|
||||
\rootStr,vPerf,vImpf ->
|
||||
let { raw = v1' rootStr vPerf vImpf } in
|
||||
{ s = \\vf =>
|
||||
case rootStr of {
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! vf);
|
||||
_ => raw.s ! vf
|
||||
};
|
||||
lock_V = <>
|
||||
} ;
|
||||
|
||||
|
||||
v1' : Str -> Vowel -> Vowel -> Verb =
|
||||
\rootStr,vPerf,vImpf ->
|
||||
let { root = mkRoot3 rootStr ;
|
||||
l = dp 2 rootStr } in --last rootStr
|
||||
case <l, root.c> of {
|
||||
<"ّ",_> => v1geminate rootStr vPerf vImpf ;
|
||||
<"و"|"ي",_> => v1defective root vImpf ;
|
||||
<_,"و"|"ي"> => v1hollow root vImpf ;
|
||||
_ => v1sound root vPerf vImpf
|
||||
};
|
||||
|
||||
|
||||
--Verb Form II : faccala
|
||||
|
||||
v2 : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
root = mkRoot3 rootStr
|
||||
} in {
|
||||
s =
|
||||
case root.l of {
|
||||
"و"|"ي" => (v2defective root).s;
|
||||
_ => (v2sound root).s
|
||||
};
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
--Verb Form III : fAcala
|
||||
|
||||
v3 : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
tbc = mkRoot3 rootStr ;
|
||||
} in {
|
||||
s = (v3sound tbc).s ;
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
--Verb Form IV : >afcala
|
||||
|
||||
v4 : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
root = mkRoot3 rootStr
|
||||
} in {
|
||||
s =
|
||||
case root.l of {
|
||||
"و"|"ي" => (v4defective root).s;
|
||||
_ => (v4sound root).s
|
||||
};
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
--Verb Form V : tafaccala
|
||||
|
||||
v5 : Str -> V =
|
||||
\rootStr ->
|
||||
let { raw = v5' rootStr } in
|
||||
{ s = \\vf =>
|
||||
case rootStr of {
|
||||
_ + "؟" + _ => rectifyHmz(raw.s ! vf);
|
||||
_ => raw.s ! vf
|
||||
};
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
v5' : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
nfs = mkRoot3 rootStr ;
|
||||
} in {
|
||||
s = (v5sound nfs).s ; lock_V = <>
|
||||
};
|
||||
|
||||
--Verb Form VI : tafaacala
|
||||
|
||||
v6 : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
fqm = mkRoot3 rootStr ;
|
||||
} in {
|
||||
s = (v6sound fqm).s ;
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
--Verb Form VIII <iftacala
|
||||
|
||||
v8 : Str -> V =
|
||||
\rootStr ->
|
||||
let {
|
||||
rbT = mkRoot3 rootStr ;
|
||||
} in {
|
||||
s = (v8sound rbT).s ;
|
||||
lock_V = <>
|
||||
};
|
||||
|
||||
|
||||
---- Prepositions are used in many-argument functions for rection.
|
||||
--
|
||||
Preposition : Type ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
--
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("دَُغهتر ْف خ") need a preposition.
|
||||
|
||||
mkN2 : N -> Preposition -> N2 ;
|
||||
|
||||
-- Three-place relational nouns ("تهي عْنّعتِْن فرْم خ تْ ي") need two prepositions.
|
||||
|
||||
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||
|
||||
|
||||
----3 Relational common noun phrases
|
||||
----
|
||||
---- In some cases, you may want to make a complex $CN$ into a
|
||||
---- relational noun (e.g. "تهي ْلد تْون هَلّ ْف").
|
||||
--
|
||||
-- cnN2 : CN -> Preposition -> N2 ;
|
||||
-- cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
||||
--
|
||||
--
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed as follows
|
||||
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
|
||||
---- Sometimes you can reuse a common noun as a proper name, e.g. "َنك".
|
||||
--
|
||||
-- nounPN : N -> PN ;
|
||||
--
|
||||
---- To form a noun phrase that can also be plural and have an irregular
|
||||
---- genitive, you can use the worst-case function.
|
||||
--
|
||||
-- mkNP : Str -> Str -> Number -> Gender -> NP ;
|
||||
--
|
||||
----2 Adjectives
|
||||
--
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Preposition -> A2 ;
|
||||
|
||||
---- Comparison adjectives may two more forms.
|
||||
--
|
||||
-- ADeg : Type ;
|
||||
--
|
||||
-- mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||
--
|
||||
---- The regular pattern recognizes two common variations:
|
||||
---- "ي" ("رُدي" - "رُدر" - "رُدست") and
|
||||
---- "ي" ("هَةّي هَةِّر هَةِّست هَةِّلي")
|
||||
--
|
||||
-- regADeg : Str -> ADeg ; -- long, longer, longest
|
||||
--
|
||||
---- However, the duplication of the final consonant is nor predicted,
|
||||
---- but a separate pattern is used:
|
||||
--
|
||||
-- duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||
--
|
||||
---- If comparison is formed by "مْري، "most", as in general for
|
||||
---- long adjective, the following pattern is used:
|
||||
--
|
||||
-- compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||
--
|
||||
---- From a given $ADeg$, it is possible to get back to $A$.
|
||||
--
|
||||
-- adegA : ADeg -> A ;
|
||||
--
|
||||
--
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb. Some can be preverbal (e.g. "َلوَيس").
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
|
||||
--2 Prepositions
|
||||
--
|
||||
-- A preposition as used for rection in the lexicon, as well as to
|
||||
-- build $PP$s in the resource API, just requires a string.
|
||||
|
||||
mkPreposition : Str -> Preposition ;
|
||||
mkPrep : Str -> Prep ;
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
----3 Verbs with a particle.
|
||||
----
|
||||
---- The particle, such as in "سوِتعه ْن", is given as a string.
|
||||
--
|
||||
-- partV : V -> Str -> V ;
|
||||
--
|
||||
----3 Reflexive verbs
|
||||
----
|
||||
---- By default, verbs are not reflexive; this function makes them that.
|
||||
--
|
||||
-- reflV : V -> V ;
|
||||
--
|
||||
----3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||
|
||||
mkV2 : V -> Preposition -> V2 ;
|
||||
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Preposition -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Str -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Str -> Str -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Str -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Str -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Str -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Str -> A2V ;
|
||||
|
||||
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated
|
||||
-- just as synonyms of $V2$, and the second argument is given
|
||||
-- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$.
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
--
|
||||
----2 Definitions of paradigms
|
||||
----
|
||||
---- The definitions should not bother the user of the API. So they are
|
||||
---- hidden from the document.
|
||||
----.
|
||||
--
|
||||
-- Gender = MorphoAra.Gender ;
|
||||
-- Number = MorphoAra.Number ;
|
||||
-- Case = MorphoAra.Case ;
|
||||
-- human = Masc ;
|
||||
-- nonhuman = Neutr ;
|
||||
-- masculine = Masc ;
|
||||
-- feminine = Fem ;
|
||||
-- singular = Sg ;
|
||||
-- plural = Pl ;
|
||||
-- nominative = Nom ;
|
||||
-- genitive = Gen ;
|
||||
--
|
||||
Preposition = Str ;
|
||||
|
||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
|
||||
-- regN2 n = mkN2 (regN n) (mkPreposition "ْف") ;
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
-- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
|
||||
-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
--
|
||||
-- mkPN n g = nameReg n g ** {lock_PN = <>} ;
|
||||
-- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||
mkNP : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
|
||||
{ s =
|
||||
table {
|
||||
Nom => ana;
|
||||
Acc => nI;
|
||||
Gen => I
|
||||
};
|
||||
a = {pgn = pgn; isPron = True };
|
||||
lock_NP = <>
|
||||
};
|
||||
|
||||
-- mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ;
|
||||
-- lock_NP = <>} ;
|
||||
--
|
||||
mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant =
|
||||
\hava,havihi,havAn,havayn,hAtAn,hAtayn,hA'ulA,det ->
|
||||
{ s = \\n,s,g,c =>
|
||||
case <s,g,c,n> of {
|
||||
<_,Masc,_,Sg> => hava;
|
||||
<_,Fem,_,Sg> => havihi;
|
||||
<_,Masc,Nom,Dl>=> havAn;
|
||||
<_,Masc,_,Dl> => havayn;
|
||||
<_,Fem,Nom,Dl> => hAtAn;
|
||||
<_,Fem,_,Dl> => hAtayn;
|
||||
<Hum,_,_,Pl> => hA'ulA;
|
||||
_ => havihi
|
||||
};
|
||||
d = Def;
|
||||
lock_Quant = <>
|
||||
};
|
||||
|
||||
mkQuant3 : (_,_,_ : Str) -> State -> Quant =
|
||||
\dalika,tilka,ula'ika,det ->
|
||||
{ s = \\n,s,g,c =>
|
||||
case <s,g,c,n> of {
|
||||
<_,Masc,_,Sg> => dalika;
|
||||
<_,Fem,_,Sg> => tilka;
|
||||
<Hum,_,_,_> => ula'ika;
|
||||
_ => tilka
|
||||
};
|
||||
d = Def;
|
||||
lock_Quant = <>
|
||||
};
|
||||
|
||||
|
||||
-- mkA a b = mkAdjective a a a b ** {lock_A = <>} ;
|
||||
-- regA a = regAdjective a ** {lock_A = <>} ;
|
||||
--
|
||||
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
|
||||
--
|
||||
-- ADeg = A ; ----
|
||||
--
|
||||
-- mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ;
|
||||
--
|
||||
|
||||
-- duplADeg fat =
|
||||
-- mkADeg fat
|
||||
-- (fat + last fat + "ر") (fat + last fat + "ست") (fat + "لي") ;
|
||||
--
|
||||
-- compoundADeg a =
|
||||
-- let ad = (a.s ! AAdj Posit)
|
||||
-- in mkADeg ad ("مْري" ++ ad) ("مْست" ++ ad) (a.s ! AAdv) ;
|
||||
--
|
||||
-- adegA a = a ;
|
||||
--
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
|
||||
mkPreposition p = p ;
|
||||
-- mkPrep p = ss p ** {lock_Prep = <>} ;
|
||||
--
|
||||
-- mkV a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||
--
|
||||
--
|
||||
-- partV v p = verbPart v p ** {lock_V = <>} ;
|
||||
-- reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
|
||||
--
|
||||
mkV2 v p = v ** {s = v.s ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v [] ;
|
||||
|
||||
mkV3 v p q = v ** {s = v.s ; c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v [] p ;
|
||||
dirdirV3 v = dirV3 v [] ;
|
||||
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
-- mkVV v = {
|
||||
-- s = table {VVF vf => v.s ! vf ; _ => variants {}} ;
|
||||
-- isAux = False ; lock_VV = <>
|
||||
-- } ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
|
||||
V0 : Type = V ;
|
||||
V2S, V2V, V2Q, V2A : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
A2V : Type = A2 ;
|
||||
|
||||
mkV0 v = v ** {lock_V = <>} ;
|
||||
mkV2S v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2 = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_A = <>} ;
|
||||
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||
mkAV v = v ** {lock_A = <>} ;
|
||||
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||
|
||||
} ;
|
||||
102
lib/resource/arabic/PatternsAra.gf
Normal file
102
lib/resource/arabic/PatternsAra.gf
Normal file
@@ -0,0 +1,102 @@
|
||||
resource PatternsAra = {
|
||||
|
||||
oper
|
||||
|
||||
fA' = { h = "" ; m1 = ""; m2 = ""; t = "َاء"} ;
|
||||
|
||||
eafAcI = { h = "أَ"; m1 = "َا"; m2 = ""; t = "ِي" } ;
|
||||
eafcA' = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "َاء"} ;
|
||||
eafcI = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "ِي" } ;
|
||||
fac = { h = "" ; m1 = "َ" ; m2 = ""; t = "" } ;
|
||||
facc = { h = "" ; m1 = "َ" ; m2 = ""; t = "ّ" } ;
|
||||
facca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َّ" } ;
|
||||
facci = { h = "" ; m1 = "َ" ; m2 = ""; t = "ِّ" } ;
|
||||
faccu = { h = "" ; m1 = "َ" ; m2 = ""; t = "ُّ" } ;
|
||||
facp = { h = "" ; m1 = "َ" ; m2 = ""; t = "َة" } ;
|
||||
faca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َ" } ;
|
||||
facA = { h = "" ; m1 = "َ" ; m2 = ""; t = "َا" } ;
|
||||
facA' = { h = "" ; m1 = "َ" ; m2 = ""; t = "َاء"} ;
|
||||
fAc = { h = "" ; m1 = "َا"; m2 = ""; t = "" } ;
|
||||
fAcp = { h = "" ; m1 = "َا"; m2 = ""; t = "َة" } ;
|
||||
fic = { h = "" ; m1 = "ِ" ; m2 = ""; t = "" } ;
|
||||
ficc = { h = "" ; m1 = "ِ" ; m2 = ""; t = "ّ" } ;
|
||||
ficA' = { h = "" ; m1 = "ِ" ; m2 = ""; t = "َاء"} ;
|
||||
fIc = { h = "" ; m1 = "ِي"; m2 = ""; t = "" } ;
|
||||
fIcAn = { h = "" ; m1 = "ِي"; m2 = ""; t = "َان"} ;
|
||||
fca = { h = "" ; m1 = "ْ" ; m2 = ""; t = "َ" } ;
|
||||
fci = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ِ" } ;
|
||||
fcu = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ُ" } ;
|
||||
fuc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "" } ;
|
||||
fucc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ّ" } ;
|
||||
fucci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِّ" } ;
|
||||
fuccu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُّ" } ;
|
||||
fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ;
|
||||
fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ;
|
||||
fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ;
|
||||
ufAc = { h = "ُ" ; m1 = "َا"; m2 = ""; t = "" } ;
|
||||
ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ;
|
||||
|
||||
eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ;
|
||||
eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ;
|
||||
eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ;
|
||||
eafcal = { h = "أَ"; m1 = "ْ" ; m2 = "َ" ; t = "" } ;
|
||||
eafcAl = { h = "أَ"; m1 = "ْ" ; m2 = "َا" ; t = "" } ;
|
||||
eafcil = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
|
||||
eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
|
||||
eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ;
|
||||
eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
|
||||
euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ;
|
||||
afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
|
||||
faccalo = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "ْ" } ;
|
||||
facal = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "" } ;
|
||||
facalo = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "ْ" } ;
|
||||
facalp = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "َة" } ;
|
||||
facA'il = { h = "" ; m1 = "َ" ; m2 = "َائِ"; t = "" } ;
|
||||
facAl = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "" } ;
|
||||
facAlI = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "ِي" } ;
|
||||
facil = { h = "" ; m1 = "َ" ; m2 = "ِ" ; t = "" } ;
|
||||
facIl = { h = "" ; m1 = "َ" ; m2 = "ِي" ; t = "" } ;
|
||||
facl = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "" } ;
|
||||
faclp = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َة" } ;
|
||||
facul = { h = "" ; m1 = "َ" ; m2 = "ُ" ; t = "" } ;
|
||||
fAcal = { h = "" ; m1 = "َا" ; m2 = "َ" ; t = "" } ;
|
||||
fAcil = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ;
|
||||
faccal = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "" } ;
|
||||
faccil = { h = "" ; m1 = "َ" ; m2 = "ِّ" ; t = "" } ;
|
||||
faclA' = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َاء"} ;
|
||||
fAcilp = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "َة" } ;
|
||||
fawAcil = { h = "" ; m1 = "َوَا"; m2 = "ِ" ; t = "" } ;
|
||||
ficAlp = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "َة" } ;
|
||||
fcal = { h = "" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ;
|
||||
fcil = { h = "" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
|
||||
fcul = { h = "" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
|
||||
ficl = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "" } ;
|
||||
ficAl = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "" } ;
|
||||
ficlp = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "َة" } ;
|
||||
ftacal = { h = "" ; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ;
|
||||
ftacil = { h = "" ; m1 = "ْتَ" ; m2 = "ِ" ; t = "" } ;
|
||||
fuccAl = { h = "" ; m1 = "ُ" ; m2 = "َّا" ; t = "" } ;
|
||||
fuccil = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ;
|
||||
fuccilo = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "ْ" } ;
|
||||
fucal = { h = "" ; m1 = "ُ" ; m2 = "َ" ; t = "" } ;
|
||||
fucaylp = { h = "" ; m1 = "ُ" ; m2 = "َيْ" ; t = "َة" } ;
|
||||
fucAl = { h = "" ; m1 = "ُ" ; m2 = "َا" ; t = "" } ;
|
||||
fucl = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "" } ;
|
||||
fucil = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "" } ;
|
||||
fuclp = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "َة" } ;
|
||||
fucilo = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "ْ" } ;
|
||||
fucul = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "" } ;
|
||||
fuculo = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "ْ" } ;
|
||||
fucUl = { h = "" ; m1 = "ُ" ; m2 = "ُو" ; t = "" } ;
|
||||
fUcil = { h = "" ; m1 = "ُو" ; m2 = "ِ" ; t = "" } ;
|
||||
tafAcal = { h = "تَ"; m1 = "َا" ; m2 = "َ" ; t = "" } ;
|
||||
tafaccal = { h = "تَ"; m1 = "َ" ; m2 = "َّ" ; t = "" } ;
|
||||
tufuccil = { h = "تُ"; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ;
|
||||
tufUcil = { h = "تُ"; m1 = "ُو" ; m2 = "ِ" ; t = "" } ;
|
||||
ufAcal = { h = "ُ" ; m1 = "َا" ; m2 = "َ" ; t = "" } ;
|
||||
ufAcil = { h = "ُ" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ;
|
||||
ufcal = { h = "ُ" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ;
|
||||
ufcil = { h = "ُ" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
|
||||
ufcul = { h = "ُ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
|
||||
|
||||
}
|
||||
26
lib/resource/arabic/PhraseAra.gf
Normal file
26
lib/resource/arabic/PhraseAra.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
concrete PhraseAra of Phrase = CatAra ** open
|
||||
ParamX,
|
||||
Prelude,
|
||||
ResAra in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ! Masc ++ voc.s} ;--FIXME
|
||||
|
||||
-- UttS s = s ;
|
||||
-- UttQS qs = {s = qs.s ! QDir} ;
|
||||
UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! Sg} ;
|
||||
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||
--
|
||||
-- UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||
-- UttIAdv iadv = iadv ;
|
||||
-- UttNP np = {s = np.s ! Acc} ;
|
||||
-- UttVP vp = {s = infVP False vp (agrP3 Sg)} ;
|
||||
-- UttAdv adv = adv ;
|
||||
--
|
||||
NoPConj = {s = []} ;
|
||||
-- PConjConj conj = conj ;
|
||||
--
|
||||
NoVoc = {s = []} ;
|
||||
-- VocNP np = {s = "،" ++ np.s ! Nom} ;
|
||||
--
|
||||
}
|
||||
55
lib/resource/arabic/QuestionAra.gf
Normal file
55
lib/resource/arabic/QuestionAra.gf
Normal file
@@ -0,0 +1,55 @@
|
||||
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\t,p =>
|
||||
table {
|
||||
QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ;
|
||||
QDir => cl.s ! t ! p ! Verbal
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
--
|
||||
-- QuestVP qp vp =
|
||||
-- let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
|
||||
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
||||
--
|
||||
-- QuestSlash ip slash = {
|
||||
-- s = \\t,a,p =>
|
||||
-- let
|
||||
-- cls = slash.s ! t ! a ! p ;
|
||||
-- who = slash.c2 ++ ip.s ! Acc --- stranding in ExtAra
|
||||
-- in table {
|
||||
-- QDir => who ++ cls ! OQuest ;
|
||||
-- QIndir => who ++ cls ! ODir
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- QuestIAdv iadv cl = {
|
||||
-- s = \\t,a,p =>
|
||||
-- let
|
||||
-- cls = cl.s ! t ! a ! p ;
|
||||
-- why = iadv.s
|
||||
-- in table {
|
||||
-- QDir => why ++ cls ! OQuest ;
|
||||
-- QIndir => why ++ cls ! ODir
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- PrepIP p ip = {s = p.s ++ ip.s ! Nom} ;
|
||||
--
|
||||
-- AdvIP ip adv = {
|
||||
-- s = \\c => ip.s ! c ++ adv.s ;
|
||||
-- n = ip.n
|
||||
-- } ;
|
||||
--
|
||||
-- IDetCN idet num ord cn = {
|
||||
-- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ;
|
||||
-- n = idet.n
|
||||
-- } ;
|
||||
--
|
||||
}
|
||||
34
lib/resource/arabic/RelativeAra.gf
Normal file
34
lib/resource/arabic/RelativeAra.gf
Normal file
@@ -0,0 +1,34 @@
|
||||
concrete RelativeAra of Relative = CatAra ** open ResAra in {
|
||||
--
|
||||
-- flags optimize=all_subs ;
|
||||
--
|
||||
-- lin
|
||||
--
|
||||
-- RelCl cl = {
|
||||
-- s = \\t,a,p,_ => "سُعه" ++ "تهَت" ++ cl.s ! t ! a ! p ! ODir
|
||||
-- } ;
|
||||
--
|
||||
-- RelVP rp vp = {
|
||||
-- s = \\t,ant,b,ag =>
|
||||
-- let
|
||||
-- agr = case rp.a of {
|
||||
-- RNoAg => ag ;
|
||||
-- RAg a => a
|
||||
-- } ;
|
||||
-- cl = mkClause (rp.s ! Nom) agr vp
|
||||
-- in
|
||||
-- cl.s ! t ! ant ! b ! ODir
|
||||
-- } ;
|
||||
--
|
||||
-- RelSlash rp slash = {
|
||||
-- s = \\t,a,p,_ => slash.c2 ++ rp.s ! Acc ++ slash.s ! t ! a ! p ! ODir
|
||||
-- } ;
|
||||
--
|
||||
-- FunRP p np rp = {
|
||||
-- s = \\c => np.s ! c ++ p.s ++ rp.s ! Acc ;
|
||||
-- a = RAg np.a
|
||||
-- } ;
|
||||
--
|
||||
-- IdRP = mkIP "وهِعه" "وهِعه" "وهْسي" Sg ** {a = RNoAg} ;
|
||||
--
|
||||
}
|
||||
1090
lib/resource/arabic/ResAra.gf
Normal file
1090
lib/resource/arabic/ResAra.gf
Normal file
File diff suppressed because it is too large
Load Diff
131
lib/resource/arabic/SentenceAra.gf
Normal file
131
lib/resource/arabic/SentenceAra.gf
Normal file
@@ -0,0 +1,131 @@
|
||||
--# -path=.:abstract:common:prelude
|
||||
|
||||
concrete SentenceAra of Sentence = CatAra ** open
|
||||
ResAra,
|
||||
Prelude,
|
||||
ResAra,
|
||||
ParamX,
|
||||
CommonX in {
|
||||
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
{-
|
||||
PredVP np vp =
|
||||
{ s = \\t,p,o =>
|
||||
case o of {
|
||||
Verbal =>
|
||||
case vp.comp.a.isPron of {
|
||||
False => vp.s ! t ! p ! Verbal ! np.a ++ np.s ! Nom ++ vp.comp.s ! Acc ;
|
||||
True => vp.s ! t ! p ! Verbal ! np.a ++ vp.comp.s ! Acc ++ np.s ! Nom
|
||||
};
|
||||
Nominal =>
|
||||
np.s ! Nom ++ vp.s ! t ! p ! Nominal ! np.a ++ vp.comp.s ! Acc
|
||||
}
|
||||
};
|
||||
-}
|
||||
PredVP np vp =
|
||||
{ s =\\t,p,o =>
|
||||
let {
|
||||
pgn =
|
||||
case <o,np.a.isPron> of {
|
||||
<Verbal, False> => verbalAgr np.a.pgn;
|
||||
_ => np.a.pgn
|
||||
};
|
||||
gn = pgn2gn pgn;
|
||||
kataba = vp.s ! pgn ! VPPerf ;
|
||||
yaktubu = vp.s ! pgn ! VPImpf Ind ;
|
||||
yaktuba = vp.s ! pgn ! VPImpf Cnj ;
|
||||
yaktub = vp.s ! pgn ! VPImpf Jus ;
|
||||
vStr : ResAra.Tense -> Polarity -> Str =
|
||||
\tn,pl -> case<vp.isPred,tn,pl> of {
|
||||
<False, ResAra.Pres, Pos> => yaktubu ;
|
||||
<False, ResAra.Pres, Neg> => "لَا" ++ yaktubu ;
|
||||
<True, ResAra.Pres, Pos> => "" ; --no verb "to be" in present
|
||||
<True, ResAra.Pres, Neg> => "لَيسَ" ;--same here, just add negation particle
|
||||
<_, ResAra.Past, Pos> => kataba ;
|
||||
<_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ;
|
||||
<_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ;
|
||||
<_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba
|
||||
};
|
||||
pred : ResAra.Tense -> Polarity -> Str =
|
||||
\tn,pl -> case <vp.isPred,tn,pl> of {
|
||||
<True, ResAra.Pres, Pos> => vp.pred.s ! gn ! Nom; --xabar marfooc
|
||||
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
|
||||
};
|
||||
} in
|
||||
case o of {
|
||||
Verbal =>
|
||||
case <vp.obj.a.isPron, np.a.isPron> of {
|
||||
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||
<False,False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||
<True,False> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p);
|
||||
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
|
||||
};
|
||||
Nominal =>
|
||||
np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
|
||||
}
|
||||
};
|
||||
-- PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||
|
||||
-- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\p,g,n =>
|
||||
case p of {
|
||||
Pos => vp.s ! (Per2 g n) ! VPImp ++ vp.obj.s ++ vp.s2 ;
|
||||
Neg => "لا" ++ vp.s ! (Per2 g n) ! (VPImpf Jus) ++ vp.obj.s ++ vp.s2
|
||||
}
|
||||
};
|
||||
|
||||
--
|
||||
-- SlashV2 np v2 =
|
||||
-- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
||||
--
|
||||
-- SlashVVV2 np vv v2 =
|
||||
-- mkClause (np.s ! Nom) np.a
|
||||
-- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) **
|
||||
-- {c2 = v2.c2} ;
|
||||
--
|
||||
-- AdvSlash slash adv = {
|
||||
-- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
|
||||
-- c2 = slash.c2
|
||||
-- } ;
|
||||
--
|
||||
-- SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
||||
--
|
||||
-- EmbedS s = {s = conjThat ++ s.s} ;
|
||||
-- EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
-- EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr
|
||||
--
|
||||
|
||||
--FIXME, all tenses
|
||||
UseCl t a p cl =
|
||||
{s = cl.s ! ResAra.Pres ! p.p ! Verbal
|
||||
{- case t of {
|
||||
TPres => cl.s ! ResAra.Pres ! p.p ! Verbal ;
|
||||
TCond => cl.s ! ResAra.Pres ! p.p ! Verbal ;
|
||||
TPast => cl.s ! ResAra.Past ! p.p ! Verbal ;
|
||||
TFut => cl.s ! ResAra.Fut ! p.p ! Verbal
|
||||
}
|
||||
-} };
|
||||
|
||||
--FIXME, all tenses
|
||||
UseQCl t a p qcl = --{s = cl.s ! t ! p ! Verbal } ;
|
||||
{s =
|
||||
table {
|
||||
QDir => "هَل" ++ qcl.s ! ResAra.Pres ! p.p ! QDir;
|
||||
QIndir => qcl.s ! ResAra.Pres ! p.p ! QIndir
|
||||
}
|
||||
{- case t of {
|
||||
TPres => "هَل" ++ qcl.s ! ResAra.Pres ! p.p ! q ;
|
||||
TCond => "هَل" ++ qcl.s ! ResAra.Pres ! p.p ! q ;
|
||||
TPast => "هَل" ++ qcl.s ! ResAra.Past ! p.p ! q ;
|
||||
TFut => "هَل" ++ qcl.s ! ResAra.Fut ! p.p ! q
|
||||
}
|
||||
-} };
|
||||
|
||||
-- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
|
||||
|
||||
}
|
||||
115
lib/resource/arabic/StructuralAra.gf
Normal file
115
lib/resource/arabic/StructuralAra.gf
Normal file
@@ -0,0 +1,115 @@
|
||||
concrete StructuralAra of Structural = CatAra **
|
||||
open MorphoAra, ResAra, ParadigmsAra, Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
-- above_Prep = ss "َبْثي" ;
|
||||
-- after_Prep = ss "َفتر" ;
|
||||
-- all_Predet = ss "َلّ" ;
|
||||
-- almost_AdA, almost_AdN = ss "َلمْست" ;
|
||||
-- although_Subj = ss "َلتهُْغه" ;
|
||||
-- always_AdV = ss "َلوَيس" ;
|
||||
and_Conj = ss "وَ" ** {n = Pl} ;
|
||||
-- because_Subj = ss "بعَُسي" ;
|
||||
-- before_Prep = ss "بفْري" ;
|
||||
-- behind_Prep = ss "بهِند" ;
|
||||
-- between_Prep = ss "بتوّن" ;
|
||||
-- both7and_DConj = sd2 "بْته" "َند" ** {n = Pl} ;
|
||||
-- but_PConj = ss "بُت" ;
|
||||
-- by8agent_Prep = ss "بي" ;
|
||||
-- by8means_Prep = ss "بي" ;
|
||||
-- can8know_VV, can_VV = {
|
||||
-- s = table VVForm [["بي َبلي تْ"] ; "عَن" ; "عُْلد" ;
|
||||
-- ["بّن َبلي تْ"] ; ["بِنغ َبلي تْ"] ; "عَنءت" ; "عُْلدنءت"] ;
|
||||
-- isAux = True
|
||||
-- } ;
|
||||
-- during_Prep = ss "دُرِنغ" ;
|
||||
-- either7or_DConj = sd2 "ِتهر" "ْر" ** {n = Sg} ;
|
||||
-- everybody_NP = regNP "ثريبْدي" Sg ;
|
||||
every_Det = mkDet "كُلّ" Sg Const ;
|
||||
-- everything_NP = regNP "ثريتهِنغ" Sg ;
|
||||
-- everywhere_Adv = ss "ثريوهري" ;
|
||||
few_Det = mkDet "بَعض" Pl Const ;
|
||||
-- first_Ord = ss "فِرست" ;
|
||||
-- from_Prep = ss "فرْم" ;
|
||||
he_Pron = mkNP "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
|
||||
here_Adv = ss "هُنا" ;
|
||||
-- here7to_Adv = ss ["تْ هري"] ;
|
||||
-- here7from_Adv = ss ["فرْم هري"] ;
|
||||
how_IAdv = ss "كَيفَ" ;
|
||||
-- how8many_IDet = mkDeterminer Pl ["هْو مَني"] ;
|
||||
-- if_Subj = ss "ِف" ;
|
||||
-- in8front_Prep = ss ["ِن فرْنت ْف"] ;
|
||||
i_Pron = mkNP "أَنَا" "نِي" "ِي" (Per1 Sing);
|
||||
in_Prep = ss "فِي" ;
|
||||
-- it_Pron = mkNP "ِت" "ِت" "ِتس" Sg P3 ;
|
||||
-- less_CAdv = ss "لسّ" ;
|
||||
many_Det = mkDet "جَمِيع" Pl Const ;
|
||||
-- more_CAdv = ss "مْري" ;
|
||||
-- most_Predet = ss "مْست" ;
|
||||
much_Det = mkDet "الكَثِير" Pl Const ;
|
||||
-- must_VV = {
|
||||
-- s = table VVForm [["بي هَثي تْ"] ; "مُست" ; ["هَد تْ"] ;
|
||||
-- ["هَد تْ"] ; ["هَثِنغ تْ"] ; "مُستنءت" ; ["هَدنءت تْ"]] ; ----
|
||||
-- isAux = True
|
||||
-- } ;
|
||||
-- no_Phr = ss "نْ" ;
|
||||
-- on_Prep = ss "ْن" ;
|
||||
one_Quant = mkQuantNum "واحِد" Sg Indef ;
|
||||
-- only_Predet = ss "ْنلي" ;
|
||||
-- or_Conj = ss "ْر" ** {n = Sg} ;
|
||||
-- otherwise_PConj = ss "ْتهروِسي" ;
|
||||
-- part_Prep = ss "ْف" ;
|
||||
-- please_Voc = ss "ةلَسي" ;
|
||||
-- possess_Prep = ss "ْف" ;
|
||||
-- quite_Adv = ss "قُِتي" ;
|
||||
-- she_Pron = mkNP "سهي" "هر" "هر" Sg P3 ;
|
||||
-- so_AdA = ss "سْ" ;
|
||||
-- somebody_NP = regNP "سْمبْدي" Sg ;
|
||||
someSg_Det = mkDet "أَحَد" Pl Const ;
|
||||
somePl_Det = mkDet "بَعض" Pl Const ;
|
||||
-- something_NP = regNP "سْمتهِنغ" Sg ;
|
||||
-- somewhere_Adv = ss "سْموهري" ;
|
||||
that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def;
|
||||
-- that_NP = regNP "تهَت" Sg ;
|
||||
there_Adv = ss "هُناك" ;
|
||||
-- there7to_Adv = ss "تهري" ;
|
||||
-- there7from_Adv = ss ["فرْم تهري"] ;
|
||||
-- therefore_PConj = ss "تهرفْري" ;
|
||||
-- these_NP = regNP "تهسي" Pl ;
|
||||
they_Pron = mkNP "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
|
||||
this_Quant = mkQuant7 "هَذا" "هَذِهِ" "هَذَان" "هَذَيْن" "هَاتَان" "هَاتَيْن" "هَؤُلَاء" Def;
|
||||
-- this_NP = regNP "تهِس" Sg ;
|
||||
-- those_NP = regNP "تهْسي" Pl ;
|
||||
-- through_Prep = ss "تهرُْغه" ;
|
||||
-- too_AdA = ss "تّْ" ;
|
||||
-- to_Prep = ss "تْ" ;
|
||||
-- under_Prep = ss "ُندر" ;
|
||||
-- very_AdA = ss "ثري" ;
|
||||
-- want_VV = P.mkVV (P.regV "وَنت") ;
|
||||
we_Pron = mkNP "نَحنُ" "نا" "نا" (Per1 Plur) ;
|
||||
whatPl_IP = mkIP "ماذا" Pl ;
|
||||
whatSg_IP = mkIP "ماذا" Sg ;
|
||||
when_IAdv = ss "مَتَى" ;
|
||||
-- when_Subj = ss "وهن" ;
|
||||
where_IAdv = ss "أَينَ" ;
|
||||
-- whichPl_IDet = mkDeterminer Pl ["وهِعه"] ;
|
||||
-- whichSg_IDet = mkDeterminer Sg ["وهِعه"] ;
|
||||
whoSg_IP = mkIP "مَنْ" Sg ;
|
||||
whoPl_IP = mkIP "مَنْ" Pl ;
|
||||
-- why_IAdv = ss "وهي" ;
|
||||
-- without_Prep = ss "وِتهُْت" ;
|
||||
with_Prep = ss "مَع" ;
|
||||
-- yes_Phr = ss "يس" ;
|
||||
youSg_Pron = mkNP "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
|
||||
youPl_Pron = mkNP "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
|
||||
youPol_Pron = mkNP "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
|
||||
--
|
||||
--
|
||||
--oper
|
||||
-- mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> {
|
||||
-- s = table Number [x ; y]
|
||||
-- } ;
|
||||
--
|
||||
}
|
||||
40
lib/resource/arabic/VerbAra.gf
Normal file
40
lib/resource/arabic/VerbAra.gf
Normal file
@@ -0,0 +1,40 @@
|
||||
concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
ComplV2 v np = insertObj np (predV v);
|
||||
ComplV3 v np np2 = insertObj np2 (insertObj np (predV v)) ;
|
||||
|
||||
{-{s = \\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc ;
|
||||
a = {pgn = Per3 Masc Sg ; isPron = False} } --FIXME
|
||||
(predV v) ;-}
|
||||
--
|
||||
-- ComplVV v vp = insertObj (\\a => infVP v.isAux vp a) (predVV v) ;
|
||||
--
|
||||
-- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
||||
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||
--
|
||||
-- ComplVA v ap = insertObj (ap.s) (predV v) ;
|
||||
-- ComplV2A v np ap =
|
||||
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||
--
|
||||
UseComp xabar = kaan xabar ;
|
||||
|
||||
AdvVP vp adv = insertStr adv.s vp ;
|
||||
|
||||
-- AdVVP adv vp = insertAdV adv.s vp ;
|
||||
--
|
||||
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||
--
|
||||
-- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
|
||||
--
|
||||
-- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "تْ"
|
||||
--
|
||||
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c} ; --FIXME
|
||||
CompNP np = {s = \\_,c => np.s ! c};
|
||||
-- CompAdv a = {s = \\_ => a.s} ;
|
||||
--
|
||||
--
|
||||
}
|
||||
31
lib/resource/common/CommonX.gf
Normal file
31
lib/resource/common/CommonX.gf
Normal file
@@ -0,0 +1,31 @@
|
||||
concrete CommonX of Common = open (R = ParamX) in {
|
||||
|
||||
lincat
|
||||
Text = {s : Str} ; --lock_Text : {}} ;
|
||||
Phr = {s : Str} ; --lock_Phr : {}} ;
|
||||
Utt = {s : Str} ; --lock_Utt : {}} ;
|
||||
Voc = {s : Str} ; --lock_Voc : {}} ;
|
||||
SC = {s : Str} ; --lock_SC : {}} ;
|
||||
Adv = {s : Str} ; --lock_Adv : {}} ;
|
||||
AdV = {s : Str} ; --lock_AdV : {}} ;
|
||||
AdA = {s : Str} ; --lock_AdA : {}} ;
|
||||
AdN = {s : Str} ; --lock_AdN : {}} ;
|
||||
IAdv = {s : Str} ; --lock_IAdv : {}} ;
|
||||
CAdv = {s : Str} ; --lock_CAdv : {}} ;
|
||||
PConj = {s : Str} ; --lock_PConj : {}} ;
|
||||
|
||||
Tense = {s : Str ; t : R.Tense} ;
|
||||
Ant = {s : Str ; a : R.Anteriority} ;
|
||||
Pol = {s : Str ; p : R.Polarity} ;
|
||||
|
||||
lin
|
||||
PPos = {s = []} ** {p = R.Pos} ;
|
||||
PNeg = {s = []} ** {p = R.Neg} ;
|
||||
TPres = {s = []} ** {t = R.Pres} ;
|
||||
TPast = {s = []} ** {t = R.Past} ; --# notpresent
|
||||
TFut = {s = []} ** {t = R.Fut} ; --# notpresent
|
||||
TCond = {s = []} ** {t = R.Cond} ; --# notpresent
|
||||
ASimul = {s = []} ** {a = R.Simul} ;
|
||||
AAnter = {s = []} ** {a = R.Anter} ; --# notpresent
|
||||
|
||||
}
|
||||
17
lib/resource/common/ConstructX.gf
Normal file
17
lib/resource/common/ConstructX.gf
Normal file
@@ -0,0 +1,17 @@
|
||||
resource ConstructX = open CommonX in {
|
||||
|
||||
oper
|
||||
mkText : Str -> Text = \s -> {s = s ; lock_Text = <>} ;
|
||||
mkPhr : Str -> Phr = \s -> {s = s ; lock_Phr = <>} ;
|
||||
mkUtt : Str -> Utt = \s -> {s = s ; lock_Utt = <>} ;
|
||||
mkVoc : Str -> Voc = \s -> {s = s ; lock_Voc = <>} ;
|
||||
mkSC : Str -> SC = \s -> {s = s ; lock_SC = <>} ;
|
||||
mkAdv : Str -> Adv = \s -> {s = s ; lock_Adv = <>} ;
|
||||
mkAdV : Str -> AdV = \s -> {s = s ; lock_AdV = <>} ;
|
||||
mkAdA : Str -> AdA = \s -> {s = s ; lock_AdA = <>} ;
|
||||
mkAdN : Str -> AdN = \s -> {s = s ; lock_AdN = <>} ;
|
||||
mkIAdv : Str -> IAdv = \s -> {s = s ; lock_IAdv = <>} ;
|
||||
mkCAdv : Str -> CAdv = \s -> {s = s ; lock_CAdv = <>} ;
|
||||
mkPConj : Str -> PConj = \s -> {s = s ; lock_PConj = <>} ;
|
||||
|
||||
}
|
||||
47
lib/resource/common/ParamX.gf
Normal file
47
lib/resource/common/ParamX.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
resource ParamX = open Prelude in {
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Person = P1 | P2 | P3 ;
|
||||
Degree = Posit | Compar | Superl ;
|
||||
|
||||
Anteriority =
|
||||
Simul
|
||||
| Anter --# notpresent
|
||||
;
|
||||
Tense =
|
||||
Pres
|
||||
| Past --# notpresent
|
||||
| Fut --# notpresent
|
||||
| Cond --# notpresent
|
||||
;
|
||||
|
||||
param
|
||||
|
||||
Polarity = Pos | Neg ;
|
||||
|
||||
QForm = QDir | QIndir ;
|
||||
|
||||
oper
|
||||
conjNumber : Number -> Number -> Number = \m,n ->
|
||||
case <m,n> of {
|
||||
<Sg,Sg> => Sg ;
|
||||
_ => Pl
|
||||
} ;
|
||||
|
||||
-- For persons, we let the latter argument win ("either you or I am absent"
|
||||
-- but "either I or you are absent"). This is not quite clear.
|
||||
|
||||
conjPerson : Person -> Person -> Person = \_,p ->
|
||||
p ;
|
||||
|
||||
-- To construct a record with a polarity-dependent table.
|
||||
|
||||
polCases : SS -> SS -> {s : Polarity => Str} = \true,false -> {
|
||||
s = table {
|
||||
Pos => true.s ;
|
||||
Neg => false.s
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
18
lib/resource/common/TenseX.gf
Normal file
18
lib/resource/common/TenseX.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
concrete TenseX of Tense = open (R = ParamX) in {
|
||||
|
||||
lincat
|
||||
Tense = {s : Str ; t : R.Tense} ;
|
||||
Ant = {s : Str ; a : R.Anteriority} ;
|
||||
Pol = {s : Str ; p : R.Polarity} ;
|
||||
|
||||
lin
|
||||
PPos = {s = []} ** {p = R.Pos} ;
|
||||
PNeg = {s = []} ** {p = R.Neg} ;
|
||||
TPres = {s = []} ** {t = R.Pres} ;
|
||||
TPast = {s = []} ** {t = R.Past} ;
|
||||
TFut = {s = []} ** {t = R.Fut} ;
|
||||
TCond = {s = []} ** {t = R.Cond} ;
|
||||
ASimul = {s = []} ** {a = R.Simul} ;
|
||||
AAnter = {s = []} ** {a = R.Anter} ;
|
||||
|
||||
}
|
||||
11
lib/resource/common/TextX.gf
Normal file
11
lib/resource/common/TextX.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
concrete TextX of Text = CommonX ** {
|
||||
|
||||
-- This will work for almost all languages except Spanish.
|
||||
|
||||
lin
|
||||
TEmpty = {s = []} ;
|
||||
TFullStop x xs = {s = x.s ++ "." ++ xs.s} ;
|
||||
TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ;
|
||||
TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ;
|
||||
|
||||
}
|
||||
2
lib/resource/danish/AdjectiveDan.gf
Normal file
2
lib/resource/danish/AdjectiveDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdjectiveDan of Adjective = CatDan ** AdjectiveScand with
|
||||
(ResScand = ResDan) ;
|
||||
2
lib/resource/danish/AdverbDan.gf
Normal file
2
lib/resource/danish/AdverbDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdverbDan of Adverb = CatDan ** AdverbScand with
|
||||
(ResScand = ResDan) ;
|
||||
@@ -1,235 +0,0 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete BasicDan of Basic = CategoriesDan ** open ParadigmsDan,VerbsDan in {
|
||||
|
||||
flags startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = mk2N "fly" "flyet" ;
|
||||
answer_V2S = mkV2S (regV "svare") "til" ;
|
||||
apartment_N = mk2N "leilighet" "leiligheten" ;
|
||||
apple_N = mk2N "eple" "eplet" ;
|
||||
art_N = mk2N "kunst" "kunsten" ;
|
||||
ask_V2Q = mkV2Q spørre_V [] ;
|
||||
baby_N = mk2N "baby" "babyen" ;
|
||||
bad_ADeg = regADeg "dårlig" ; ----
|
||||
bank_N = mk2N "bank" "banken" ;
|
||||
beautiful_ADeg = mk3ADeg "vakker" "vakkert" "vakra" ;
|
||||
become_VA = mkVA bli_V;
|
||||
beer_N = regN "øl" neutrum ;
|
||||
beg_V2V = mkV2V be_V [] "att" ;
|
||||
big_ADeg = irregADeg "stor" "større" "størst";
|
||||
bike_N = mkN "sykkel" "sykkelen" "sykler" "syklene" ;
|
||||
bird_N = mk2N "fugl" "fuglen" ;
|
||||
black_ADeg = mk2ADeg "svart" "svart" ;
|
||||
blue_ADeg = mk2ADeg "blå" "blått";
|
||||
boat_N = regN "båt" utrum ;
|
||||
book_N = mkN "bok" "boka" "bøker" "bøkene" ;
|
||||
boot_N = mkN "støvel" "støvelen" "støvler" "støvlene" ;
|
||||
boss_N = mk2N "sjef" "sjefen" ;
|
||||
boy_N = regN "gutt" utrum ;
|
||||
bread_N = regN "brød" neutrum ;
|
||||
break_V2 = dirV2 (mk2V "knuse" "knuste") ;
|
||||
broad_ADeg = regADeg "bred" ;
|
||||
brother_N2 = mkN2 ( (mkN "bror" "broren" "brødre" "brødrene")) "til" ;
|
||||
brown_ADeg = regADeg "brun" ;
|
||||
butter_N = regN "smør" neutrum ;
|
||||
buy_V2 = dirV2 (mk2V "kjøpe" "kjøpte") ;
|
||||
camera_N = mk2N "kamera" "kameraen" ; ----
|
||||
cap_N = mk2N "lue" "lua" ;
|
||||
car_N = regN "bil" utrum ;
|
||||
carpet_N = regN "matte" utrum ;
|
||||
cat_N = mk2N "katt" "katten" ;
|
||||
ceiling_N = regN "tak" neutrum ;
|
||||
chair_N = regN "stol" utrum ;
|
||||
cheese_N = regN "ost" utrum ;
|
||||
child_N = regN "barn" neutrum ;
|
||||
church_N = regN "kirke" utrum ;
|
||||
city_N = mk2N "by" "byen" ;
|
||||
clean_ADeg = regADeg "rein" ;
|
||||
clever_ADeg = regADeg "klok" ;
|
||||
close_V2 = dirV2 (mk2V "lukke" "lukket") ;
|
||||
coat_N = regN "frakk" utrum ;
|
||||
cold_ADeg = regADeg "kald" ;
|
||||
come_V = komme_V ;
|
||||
computer_N = mk2N "datamaskin" "datamaskinen" ;
|
||||
country_N = mk2N "land" "landet" ;
|
||||
cousin_N = mk2N "fetter" "fetteren" ; ----
|
||||
cow_N = mkN "ku" "kua" "kyr" "kyrne" ; ----
|
||||
die_V = dø_V ;
|
||||
dirty_ADeg = mk3ADeg "skitten" "skittent" "skitne" ; ----
|
||||
distance_N3 = mkN3 (regN "avstand" utrum) "fra" "til" ;
|
||||
doctor_N = mk2N "lege" "legen" ;
|
||||
dog_N = regN "hund" utrum ;
|
||||
door_N = regN "dør" utrum ;
|
||||
drink_V2 = dirV2 drikke_V ;
|
||||
easy_A2V = mkA2V (regA "grei") "før" ;
|
||||
eat_V2 = dirV2 (mk2V "spise" "spiste") ;
|
||||
empty_ADeg = mkADeg "tom" "tomt" "tomme" "tommere" "tommest" ;
|
||||
enemy_N = regN "fiende" utrum ;
|
||||
factory_N = mk2N "fabrikk" "fabrikken" ;
|
||||
father_N2 = mkN2 ( (mkN "far" "faren" "fedre" "fedrene")) "til" ;
|
||||
fear_VS = mkVS (regV "frykte") ;
|
||||
find_V2 = dirV2 (irregV "finne" "fann" "funnet") ;
|
||||
fish_N = mk2N "fisk" "fisken" ;
|
||||
floor_N = regN "golv" neutrum ;
|
||||
forget_V2 = dirV2 (mkV "glemme" "glemmer" "glemmes" "glemte" "glemt" "glem") ;
|
||||
fridge_N = regN "kjøleskap" neutrum ;
|
||||
friend_N = mkN "venn" "vennen" "venner" "vennene" ;
|
||||
fruit_N = mk2N "frukt" "frukten" ;
|
||||
fun_AV = mkAV (mkA "morsom" "morsomt" "morsomme") ;
|
||||
garden_N = regN "hage" utrum ;
|
||||
girl_N = regN "jente" utrum ;
|
||||
glove_N = regN "hanske" utrum ;
|
||||
gold_N = regN "gull" neutrum ;
|
||||
good_ADeg = mkADeg "god" "godt" "gode" "bedre" "best" ;
|
||||
go_V = gå_V ;
|
||||
green_ADeg = mk2ADeg "grønn" "grønt" ;
|
||||
harbour_N = regN "havn" utrum;
|
||||
hate_V2 = dirV2 (regV "hate") ;
|
||||
hat_N = regN "hatt" utrum ;
|
||||
have_V2 = dirV2 ha_V ;
|
||||
hear_V2 = dirV2 (mk2V "høre" "hørte") ;
|
||||
hill_N = regN "haug" utrum ;
|
||||
hope_VS = mkVS (regV "håpe") ;
|
||||
horse_N = regN "hest" utrum ;
|
||||
hot_ADeg = regADeg "heit" ;
|
||||
house_N = regN "hus" neutrum ;
|
||||
important_ADeg = regADeg "viktig" ;
|
||||
industry_N = mk2N "industri" "industrien" ;
|
||||
iron_N = regN "jern" neutrum ;
|
||||
king_N = regN "konge" utrum ;
|
||||
know_V2 = dirV2 vite_V ;
|
||||
lake_N = regN "vann" neutrum ;
|
||||
lamp_N = regN "lampe" utrum ;
|
||||
learn_V2 = dirV2 (mk2V "lære" "lærte") ;
|
||||
leather_N = regN "lær" neutrum ;
|
||||
leave_V2 = dirV2 forlate_V ;
|
||||
like_V2 = dirV2 (mk2V "like" "likte") ;
|
||||
listen_V2 = dirV2 (regV "lytte") ;
|
||||
live_V = mk2V "leve" "levde" ;
|
||||
long_ADeg = irregADeg "lang" "lengre" "lengst" ;
|
||||
lose_V2 = dirV2 (mk2V "tape" "tapte") ;
|
||||
love_N = regN "kjærlighet" utrum ;
|
||||
love_V2 = dirV2 (regV "elske") ;
|
||||
man_N = (mkN "mann" "mannen" "menn" "mennen") ;
|
||||
married_A2 = mkA2 (mk2A "gift" "gift") "med" ;
|
||||
meat_N = regN "kjøtt" neutrum ;
|
||||
milk_N = regN "melk" utrum ;
|
||||
moon_N = regN "måne" utrum ;
|
||||
mother_N2 = mkN2 (mkN "mor" "moren" "mødre" "mødrene") "til" ; ---- fem
|
||||
mountain_N = regN "berg" neutrum ;
|
||||
music_N = mk2N "musikk" "musikken" ;
|
||||
narrow_ADeg = regADeg "smal" ;
|
||||
new_ADeg = mkADeg "ny" "nytt" "nye" "nyere" "nyest" ;
|
||||
newspaper_N = regN "avis" utrum ;
|
||||
oil_N = regN "olje" utrum ;
|
||||
old_ADeg = mkADeg "gammel" "gammelt" "gamle" "eldre" "eldst" ;
|
||||
open_V2 = dirV2 (regV "åpne") ;
|
||||
paint_V2A = mkV2A (regV "male") [] ;
|
||||
paper_N = regN "papir" neutrum ; ----
|
||||
peace_N = regN "fred" utrum ;
|
||||
pen_N = regN "penn" utrum ;
|
||||
planet_N = mk2N "planet" "planeten" ;
|
||||
plastic_N = mk2N "plast" "plasten" ;
|
||||
play_V2 = dirV2 (mk2V "spille" "spilte") ;
|
||||
policeman_N = mk2N "politi" "politien" ;
|
||||
priest_N = mk2N "prest" "presten" ;
|
||||
probable_AS = mkAS (regA "sannsynlig") ;
|
||||
queen_N = regN "dronning" utrum ;
|
||||
radio_N = regN "radio" utrum ;
|
||||
rain_V0 = mkV0 (regV "regne") ;
|
||||
read_V2 = dirV2 (mk2V "lese" "leste") ;
|
||||
red_ADeg = regADeg "rød" ;
|
||||
religion_N = mk2N "religion" "religionen" ;
|
||||
restaurant_N = mk2N "restaurant" "restauranten" ;
|
||||
river_N = mk2N "elv" "elva" ;
|
||||
rock_N = regN "stein" utrum ;
|
||||
roof_N = regN "tak" neutrum ;
|
||||
rubber_N = mk2N "gummi" "gummien" ;
|
||||
run_V = springe_V ;
|
||||
say_VS = mkVS si_V ;
|
||||
school_N = regN "skole" utrum;
|
||||
science_N = mk2N "vitenskap" "vitenskapen" ;
|
||||
sea_N = mk2N "sjø" "sjøen" ;
|
||||
seek_V2 = mkV2 (mk2V "lete" "lette") "etter" ;
|
||||
see_V2 = dirV2 se_V ;
|
||||
sell_V3 = dirV3 selge_V "til" ;
|
||||
send_V3 = dirV3 (mk2V "sende" "sendte") "til" ;
|
||||
sheep_N = mk2N "får" "fåret" ;
|
||||
ship_N = regN "skip" neutrum ;
|
||||
shirt_N = regN "skjorte" utrum ;
|
||||
shoe_N = regN "sko" utrum ;
|
||||
shop_N = mk2N "butikk" "butikken" ;
|
||||
short_ADeg = regADeg "kort" ;
|
||||
silver_N = mk2N "sølv" "sølvet";
|
||||
sister_N = mkN "søster" "søsteren" "søstrer" "søstrene" ;
|
||||
sleep_V = irregV "sove" "sov" "sovet" ;
|
||||
small_ADeg = mkADeg "liten" "lite" "små" "mindre" "minst" ; ---- lille
|
||||
snake_N = regN "orm" utrum ;
|
||||
sock_N = regN "strømpe" utrum ;
|
||||
speak_V2 = dirV2 (regV "snakke") ;
|
||||
star_N = regN "stjerne" utrum ;
|
||||
steel_N = regN "stål" neutrum ;
|
||||
stone_N = regN "stein" utrum ;
|
||||
stove_N = regN "komfyr" utrum ;
|
||||
student_N = mk2N "student" "studenten" ;
|
||||
stupid_ADeg = mk3ADeg "dum" "dumt" "dumme" ;
|
||||
sun_N = regN "sol" utrum ;
|
||||
switch8off_V2 = dirV2 (partV (irregV "slå" "slo" "slått") "av") ;
|
||||
switch8on_V2 = dirV2 (partV (irregV "slå" "slo" "slått") "på") ;
|
||||
table_N = regN "bord" neutrum ;
|
||||
talk_V3 = mkV3 (regV "snakke") "til" "om" ;
|
||||
teacher_N = mkN "lærer" "læreren" "lærere" "lærerne" ;
|
||||
teach_V2 = dirV2 (mk2V "undervise" "underviste") ;
|
||||
television_N = mk2N "fjernsyn" "fjernsynet" ;
|
||||
thick_ADeg = mk2ADeg "tykk" "tykt" ;
|
||||
thin_ADeg = mk2ADeg "tynn" "tynt" ;
|
||||
train_N = regN "tog" neutrum ;
|
||||
travel_V = mk2V "reise" "reiste" ;
|
||||
tree_N = mkN "tre" "treet" "trær" "træne" ;
|
||||
---- trousers_N = regN "trousers" ; ---- pl t !
|
||||
ugly_ADeg = mk2ADeg "stygg" "stygt" ;
|
||||
understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ;
|
||||
university_N = regN "universitet" neutrum ;
|
||||
village_N = mk2N "grend" "grenda" ;
|
||||
wait_V2 = mkV2 (regV "vente") "på" ;
|
||||
walk_V = (irregV "gå" "gikk" "gått") ;
|
||||
warm_ADeg = regADeg "varm" ;
|
||||
war_N = regN "krig" utrum ;
|
||||
watch_V2 = mkV2 se_V "på" ;
|
||||
water_N = mk2N "vatn" "vatnet" ;
|
||||
white_ADeg = regADeg "hvit" ;
|
||||
window_N = mkN "vindu" "vinduet" "vinduer" "vinduene" ; ---- er?
|
||||
wine_N = mk2N "vin" "vinen" ;
|
||||
win_V2 = dirV2 (irregV "vinne" "vant" "vunnet") ;
|
||||
woman_N = regN "kvinne" utrum ; ---- kvinnen
|
||||
wonder_VQ = mkVQ (regV "undre") ; ---- seg
|
||||
wood_N = mkN "tre" "treet" "trær" "træne" ;
|
||||
write_V2 = dirV2 (irregV "skrive" "skrev" "skrevet") ;
|
||||
yellow_ADeg = regADeg "gul" ;
|
||||
young_ADeg = irregADeg "ung" "yngre" "yngst" ;
|
||||
|
||||
do_V2 = dirV2 (irregV "gjøre" "gjorde" "gjort") ;
|
||||
now_Adv = mkAdv "nå" ;
|
||||
already_Adv = mkAdv "allerede" ;
|
||||
song_N = mk2N "sang" "sangen" ;
|
||||
add_V3 = mkV3 (partV (irregV "legge" "la" "lagt") "til") [] "til" ;
|
||||
number_N = mk2N "nummer" "nummeret" ;
|
||||
put_V2 = mkV2 (irregV "sette" "satte" "satt") [] ;
|
||||
stop_V = regV "stanse" ;
|
||||
jump_V = regV "hoppe" ;
|
||||
here_Adv = mkAdv "her" ;
|
||||
here7to_Adv = mkAdv "hit" ;
|
||||
here7from_Adv = mkAdv ["herfra"] ;
|
||||
there_Adv = mkAdv "der" ;
|
||||
there7to_Adv = mkAdv "dit" ;
|
||||
there7from_Adv = mkAdv ["derfra"] ;
|
||||
|
||||
} ;
|
||||
|
||||
-- a" -> e" 86
|
||||
-- ö -> ø 66
|
||||
-- ck -> kk 20
|
||||
-- ä -> e 44
|
||||
2
lib/resource/danish/CatDan.gf
Normal file
2
lib/resource/danish/CatDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete CatDan of Cat = CommonX ** CatScand with
|
||||
(ResScand = ResDan) ;
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete CategoriesDan of Categories =
|
||||
CategoriesScand with (SyntaxScand=SyntaxDan) ;
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete ClauseDan of Clause = CategoriesDan **
|
||||
ClauseI with (Rules=RulesDan), (Verbphrase=VerbphraseDan) ;
|
||||
2
lib/resource/danish/ConjunctionDan.gf
Normal file
2
lib/resource/danish/ConjunctionDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ConjunctionDan of Conjunction = CatDan ** ConjunctionScand with
|
||||
(ResScand = ResDan) ;
|
||||
@@ -1,27 +0,0 @@
|
||||
concrete CountryDan of Country = open CategoriesDan, ParadigmsDan in {
|
||||
|
||||
lincat
|
||||
Country = PN ;
|
||||
Nationality = A ;
|
||||
Language = N ;
|
||||
|
||||
lin
|
||||
Denmark = regPN "Danmark" neutrum ;
|
||||
England = regPN "England" neutrum ;
|
||||
Finland = regPN "Finland" neutrum ;
|
||||
France = regPN "Frankrike" neutrum ;
|
||||
Germany = regPN "Tyskland" neutrum ;
|
||||
Italy = regPN "Italien" neutrum ;
|
||||
Norway = regPN "Norge" neutrum ;
|
||||
Russia = regPN "Ryssland" neutrum ;
|
||||
Spain = regPN "Spanien" neutrum ;
|
||||
Sweden = regPN "Sverige" neutrum ;
|
||||
|
||||
Danish = regA "dansk" ;
|
||||
English = regA "engelsk" ;
|
||||
|
||||
DanishLang = regN "dansk" utrum ;
|
||||
EnglishLang = regN "engelsk" utrum ;
|
||||
|
||||
|
||||
} ;
|
||||
7
lib/resource/danish/Danish.gf
Normal file
7
lib/resource/danish/Danish.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:../scandinavian:../abstract:../common:prelude
|
||||
|
||||
concrete Danish of DanishAbs =
|
||||
LangDan,
|
||||
IrregDan - [fly_V],
|
||||
ExtraDan
|
||||
** {} ;
|
||||
5
lib/resource/danish/DanishAbs.gf
Normal file
5
lib/resource/danish/DanishAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract DanishAbs =
|
||||
Lang,
|
||||
IrregDanAbs - [fly_V],
|
||||
ExtraDanAbs
|
||||
** {} ;
|
||||
86
lib/resource/danish/DiffDan.gf
Normal file
86
lib/resource/danish/DiffDan.gf
Normal file
@@ -0,0 +1,86 @@
|
||||
instance DiffDan of DiffScand = open CommonScand, Prelude in {
|
||||
|
||||
-- Parameters.
|
||||
|
||||
param
|
||||
Gender = Utr | Neutr ;
|
||||
|
||||
oper
|
||||
utrum = Utr ;
|
||||
neutrum = Neutr ;
|
||||
|
||||
gennum : Gender -> Number -> GenNum = \g,n ->
|
||||
case <g,n> of {
|
||||
<Utr, Sg> => SgUtr ;
|
||||
<Neutr,Sg> => SgNeutr ;
|
||||
_ => Plg
|
||||
} ;
|
||||
|
||||
detDef : Species = Indef ;
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str ;
|
||||
part : Str ;
|
||||
vtype : VType ;
|
||||
isVaere : Bool
|
||||
} ;
|
||||
|
||||
hasAuxBe v = v.isVaere ;
|
||||
|
||||
-- Strings.
|
||||
|
||||
conjThat = "at" ;
|
||||
conjThan = "end" ;
|
||||
conjAnd = "og" ;
|
||||
infMark = "at" ;
|
||||
compMore = "mere" ;
|
||||
|
||||
subjIf = "hvis" ;
|
||||
|
||||
artIndef : Gender => Str = table {
|
||||
Utr => "en" ;
|
||||
Neutr => "et"
|
||||
} ;
|
||||
|
||||
verbHave =
|
||||
mkVerb "have" "har" "hav" "havde" "haft" nonExist nonExist nonExist **
|
||||
{part = [] ; isVaere = False} ;
|
||||
verbBe =
|
||||
mkVerb "være" "er" "var" "var" "været" "væren" "været" "værne" **
|
||||
{part = [] ; isVaere = False} ;
|
||||
verbBecome =
|
||||
mkVerb "blive" "bliver" "bliv" "blev" "blevet"
|
||||
"bliven" "blivet" "blivne" **
|
||||
{part = [] ; isVaere = True} ;
|
||||
|
||||
auxFut = "vil" ; -- "skal" in ExtDan
|
||||
auxCond = "ville" ;
|
||||
|
||||
negation : Polarity => Str = table {
|
||||
Pos => [] ;
|
||||
Neg => "ikke"
|
||||
} ;
|
||||
|
||||
genderForms : (x1,x2 : Str) -> Gender => Str = \all,allt ->
|
||||
table {
|
||||
Utr => all ;
|
||||
Neutr => allt
|
||||
} ;
|
||||
|
||||
relPron : GenNum => RCase => Str = \\gn,c => case c of {
|
||||
RNom => "som" ;
|
||||
RGen => "hvis" ;
|
||||
RPrep => gennumForms "hvilken" "hvilket" "hvilke" ! gn
|
||||
} ;
|
||||
|
||||
pronSuch = gennumForms "sådan" "sådant" "sådanne" ;
|
||||
|
||||
reflPron : Agr -> Str = \a -> case a of {
|
||||
{gn = Plg ; p = P1} => "oss" ;
|
||||
{gn = Plg ; p = P2} => "jer" ;
|
||||
{p = P1} => "mig" ;
|
||||
{p = P2} => "dig" ;
|
||||
{p = P3} => "sig"
|
||||
} ;
|
||||
|
||||
}
|
||||
3
lib/resource/danish/ExtraDan.gf
Normal file
3
lib/resource/danish/ExtraDan.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
concrete ExtraDan of ExtraDanAbs = ExtraScandDan ** open CommonScand, ResDan in {
|
||||
|
||||
}
|
||||
7
lib/resource/danish/ExtraDanAbs.gf
Normal file
7
lib/resource/danish/ExtraDanAbs.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Structures special for Danish. These are not implemented in other
|
||||
-- Scandinavian languages.
|
||||
|
||||
abstract ExtraDanAbs = ExtraScandAbs ** {
|
||||
|
||||
|
||||
}
|
||||
2
lib/resource/danish/ExtraScandDan.gf
Normal file
2
lib/resource/danish/ExtraScandDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ExtraScandDan of ExtraScandAbs = CatDan ** ExtraScand with
|
||||
(ResScand = ResDan) ;
|
||||
21
lib/resource/danish/GrammarDan.gf
Normal file
21
lib/resource/danish/GrammarDan.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
--# -path=.:../scandinavian:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarDan of Grammar =
|
||||
NounDan,
|
||||
VerbDan,
|
||||
AdjectiveDan,
|
||||
AdverbDan,
|
||||
NumeralDan,
|
||||
SentenceDan,
|
||||
QuestionDan,
|
||||
RelativeDan,
|
||||
ConjunctionDan,
|
||||
PhraseDan,
|
||||
TextX,
|
||||
IdiomDan,
|
||||
StructuralDan
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
41
lib/resource/danish/IdiomDan.gf
Normal file
41
lib/resource/danish/IdiomDan.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
concrete IdiomDan of Idiom = CatDan **
|
||||
open MorphoDan, ParadigmsDan, IrregDan, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ;
|
||||
GenericCl vp = mkClause "man" (agrP3 utrum Sg) vp ;
|
||||
|
||||
CleftNP np rs = mkClause "det" (agrP3 neutrum Sg)
|
||||
(insertObj (\\_ => rs.s ! np.a)
|
||||
(insertObj (\\_ => np.s ! rs.c) (predV verbBe))) ;
|
||||
|
||||
CleftAdv ad s = mkClause "det" (agrP3 neutrum Sg)
|
||||
(insertObj (\\_ => "som" ++ s.s ! Sub)
|
||||
(insertObj (\\_ => ad.s) (predV verbBe))) ;
|
||||
|
||||
|
||||
ExistNP np =
|
||||
mkClause "det" (agrP3 neutrum Sg) (insertObj
|
||||
(\\_ => np.s ! accusative) (predV (depV finde_V))) ;
|
||||
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
cls =
|
||||
(mkClause "det" (agrP3 neutrum Sg) (predV (depV finde_V))).s ! t ! a ! p ;
|
||||
who = ip.s ! accusative
|
||||
in table {
|
||||
QDir => who ++ cls ! Inv ;
|
||||
QIndir => who ++ cls ! Sub
|
||||
}
|
||||
} ;
|
||||
|
||||
ProgrVP vp =
|
||||
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
|
||||
|
||||
ImpPl1 vp = {s = ["lad os"] ++ infVP vp {gn = Plg ; p = P1}} ;
|
||||
|
||||
}
|
||||
|
||||
72
lib/resource/danish/IrregDan.gf
Normal file
72
lib/resource/danish/IrregDan.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
--# -path=.:../scandinavian:../common:../abstract:../../prelude
|
||||
|
||||
-- http://users.cybercity.dk/~nmb3879/danishgram3.html
|
||||
|
||||
concrete IrregDan of IrregDanAbs = CatDan ** open Prelude, ParadigmsDan in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
bære_V = irregV "bære" "bar" "båret" ;
|
||||
bede_V = mkV "bede" "beder" "bedes" "bad" "bedt" "bed" ;
|
||||
bide_V = irregV "bite" "bed" "bidt" ;
|
||||
binde_V = irregV "binde" "bandt" "bundet" ;
|
||||
blive_V = irregV "blive" "blev" "blevet" ;
|
||||
brænde_V = irregV "brænde" "brandt" "brændt" ;--
|
||||
bringe_V = irregV "bringe" "bragte" "bragt" ;
|
||||
burde_V = irregV "burde" "burde" "burdet" ;--
|
||||
dø_V = irregV "dø" "døde" "død" ;
|
||||
drage_V = irregV "drage" "drog" "draget" ;
|
||||
drikke_V = irregV "drikke" "drak" "drukket" ;
|
||||
drive_V = irregV "drive" "drev" "drevet" ;
|
||||
falde_V = irregV "falde" "faldt" "faldet" ;----er
|
||||
få_V = irregV "få" "fik" "fået" ;
|
||||
finde_V = irregV "finde" "fandt" "fundet" ;
|
||||
flyde_V = irregV "flyde" "flød" "flydt" ;
|
||||
flyve_V = irregV "flyve" "fløj" "fløjet" ;
|
||||
forlade_V = irregV "forlade" "forlod" "forladet" ;
|
||||
forstå_V = irregV "forstå" "forstod" "forstået" ;
|
||||
fryse_V = irregV "fryse" "frøs" "frosset" ;
|
||||
gå_V = irregV "gå" "gik" "gået" ;----er
|
||||
give_V = irregV "give" "gav" "givet" ;
|
||||
gnide_V = irregV "gnide" "gned" "gnidd" ;--
|
||||
gøre_V = irregV "gøre" "gjorde" "gjort" ;
|
||||
have_V = mkV "have" "har" "havde" "haft" nonExist "hav" ;
|
||||
hente_V = irregV "hente" "hentet" "hendt" ;--
|
||||
-- hete_V = irregV "hete" (variants {"het" ;-- "hette"}) "hett" ;--
|
||||
-- hjelpe_V = irregV "hjelpe" "hjalp" "hjulpet" ;--
|
||||
holde_V = irregV "holde" "holdt" "holdt" ;--
|
||||
komme_V = irregV "komme" "kom" "kommet" ;
|
||||
kunne_V = irregV "kunne" "kunne" "kunnet" ;
|
||||
lade_V = irregV "lade" "lod" "ladet" ;
|
||||
lægge_V = irregV "lægge" "lagde" "lagt" ;
|
||||
le_V = irregV "le" "lo" "leet" ;
|
||||
ligge_V = irregV "ligge" "lå" "ligget" ;
|
||||
løbe_V = irregV "løbe" "løb" "løbet" ;
|
||||
måtte_V = irregV "måtte" "måtte" "måttet" ;
|
||||
renne_V = irregV "renne" "rant" "rent" ;--
|
||||
sælge_V = irregV "sælge" "solgte" "solgt" ;
|
||||
sætte_V = irregV "sætte" "satte" "sat" ;
|
||||
se_V = irregV "se" "så" "set" ;
|
||||
sidde_V = irregV "sidde" "sad" "siddet" ;
|
||||
sige_V = irregV "sige" "sagde" "sagt" ;
|
||||
skære_V = irregV "skære" "skar" "skåret" ;--
|
||||
skrive_V = irregV "skrive" "skrev" "skrevet" ;
|
||||
skulle_V = irregV "skulle" "skulle" "skullet" ;
|
||||
slå_V = irregV "slå" "slog" "slått" ;--
|
||||
sove_V = irregV "sove" "sov" "sovet" ;
|
||||
spørge_V = irregV "spørge" "spurgte" "spurgt" ;
|
||||
springe_V = irregV "springe" "sprang" "sprunget" ;--
|
||||
stå_V = irregV "stå" "stod" "stået" ;
|
||||
stikke_V = irregV "stikke" "stakk" "stukket" ;--
|
||||
synge_V = irregV "synge" "sang" "sunget" ;--
|
||||
tage_V = irregV "tage" "tog" "taget" ;
|
||||
-- treffe_V = irregV "treffe" "traff" "truffet" ;--
|
||||
-- trives_V = irregV "trives" "trivdes" (variants {"trives" ;-- "trivs"}) ;--
|
||||
tælle_V = irregV "tælle" "talte" "talt" ;
|
||||
vide_V = irregV "vide" "vidste" "vidst" ;
|
||||
|
||||
}
|
||||
|
||||
-- readFile "vrbs.tmp" >>= mapM_ (putStrLn . (\ (a:_:b:c:_) -> " " ++ a ++ "_V = irregV \"" ++ a ++ "\" \"" ++ b ++ "\" \"" ++ c ++ "\" ;") . words) . lines
|
||||
65
lib/resource/danish/IrregDanAbs.gf
Normal file
65
lib/resource/danish/IrregDanAbs.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
abstract IrregDanAbs = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
bćre_V : V ;
|
||||
bede_V : V ;
|
||||
bide_V : V ;
|
||||
binde_V : V ;
|
||||
blive_V : V ;
|
||||
brćnde_V : V ;
|
||||
bringe_V : V ;
|
||||
burde_V : V ;
|
||||
dř_V : V ;
|
||||
drage_V : V ;
|
||||
drikke_V : V ;
|
||||
drive_V : V ;
|
||||
falde_V : V ;
|
||||
fĺ_V : V ;
|
||||
finde_V : V ;
|
||||
flyde_V : V ;
|
||||
flyve_V : V ;
|
||||
forlade_V : V ;
|
||||
forstĺ_V : V ;
|
||||
fryse_V : V ;
|
||||
gĺ_V : V ;
|
||||
give_V : V ;
|
||||
-- gjelde_V : V ;
|
||||
gnide_V : V ;
|
||||
gřre_V : V ;
|
||||
have_V : V ;
|
||||
hente_V : V ;
|
||||
-- hete_V : V ;
|
||||
-- hjelpe_V : V ;
|
||||
holde_V : V ;
|
||||
komme_V : V ;
|
||||
kunne_V : V ;
|
||||
lade_V : V ;
|
||||
lćgge_V : V ;
|
||||
le_V : V ;
|
||||
ligge_V : V ;
|
||||
lřbe_V : V ;
|
||||
mĺtte_V : V ;
|
||||
renne_V : V ;
|
||||
sćlge_V : V ;
|
||||
sćtte_V : V ;
|
||||
se_V : V ;
|
||||
sidde_V : V ;
|
||||
sige_V : V ;
|
||||
skćre_V : V ;
|
||||
skrive_V : V ;
|
||||
skulle_V : V ;
|
||||
slĺ_V : V ;
|
||||
sove_V : V ;
|
||||
spřrge_V : V ;
|
||||
springe_V : V ;
|
||||
stĺ_V : V ;
|
||||
stikke_V : V ;
|
||||
synge_V : V ;
|
||||
tage_V : V ;
|
||||
tćlle_V : V ;
|
||||
-- treffe_V : V ;
|
||||
-- trives_V : V ;
|
||||
vide_V : V ;
|
||||
|
||||
}
|
||||
@@ -1,22 +1,10 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
--# -path=.:../scandinavian:../abstract:../common:prelude
|
||||
|
||||
concrete LangDan of Lang =
|
||||
RulesDan,
|
||||
ClauseDan,
|
||||
StructuralDan,
|
||||
BasicDan,
|
||||
TimeDan,
|
||||
CountryDan
|
||||
GrammarDan,
|
||||
LexiconDan
|
||||
** {
|
||||
|
||||
** open Prelude, ParadigmsDan in {
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
lin
|
||||
AdvDate d = prefixSS "på" d ;
|
||||
AdvTime t = prefixSS "klokken" t ;
|
||||
NWeekday w = w ;
|
||||
PNWeekday w = nounPN w ;
|
||||
|
||||
PNCountry x = x ;
|
||||
ANationality x = x ;
|
||||
NLanguage x = x ;
|
||||
}
|
||||
} ;
|
||||
|
||||
359
lib/resource/danish/LexiconDan.gf
Normal file
359
lib/resource/danish/LexiconDan.gf
Normal file
@@ -0,0 +1,359 @@
|
||||
--# -path=.:../scandinavian:../common:../abstract:../../prelude
|
||||
|
||||
|
||||
|
||||
concrete LexiconDan of Lexicon = CatDan **
|
||||
open Prelude, ParadigmsDan, IrregDan in {
|
||||
|
||||
flags startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = mk2N "fly" "flyet" ;
|
||||
answer_V2S = mkV2S (regV "svare") (mkPrep "til") ;
|
||||
apartment_N = mk2N "værelse" "værelsen" ;
|
||||
apple_N = mk3N "æble" "æblet" "æbler" ;
|
||||
art_N = mk2N "kunst" "kunsten" ;
|
||||
ask_V2Q = mkV2Q spørge_V noPrep ;
|
||||
baby_N = mk2N "baby" "babyen" ; ---- babyen
|
||||
bad_A = regADeg "dårlig" ; ----
|
||||
bank_N = mk2N "bank" "banken" ;
|
||||
beautiful_A = mk3ADeg "smuk" "smukt" "smukke" ; ----
|
||||
become_VA = mkVA blive_V ;
|
||||
beer_N = mk2N "øl" "ølet" ;
|
||||
beg_V2V = mkV2V bede_V noPrep (mkPrep "at") ;
|
||||
big_A = irregADeg "stor" "større" "størst";
|
||||
bike_N = mkN "cykel" "cykeln" "cykler" "cyklerne" ; ----
|
||||
bird_N = mk2N "fugl" "fuglen" ;
|
||||
black_A = mk2ADeg "sort" "sort" ;
|
||||
blue_A = mk2ADeg "blå" "blått";
|
||||
boat_N = mk3N "båd" "båden" "både" ;
|
||||
book_N = mkN "bog" "bogen" "bøger" "bøgene" ;
|
||||
boot_N = mkN "støvle" "støvlen" "støvler" "støvlerne" ;
|
||||
boss_N = mk2N "chef" "chefen" ;
|
||||
boy_N = mk2N "dreng" "drengen" ;
|
||||
bread_N = mk2N "brød" "brødet" ;
|
||||
break_V2 = dirV2 (mk2V "knuse" "knuste") ;
|
||||
broad_A = regADeg "bred" ;
|
||||
brother_N2 = mkN2 (mk3N "broder" "brodren" "brødre") (mkPrep "til") ; ----
|
||||
brown_A = regADeg "brun" ;
|
||||
butter_N = mk2N "smør" "smøret" ;
|
||||
buy_V2 = dirV2 (mk2V "købe" "købte") ; ----
|
||||
camera_N = mk2N "kamera" "kameraen" ; ----
|
||||
cap_N = mk2N "hue" "huen" ;
|
||||
car_N = mk2N "bil" "bilen" ;
|
||||
carpet_N = mk2N "tæppe" "tæppen" ;
|
||||
cat_N = mk3N "kat" "katten" "katte" ;
|
||||
ceiling_N = mk2N "loft" "loftet" ;
|
||||
chair_N = mk3N "stol" "stolen" "stole" ;
|
||||
cheese_N = mk2N "ost" "osten" ;
|
||||
child_N = mk3N "barn" "barnet" "børn" ; ----
|
||||
church_N = mk2N "kirke" "kirken" ;
|
||||
city_N = mk2N "by" "byen" ;
|
||||
clean_A = regADeg "ren" ;
|
||||
clever_A = regADeg "flink" ;
|
||||
close_V2 = dirV2 (mk2V "lukke" "lukkede") ;
|
||||
coat_N = mk2N "frakke" "frakken" ;
|
||||
cold_A = regADeg "kold" ;
|
||||
come_V = vaereV komme_V ;
|
||||
computer_N = mk2N "datamaskine" "datamaskinen" ;
|
||||
country_N = mk2N "land" "landet" ;
|
||||
cousin_N = mk3N "fætter" "fættren" "fættre" ; ----
|
||||
cow_N = mk2N "ku" "kuen" ; ----
|
||||
die_V = vaereV dø_V ;
|
||||
dirty_A = regADeg "smudsig" ; ----
|
||||
distance_N3 = mkN3 (regGenN "afstand" utrum) (mkPrep "fra") (mkPrep "til") ;
|
||||
doctor_N = mk2N "læge" "lægen" ;
|
||||
dog_N = mk2N "hund" "hunden" ;
|
||||
door_N = mk2N "dør" "døren" ;
|
||||
drink_V2 = dirV2 drikke_V ;
|
||||
easy_A2V = mkA2V (regA "nem") (mkPrep "for") ; ----
|
||||
eat_V2 = dirV2 (mk2V "spise" "spiste") ;
|
||||
empty_A = mkADeg "tøm" "tømt" "tømme" "tømmere" "tømmest" ; ----
|
||||
enemy_N = mk2N "fjende" "fjenden" ;
|
||||
factory_N = mk2N "fabrik" "fabriken" ;
|
||||
father_N2 = mkN2 ( (mk3N "far" "fadren" "fædre")) (mkPrep "til") ; ----
|
||||
fear_VS = mkVS (regV "frygte") ;
|
||||
find_V2 = dirV2 (irregV "finde" "fand" "fundet") ; ----
|
||||
fish_N = mk2N "fisk" "fisken" ;
|
||||
floor_N = mk2N "gulv" "gulvet" ;
|
||||
forget_V2 = dirV2 (mkV "glemme" "glemmer" "glemmes" "glemte" "glemt" "glem") ; ----
|
||||
fridge_N = mk2N "køleskab" "køleskabet" ;
|
||||
friend_N = mk3N "ven" "vennen" "venner" ; ----
|
||||
fruit_N = mk2N "frugt" "frugten" ;
|
||||
fun_AV = mkAV (mkA "morsom" "morsomt" "morsomme") ; ----
|
||||
garden_N = mk2N "have" "haven" ;
|
||||
girl_N = mk2N "pige" "pigen" ;
|
||||
glove_N = mk2N "handske" "handsken" ;
|
||||
gold_N = mk2N "guld" "guldet" ;
|
||||
good_A = mkADeg "god" "godt" "gode" "bedre" "bedst" ; ----
|
||||
go_V = vaereV gå_V ;
|
||||
green_A = mk3ADeg "grøn" "grønt" "grønne" ;
|
||||
harbour_N = mk2N "havn" "havnen" ;
|
||||
hate_V2 = dirV2 (regV "hade") ;
|
||||
hat_N = mk3N "hat" "hatten" "hatte" ;
|
||||
have_V2 = dirV2 have_V ;
|
||||
hear_V2 = dirV2 (mk2V "høre" "hørte") ;
|
||||
hill_N = mk2N "høj" "højen" ;
|
||||
hope_VS = mkVS (regV "håbe") ;
|
||||
horse_N = mk3N "hest" "hesten" "heste" ;
|
||||
hot_A = regADeg "hed" ;
|
||||
house_N = mk3N "hus" "huset" "huse" ;
|
||||
important_A = regADeg "vigtig" ;
|
||||
industry_N = mk2N "industri" "industrien" ;
|
||||
iron_N = mk2N "jern" "jernet" ;
|
||||
king_N = mk2N "konge" "kongen" ;
|
||||
know_V2 = dirV2 vide_V ;
|
||||
lake_N = mk2N "sø" "søen" ;
|
||||
lamp_N = mk2N "lampe" "lampen" ;
|
||||
learn_V2 = dirV2 (mk2V "lære" "lærte") ;
|
||||
leather_N = mk2N "læder" "lædret" ;
|
||||
leave_V2 = dirV2 forlade_V ;
|
||||
like_V2 = mkV2 holde_V (mkPrep "af") ;
|
||||
listen_V2 = dirV2 (regV "lytte") ;
|
||||
live_V = mk2V "leve" "levde" ;
|
||||
long_A = irregADeg "lang" "længere" "længst" ; ----
|
||||
lose_V2 = dirV2 (regV "tabe") ;
|
||||
love_N = mk2N "kærlighed" "kærligheden" ;
|
||||
love_V2 = dirV2 (regV "elske") ;
|
||||
man_N = mkN "mand" "manden" "mænd" "mændene" ;
|
||||
married_A2 = mkA2 (mk2A "gift" "gift") (mkPrep "med") ;
|
||||
meat_N = mk2N "kød" "kødet" ;
|
||||
milk_N = mk2N "mælk" "mælken" ;
|
||||
moon_N = mk2N "måne" "månen" ;
|
||||
mother_N2 = mkN2 (mkN "moder" "moderen" "mødre" "mødrene") (mkPrep "til") ; ----
|
||||
mountain_N = mk2N "bjerg" "bjerget" ;
|
||||
music_N = mk2N "musik" "musiken" ;
|
||||
narrow_A = regADeg "smal" ;
|
||||
new_A = mkADeg "ny" "nytt" "nye" "nyere" "nyest" ;
|
||||
newspaper_N = mk2N "avis" "avisen" ;
|
||||
oil_N = mk2N "olie" "olien" ;
|
||||
old_A = mkADeg "gammel" "gammelt" "gamle" "ældre" "ældst" ; ----
|
||||
open_V2 = dirV2 (regV "åbne") ;
|
||||
paint_V2A = mkV2A (regV "male") noPrep ;
|
||||
paper_N = mk2N "papir" "papiret" ;
|
||||
paris_PN = mkPN "Paris" neutrum ;
|
||||
peace_N = mk2N "fred" "freden" ;
|
||||
pen_N = mk2N "pen" "penen" ;
|
||||
planet_N = mk2N "planet" "planeten" ;
|
||||
plastic_N = mk2N "plast" "plasten" ;
|
||||
play_V2 = dirV2 (mk2V "spille" "spilte") ;
|
||||
policeman_N = mk2N "politibetjent" "politibetjenten" ; ----
|
||||
priest_N = mk2N "præst" "præsten" ;
|
||||
probable_AS = mkAS (regA "sandsynlig") ;
|
||||
queen_N = mk2N "dronning" "dronningen" ;
|
||||
radio_N = mk2N "radio" "radioen" ;
|
||||
rain_V0 = mkV0 (regV "regne") ;
|
||||
read_V2 = dirV2 (mk2V "læse" "læste") ;
|
||||
red_A = regADeg "rød" ;
|
||||
religion_N = mk2N "religion" "religionen" ;
|
||||
restaurant_N = mk2N "restaurant" "restauranten" ;
|
||||
river_N = mk2N "flod" "floden" ;
|
||||
rock_N = mk2N "sten" "stenen" ;
|
||||
roof_N = mk2N "tag" "taget" ;
|
||||
rubber_N = mk2N "gummi" "gummien" ;
|
||||
run_V = vaereV (regV "løbe") ;
|
||||
say_VS = mkVS sige_V ;
|
||||
school_N = mk2N "skole" "skolen" ;
|
||||
science_N = mk2N "videnskab" "videnskaben" ;
|
||||
sea_N = mk2N "hav" "havet" ;
|
||||
see_V2 = dirV2 se_V ;
|
||||
seek_V2 = mkV2 (mk2V "søge" "søgte") (mkPrep "efter") ;
|
||||
sell_V3 = dirV3 sælge_V (mkPrep "til") ;
|
||||
send_V3 = dirV3 (mk2V "sende" "sendte") (mkPrep "til") ;
|
||||
sheep_N = mk2N "får" "fåret" ;
|
||||
ship_N = mk2N "skib" "skibet" ;
|
||||
shirt_N = mk2N "skjorte" "skjorten" ;
|
||||
shoe_N = mk2N "sko" "skoen" ;
|
||||
shop_N = mk2N "butik" "butiken" ;
|
||||
short_A = regADeg "kort" ;
|
||||
silver_N = mk2N "sølv" "sølvet";
|
||||
sister_N = mk3N "søster" "søstren" "søstrer" ; ----
|
||||
sleep_V = sove_V ;
|
||||
small_A = mkADeg "lille" "lille" "små" "mindre" "mindst" ; ----
|
||||
snake_N = mk2N "slange" "slangen" ;
|
||||
sock_N = mk2N "sok" "sokken" ;
|
||||
speak_V2 = dirV2 (regV "tale") ; ----
|
||||
star_N = mk2N "stjerne" "stjernen" ;
|
||||
steel_N = mk2N "stål" "stålet" ;
|
||||
stone_N = mk2N "sten" "stenen" ;
|
||||
stove_N = mk2N "komfur" "komfuren" ;
|
||||
student_N = mk2N "student" "studenten" ;
|
||||
stupid_A = mk3ADeg "dum" "dumt" "dumme" ;
|
||||
sun_N = mk2N "sol" "solen" ;
|
||||
switch8off_V2 = dirV2 (partV (regV "lukke") "for") ;
|
||||
switch8on_V2 = dirV2 (partV (regV "lukke") "op") ;
|
||||
table_N = mk2N "bord" "bordet" ;
|
||||
talk_V3 = mkV3 (regV "tale") (mkPrep "til") (mkPrep "om") ;
|
||||
teacher_N = mkN "lærer" "læreren" "lærere" "lærerne" ;
|
||||
teach_V2 = dirV2 (mk2V "undervise" "underviste") ;
|
||||
television_N = mk2N "fjernsyn" "fjernsynet" ;
|
||||
thick_A = mk3ADeg "tyk" "tykt" "tykke" ;
|
||||
thin_A = mk2ADeg "tynd" "tyndt" ; ----
|
||||
train_N = mk2N "tog" "toget" ;
|
||||
travel_V = vaereV (mk2V "rejse" "rejste") ;
|
||||
tree_N = mkN "træ" "træet" "træer" "træene" ; ----
|
||||
---- trousers_N = regGenN "trousers" ; ---- pl t !
|
||||
ugly_A = mk3ADeg "grim" "grimt" "grimme" ;
|
||||
understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ;
|
||||
university_N = mk2N "universitet" "universitetet" ;
|
||||
village_N = mk2N "landsby" "landsbyen" ;
|
||||
wait_V2 = mkV2 (regV "vente") (mkPrep "på") ;
|
||||
walk_V = vaereV gå_V ;
|
||||
warm_A = regADeg "varm" ;
|
||||
war_N = mk2N "krig" "krigen" ;
|
||||
watch_V2 = mkV2 se_V (mkPrep "på") ;
|
||||
water_N = mk2N "vand" "vandet" ;
|
||||
white_A = regADeg "hvid" ;
|
||||
window_N = mkN "vindue" "vinduet" "vinduer" "vinduene" ; ---- er?
|
||||
wine_N = mk2N "vin" "vinen" ;
|
||||
win_V2 = dirV2 (irregV "vinde" "vand" "vundet") ;
|
||||
woman_N = mk2N "kvinde" "kvinden" ;
|
||||
wonder_VQ = mkVQ (depV (regV "undre")) ;
|
||||
wood_N = mkN "træ" "træet" "træer" "træene" ; ----
|
||||
write_V2 = dirV2 (irregV "skrive" "skrev" "skrevet") ;
|
||||
yellow_A = regADeg "gul" ;
|
||||
young_A = irregADeg "ung" "yngre" "yngst" ; ----
|
||||
|
||||
do_V2 = dirV2 gøre_V ;
|
||||
now_Adv = mkAdv "nu" ;
|
||||
already_Adv = mkAdv "allerede" ;
|
||||
song_N = mk2N "sang" "sangen" ;
|
||||
add_V3 = mkV3 (regV "tilføje") noPrep (mkPrep "til") ; ----
|
||||
number_N = mk2N "nummer" "numret" ; ----
|
||||
put_V2 = dirV2 sætte_V ;
|
||||
stop_V = vaereV (regV "standse") ;
|
||||
jump_V = regV "hoppe" ;
|
||||
|
||||
left_Ord = {s = "venstre" ; isDet = True} ;
|
||||
right_Ord = {s = "højre" ; isDet = True} ;
|
||||
far_Adv = mkAdv "fjern" ;
|
||||
correct_A = regA "rigtig" ;
|
||||
dry_A = mk3ADeg "tør" "tørt" "tørre" ;
|
||||
dull_A = regA "sløv" ;
|
||||
full_A = regA "fuld" ;
|
||||
heavy_A = irregADeg "tung" "tyngre" "tyngst" ;
|
||||
near_A = mkADeg "nære" "nære" "nære" "nærmere" "nærmest" ;
|
||||
rotten_A = mk3ADeg "rådden" "råddent" "rådne" ; ----
|
||||
round_A = regA "rund" ;
|
||||
sharp_A = regA "skarp" ;
|
||||
smooth_A = regA "jævn" ;
|
||||
straight_A = mk3ADeg "ret" "rett" "rette" ; ----
|
||||
wet_A = regA "våd" ;
|
||||
wide_A = regA "bred" ;
|
||||
animal_N = mk2N "dyr" "dyret" ;
|
||||
ashes_N = mk2N "aske" "asken" ;
|
||||
back_N = mk2N "ryg" "ryggen" ; ----
|
||||
bark_N = mk2N "bark" "barken" ;
|
||||
belly_N = mk2N "mave" "maven" ;
|
||||
blood_N = mk2N "blod" "blodet" ;
|
||||
bone_N = mk2N "ben" "benet" ;
|
||||
breast_N = mk2N "bryst" "brystet" ;
|
||||
cloud_N = mk2N "sky" "skyen" ;
|
||||
day_N = mk3N "dag" "dagen" "dage" ;
|
||||
dust_N = mk2N "støv" "støvet" ;
|
||||
ear_N = mk3N "øre" "øret" "ører" ;
|
||||
earth_N = mk2N "jord" "jorden" ;
|
||||
egg_N = mk2N "æg" "æget" ;
|
||||
eye_N = mk3N "øje" "øjet" "øjne" ;
|
||||
fat_N = mk2N "fedt" "fedtet" ;
|
||||
feather_N = mk2N "fjer" "fjeren" ;
|
||||
fingernail_N = mk2N "negl" "neglen" ;
|
||||
fire_N = mk2N "ild" "ilden" ;
|
||||
flower_N = mk2N "blomst" "blomsten" ;
|
||||
fog_N = mk2N "tåge" "tågen" ;
|
||||
foot_N = mk2N "fod" "føder" ; ----
|
||||
forest_N = mk2N "skov" "skoven" ;
|
||||
grass_N = mk2N "græs" "græset" ;
|
||||
guts_N = mk2N "tarm" "tarmen" ; ---- indvolde
|
||||
hair_N = mk2N "hår" "håret" ;
|
||||
hand_N = mk2N "hånd" "hånden" ;
|
||||
head_N = mk2N "hoved" "hovedet" ;
|
||||
heart_N = mk3N "hjerte" "hjertet" "hjerter" ;
|
||||
horn_N = mk2N "horn" "hornet" ;
|
||||
husband_N = mk2N "ægtefælle" "ægtefællen" ; ----
|
||||
ice_N = mk2N "is" "isen" ;
|
||||
knee_N = mkN "knæ" "knæt" "knær" "knæne" ; ----
|
||||
leaf_N = mk2N "løv" "løvet" ;
|
||||
leg_N = mk2N "ben" "benet" ;
|
||||
liver_N = mkN "lever" "leveren" "levrer" "levrene" ; ----
|
||||
louse_N = mk3N "lus" "lusen" "lus" ;
|
||||
mouth_N = mk2N "mund" "munden" ;
|
||||
name_N = mk2N "navn" "navnet" ;
|
||||
neck_N = mk2N "hals" "halsen" ;
|
||||
night_N = mk3N "nat" "natten" "nætter" ; ----
|
||||
nose_N = mk2N "næse" "næsen" ;
|
||||
person_N = mk2N "person" "personen" ;
|
||||
rain_N = mk2N "regn" "regnet" ;
|
||||
road_N = mk2N "vej" "vejen" ;
|
||||
root_N = mk3N "rod" "roden" "røder" ; ----
|
||||
rope_N = mk2N "reb" "rebet" ;
|
||||
salt_N = mk2N "salt" "saltet" ;
|
||||
sand_N = mk2N "sand" "sanden" ;
|
||||
seed_N = mk2N "frø" "frøet" ;
|
||||
skin_N = mk2N "skind" "skindet" ;
|
||||
sky_N = mk3N "himmel" "himlen" "himler" ; ----
|
||||
smoke_N = mk2N "røg" "røgen" ;
|
||||
snow_N = mk2N "snø" "snøen" ;
|
||||
stick_N = mk2N "pind" "pinden" ;
|
||||
tail_N = mk2N "hale" "halen" ;
|
||||
tongue_N = mk2N "tunge" "tungen" ;
|
||||
tooth_N = mkN "tand" "tanden" "tænder" "tændene" ; ----
|
||||
wife_N = mk2N "kone" "konen" ;
|
||||
wind_N = mk2N "vind" "vinden" ;
|
||||
wing_N = mk2N "vinge" "vingen" ;
|
||||
worm_N = mk2N "orm" "ormen" ;
|
||||
year_N = mk2N "år" "året" ;
|
||||
bite_V2 = dirV2 bide_V ;
|
||||
blow_V = mk2V "blæse" "blæste" ;
|
||||
burn_V = brænde_V ;
|
||||
count_V2 = dirV2 tælle_V ;
|
||||
cut_V2 = dirV2 (skære_V) ;
|
||||
dig_V = mk2V "grave" "gravde" ;
|
||||
fall_V = vaereV falde_V ;
|
||||
fear_V2 = dirV2 (regV "frygte") ;
|
||||
fight_V2 = dirV2 (regV "kæmpe") ;
|
||||
float_V = flyde_V ;
|
||||
flow_V = regV "strømme" ;
|
||||
fly_V = vaereV flyve_V ;
|
||||
freeze_V = fryse_V ;
|
||||
give_V3 = dirdirV3 give_V ;
|
||||
hit_V2 = dirV2 (slå_V) ;
|
||||
hold_V2 = dirV2 (holde_V) ;
|
||||
hunt_V2 = dirV2 (regV "jage") ;
|
||||
kill_V2 = dirV2 (regV "dræbe") ;
|
||||
laugh_V = le_V ;
|
||||
lie_V = ligge_V ;
|
||||
play_V = regV "spille" ;
|
||||
pull_V2 = dirV2 (regV "trække") ;
|
||||
push_V2 = dirV2 (regV "skubbe") ;
|
||||
rub_V2 = dirV2 (gnide_V) ;
|
||||
scratch_V2 = dirV2 (regV "kradse") ;
|
||||
sew_V = mk2V "sy" "sydde" ;
|
||||
sing_V = synge_V ;
|
||||
sit_V = sidde_V ;
|
||||
smell_V = regV "lugte" ;
|
||||
spit_V = regV "spytte" ;
|
||||
split_V2 = dirV2 (regV "splitte") ; ----
|
||||
squeeze_V2 = dirV2 (regV "presse") ;
|
||||
stab_V2 = dirV2 (stikke_V) ;
|
||||
stand_V = vaereV stå_V ;
|
||||
suck_V2 = dirV2 (regV "sutte") ; ----
|
||||
swell_V = regV "svulme" ;
|
||||
swim_V = regV "svømme" ;
|
||||
think_V = mk2V "tænke" "tænkte" ; ----
|
||||
throw_V2 = dirV2 (regV "kaste") ;
|
||||
tie_V2 = dirV2 binde_V ;
|
||||
turn_V = regV "dreje" ;
|
||||
vomit_V = partV (regV "kaste") "op" ;
|
||||
wash_V2 = dirV2 (regV "vaske") ;
|
||||
wipe_V2 = dirV2 (regV "viske") ;
|
||||
breathe_V = regV "ånde" ;
|
||||
|
||||
grammar_N = regN "grammatik" ;
|
||||
language_N = mk2N "sprog" "sproget" ;
|
||||
rule_N = mkN "regel" "regeln" "regler" "reglerne" ;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete MathDan of Math = CategoriesDan **
|
||||
MathScand with (SyntaxScand=SyntaxDan) ;
|
||||
concrete MathDan of Math = CatDan ** MathScand with
|
||||
(ResScand = ResDan) ;
|
||||
|
||||
@@ -8,30 +8,24 @@
|
||||
--
|
||||
-- We use the parameter types and word classes defined for morphology.
|
||||
|
||||
resource MorphoDan = open Prelude, TypesDan in {
|
||||
resource MorphoDan = CommonScand, ResDan ** open Prelude, Predef in {
|
||||
|
||||
-- Danish grammar source: http://users.cybercity.dk/~nmb3879/danish.html
|
||||
oper
|
||||
|
||||
-- type synonyms
|
||||
|
||||
Subst : Type = {s : Number => Species => Case => Str} ;
|
||||
Adj = Adjective ;
|
||||
|
||||
-- nouns
|
||||
|
||||
oper
|
||||
mkSubstantive : (_,_,_,_ : Str) -> {s : SubstForm => Str} =
|
||||
\dreng, drengen, drenge, drengene -> {s = table {
|
||||
SF Sg Indef c => mkCase dreng ! c ;
|
||||
SF Sg Def c => mkCase drengen ! c ;
|
||||
SF Pl Indef c => mkCase drenge ! c ;
|
||||
SF Pl Def c => mkCase drengene ! c
|
||||
}
|
||||
} ;
|
||||
mkSubstantive : (_,_,_,_ : Str) -> Subst =
|
||||
\dreng, drengen, drenger, drengene ->
|
||||
{s = nounForms dreng drengen drenger drengene} ;
|
||||
|
||||
mkCase : Str -> Case => Str = \bil -> table {
|
||||
Nom => bil ;
|
||||
Gen => bil + "s" --- but: hus --> hus
|
||||
} ;
|
||||
|
||||
extNGen : Str -> NounGender = \s -> case last s of {
|
||||
"n" => NUtr ;
|
||||
_ => NNeutr
|
||||
extNGen : Str -> Gender = \s -> case last s of {
|
||||
"n" => Utr ;
|
||||
_ => Neutr
|
||||
} ;
|
||||
|
||||
nDreng : Str -> Subst = \dreng ->
|
||||
@@ -52,40 +46,41 @@ oper
|
||||
|
||||
-- adjectives
|
||||
|
||||
mkAdjective : (_,_,_,_,_ : Str) -> Adj =
|
||||
mkAdject : (_,_,_,_,_ : Str) -> Adj =
|
||||
\stor,stort,store,storre,storst -> {s = table {
|
||||
AF (Posit (Strong (ASg Utr))) c => mkCase stor ! c ;
|
||||
AF (Posit (Strong (ASg Neutr))) c => mkCase stort ! c ;
|
||||
AF (Posit _) c => mkCase store ! c ;
|
||||
AF Compar c => mkCase storre ! c ;
|
||||
AF (Super SupStrong) c => mkCase storst ! c ;
|
||||
AF (Super SupWeak) c => mkCase (storst + "e") ! c
|
||||
AF (APosit (Strong SgUtr )) c => mkCase c stor ;
|
||||
AF (APosit (Strong SgNeutr)) c => mkCase c stort ;
|
||||
AF (APosit _) c => mkCase c store ;
|
||||
AF ACompar c => mkCase c storre ;
|
||||
AF (ASuperl SupStrong) c => mkCase c storst ;
|
||||
AF (ASuperl SupWeak) c => mkCase c (storst + "e")
|
||||
}
|
||||
} ;
|
||||
|
||||
aRod : Str -> Adj = \rod ->
|
||||
mkAdjective rod (rod + "t") (rod + "e") (rod + "ere") (rod + "est") ;
|
||||
mkAdject rod (rod + "t") (rod + "e") (rod + "ere") (rod + "est") ;
|
||||
|
||||
aAbstrakt : Str -> Adj = \abstrakt ->
|
||||
mkAdjective abstrakt abstrakt (abstrakt + "e") (abstrakt + "ere") (abstrakt + "est") ;
|
||||
mkAdject abstrakt abstrakt (abstrakt + "e") (abstrakt + "ere") (abstrakt + "est") ;
|
||||
|
||||
aRask : Str -> Adj = \rask ->
|
||||
mkAdjective rask rask (rask + "e") (rask + "ere") (rask + "est") ;
|
||||
mkAdject rask rask (rask + "e") (rask + "ere") (rask + "est") ;
|
||||
|
||||
extractPositive : Adj -> {s : AdjFormPos => Case => Str} = \adj ->
|
||||
{s = \\a,c => adj.s ! (AF (Posit a) c)} ;
|
||||
|
||||
-- verbs
|
||||
|
||||
mkVerb : (_,_,_,_,_,_ : Str) -> Verbum =
|
||||
Verbum : Type = {s : VForm => Str} ;
|
||||
|
||||
mkVerb6 : (_,_,_,_,_,_ : Str) -> Verbum =
|
||||
\spise,spiser,spises,spiste,spist,spis -> {s = table {
|
||||
VI (Inf v) => mkVoice v spise ;
|
||||
VF (Pres Act) => spiser ;
|
||||
VF (Pres Pass) => spises ;
|
||||
VF (Pret v) => mkVoice v spiste ;
|
||||
VI (Supin v) => mkVoice v spist ;
|
||||
VI (PtPret _ c) => mkCase spist ! c ; ---- GenNum
|
||||
VF (Imper v) => mkVoice v spis
|
||||
VI (VInfin v) => mkVoice v spise ;
|
||||
VF (VPres Act) => spiser ;
|
||||
VF (VPres Pass) => spises ;
|
||||
VF (VPret v) => mkVoice v spiste ; --# notpresent
|
||||
VI (VSupin v) => mkVoice v spist ; --# notpresent
|
||||
VI (VPtPret (Strong (SgUtr | SgNeutr)) c) => mkCase c spist ;
|
||||
VI (VPtPret _ c) => mkCase c (spist + "e") ;
|
||||
VF (VImper v) => mkVoice v spis
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -98,7 +93,7 @@ oper
|
||||
_ => drikke + "r"
|
||||
}
|
||||
in
|
||||
mkVerb drikke drikker (drikke + "s") drakk drukket drikk ;
|
||||
mkVerb6 drikke drikker (drikke + "s") drakk drukket (mkImper drikk) ;
|
||||
|
||||
regVerb : Str -> Str -> Verbum = \spise, spiste ->
|
||||
let
|
||||
@@ -114,153 +109,56 @@ oper
|
||||
_ => vHusk spis
|
||||
} ;
|
||||
|
||||
mkVoice : Voice -> Str -> Str = \v,s -> case v of {
|
||||
Act => s ;
|
||||
Pass => s + case last s of {
|
||||
"s" => "es" ;
|
||||
_ => "s"
|
||||
}
|
||||
} ;
|
||||
|
||||
vHusk : Str -> Verbum = \husk ->
|
||||
mkVerb (husk + "e") (husk + "er") (husk + "es") (husk + "ede") (husk + "et") husk ;
|
||||
mkVerb6 (husk + "e") (husk + "er") (husk + "es") (husk + "ede") (husk + "et")
|
||||
(mkImper husk) ;
|
||||
|
||||
vSpis : Str -> Verbum = \spis ->
|
||||
mkVerb (spis + "e") (spis + "er") (spis + "es") (spis + "te") (spis + "t") spis ;
|
||||
mkVerb6 (spis + "e") (spis + "er") (spis + "es") (spis + "te") (spis + "t")
|
||||
(mkImper spis) ;
|
||||
|
||||
vBo : Str -> Verbum = \bo ->
|
||||
mkVerb bo (bo + "r") (bo + "es") (bo + "ede") (bo + "et") bo ;
|
||||
mkVerb6 bo (bo + "r") (bo + "es") (bo + "ede") (bo + "et") (mkImper bo) ;
|
||||
|
||||
-- pronouns
|
||||
-- Remove consonant duplication: "passe - pas"
|
||||
|
||||
oper jag_32 : ProPN =
|
||||
{s = table {
|
||||
PNom => "jeg" ;
|
||||
PAcc => "mig" ;
|
||||
PGen (ASg Utr) => "min" ;
|
||||
PGen (ASg Neutr) => "mit" ;
|
||||
PGen APl => "mine"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P1
|
||||
} ;
|
||||
mkImper : Str -> Str = \s ->
|
||||
if_then_Str (pbool2bool (Predef.eqStr (last s) (last (init s)))) (init s) s ;
|
||||
|
||||
oper du_33 : ProPN =
|
||||
{s = table {
|
||||
PNom => "du" ;
|
||||
PAcc => "dig" ;
|
||||
PGen (ASg Utr) => "din" ;
|
||||
PGen (ASg Neutr) => "dit" ;
|
||||
PGen APl => "dine"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P2
|
||||
} ;
|
||||
|
||||
oper han_34 : ProPN =
|
||||
{s = table {
|
||||
PNom => "han" ;
|
||||
PAcc => "ham" ;
|
||||
PGen (ASg Utr) => "hans" ;
|
||||
PGen (ASg Neutr) => "hans" ;
|
||||
PGen APl => "hans"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P3
|
||||
} ;
|
||||
oper hon_35 : ProPN =
|
||||
{s = table {
|
||||
PNom => "hun" ;
|
||||
PAcc => "hende" ;
|
||||
PGen (ASg Utr) => "hendes" ;
|
||||
PGen (ASg Neutr) => "hendes" ;
|
||||
PGen APl => "hendes"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P3
|
||||
} ;
|
||||
|
||||
oper vi_36 : ProPN =
|
||||
{s = table {
|
||||
PNom => "vi" ;
|
||||
PAcc => "os" ;
|
||||
PGen _ => "vores"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Pl ;
|
||||
h3 = P1
|
||||
} ;
|
||||
|
||||
oper ni_37 : ProPN =
|
||||
{s = table {
|
||||
PNom => "i" ;
|
||||
PAcc => "jer" ;
|
||||
PGen _ => "jeres"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Pl ;
|
||||
h3 = P2
|
||||
} ;
|
||||
|
||||
oper de_38 : ProPN =
|
||||
{s = table {
|
||||
PNom => "de" ;
|
||||
PAcc => "dem" ;
|
||||
PGen _ => "deres"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Pl ;
|
||||
h3 = P3
|
||||
} ;
|
||||
|
||||
oper De_38 : ProPN =
|
||||
{s = table {
|
||||
PNom => "De" ;
|
||||
PAcc => "Dem" ;
|
||||
PGen _ => "Deres"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P2
|
||||
} ;
|
||||
|
||||
oper den_39 : ProPN =
|
||||
{s = table {
|
||||
PNom => "den" ;
|
||||
PAcc => "den" ;
|
||||
PGen _ => "dens"
|
||||
} ;
|
||||
h1 = Utr ;
|
||||
h2 = Sg ;
|
||||
h3 = P3
|
||||
} ;
|
||||
|
||||
oper det_40 : ProPN =
|
||||
{s = table {
|
||||
PNom => "det" ;
|
||||
PAcc => "det" ;
|
||||
PGen _ => "dets"
|
||||
} ;
|
||||
h1 = Neutr ;
|
||||
h2 = Sg ;
|
||||
h3 = P3
|
||||
} ;
|
||||
|
||||
|
||||
-- from Numerals
|
||||
-- For $Numeral$.
|
||||
|
||||
param DForm = ental | ton | tiotal ;
|
||||
|
||||
oper mkTal : Str -> Str -> Str -> {s : DForm => Str} =
|
||||
\to, tolv, tyve ->
|
||||
{s = table {ental => to ; ton => tolv ; tiotal => tyve}} ;
|
||||
oper regTal : Str -> {s : DForm => Str} = \fem -> mkTal fem (fem + "ton") (fem + "tio") ;
|
||||
numPl : Str -> {s : Gender => Str ; n : Number} = \n ->
|
||||
{s = \\_ => n ; n = Pl} ;
|
||||
oper
|
||||
LinDigit = {s : DForm => CardOrd => Str} ;
|
||||
|
||||
cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje ->
|
||||
table {
|
||||
NCard _ => tre ;
|
||||
NOrd a => tredje ---- a
|
||||
} ;
|
||||
|
||||
cardReg : Str -> CardOrd => Str = \syv ->
|
||||
cardOrd syv (syv + case last syv of {
|
||||
"n" => "de" ;
|
||||
"e" => "nde" ;
|
||||
_ => "ende"
|
||||
}) ;
|
||||
|
||||
|
||||
mkTal : (x1,_,_,_,x5 : Str) -> LinDigit =
|
||||
\två, tolv, tjugo, andra, tyvende ->
|
||||
{s = table {
|
||||
ental => cardOrd två andra ;
|
||||
ton => cardReg tolv ;
|
||||
tiotal => cardOrd tjugo tyvende
|
||||
}
|
||||
} ;
|
||||
|
||||
numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n ->
|
||||
{s = n ; n = Pl} ;
|
||||
|
||||
invNum : CardOrd = NCard Neutr ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
2
lib/resource/danish/NounDan.gf
Normal file
2
lib/resource/danish/NounDan.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete NounDan of Noun = CatDan ** NounScand with
|
||||
(ResScand = ResDan) ;
|
||||
55
lib/resource/danish/NumeralDan.gf
Normal file
55
lib/resource/danish/NumeralDan.gf
Normal file
@@ -0,0 +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 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 => "et" ; _ => "en"} ;
|
||||
_ => "første"
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ;
|
||||
pot110 = numPl (cardReg "ti") ;
|
||||
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 => e.s ! ental ! invNum ++ "og" ++ d.s ! tiotal ! g ; n = Pl} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = numPl (\\_ => d.s ! ental ! invNum ++ "hundrede") ;
|
||||
pot2plus d e =
|
||||
{s = \\g => d.s ! ental ! invNum ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ;
|
||||
pot2as3 n = n ;
|
||||
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} ;
|
||||
-}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user