fixed decodeUTF8 for pgf; removed old resources from darcs

This commit is contained in:
aarne
2008-06-26 19:41:25 +00:00
parent 544fc47489
commit 9d909f32cf
1845 changed files with 4 additions and 468570 deletions

159
lib/resource/Make.hs Normal file
View File

@@ -0,0 +1,159 @@
module Main where
import System
-- Make commands for compiling and testing resource grammars.
-- usage: runghc Make ((present? OPT?) | (clone FILE))? LANGS?
-- where
-- - OPT = (lang | api | math | pgf | test | demo | clean)
-- - LANGS has the form e.g. langs=Eng,Fin,Rus
-- - clone with a flag file=FILENAME clones the file to the specified languages,
-- by replacing the 3-letter language name of the original in both the filename and the body
-- with each name in the list (default: all languages)
-- With no argument, lang and api are done, in this order.
-- See 'make' below for what is done by which command.
-- the languages have long directory names and short ISO codes (3 letters)
-- we also give the decodings for postprocessing linearizations, as long as grammars
-- don't support all flags needed; they are used in tests
langsCoding = [
(("arabic", "Ara"),""),
(("bulgarian","Bul"),""),
(("catalan", "Cat"),""),
(("danish", "Dan"),""),
(("english", "Eng"),""),
(("finnish", "Fin"),""),
(("french", "Fre"),""),
(("hindi", "Hin"),"to_devanagari"),
(("german", "Ger"),""),
(("interlingua","Ina"),""),
(("italian", "Ita"),""),
(("norwegian","Nor"),""),
(("russian", "Rus"),""),
(("spanish", "Spa"),""),
(("swedish", "Swe"),""),
(("thai", "Tha"),"to_thai")
]
langs = map fst langsCoding
-- languagues for which to compile Lang
langsLang = langs `except` ["Ara"]
-- languages for which to compile Try
langsAPI = langsLang `except` ["Bul","Cat","Hin","Ina","Rus","Tha"]
-- languages for which to compile Mathematical
langsMath = langsAPI
-- languages for which to run treebank test
langsTest = langsLang `except` ["Bul","Cat","Hin","Rus","Spa","Tha"]
-- languages for which to run demo test
langsDemo = langsLang `except` ["Hin","Ina","Tha"]
-- languages for which langs.pgf is built
langsPGF = langsTest `only` ["Eng","Fre","Swe"]
treebankExx = "exx-resource.gft"
treebankResults = "exx-resource.gftb"
main = do
xx <- getArgs
make xx
make xx = do
let ifx opt act = if null xx || elem opt xx then act >> return () else return ()
let ifxx opt act = if elem opt xx then act >> return () else return ()
let pres = elem "present" xx
let dir = if pres then "../present" else "../alltenses"
let optl ls = maybe ls id $ getOptLangs xx
ifx "lang" $ do
mapM_ (gfc pres [] . lang) (optl langsLang)
system $ "cp */*.gfo " ++ dir
ifx "api" $ do
mapM_ (gfc pres presApiPath . try) (optl langsAPI)
system $ "cp */*.gfo " ++ dir
ifx "math" $ do
mapM_ (gfc False [] . math) (optl langsMath)
system $ "cp mathematical/*.gfo ../mathematical"
mapM_ (gfc False [] . symbolic) (optl langsMath)
system $ "cp mathematical/Symbolic*.gfo ../mathematical"
ifxx "pgf" $ do
system $ "gfc -s --make --name=langs --parser=off --output-dir=" ++ dir ++ " " ++
unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- optl langsPGF] ++
" +RTS -K100M"
ifxx "test" $ do
let ls = optl langsTest
gf (treeb "Lang" ls) $ unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- ls]
ifxx "demo" $ do
let ls = optl langsDemo
gf (demos "Demo" ls) $ unwords ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls]
ifxx "clean" $ do
system "rm */*.gfo ../alltenses/*.gfo ../present/*.gfo"
ifxx "clone" $ do
let (pref,lang) = case getLangName xx of
Just pl -> pl
_ -> error "expected flag option file=ppppppLLL.gf"
s <- readFile (pref ++ lang ++ ".gf")
mapM_ (\la -> writeFile (pref ++ la ++ ".gf") (replaceLang lang la s)) (map snd (optl langs))
return ()
gfc pres ppath file = do
let preproc = if pres then " -preproc=./mkPresent " else ""
let path = if pres then ppath else ""
putStrLn $ "compiling " ++ file
system $ "gfc -s -src " ++ preproc ++ path ++ file
gf comm file = do
putStrLn $ "reading " ++ file
system $ "echo \"" ++ comm ++ "\" | gf3 -s " ++ file
treeb abstr ls = "rf -lines -tree -file=" ++ treebankExx ++
" | l -treebank " ++ unlexer abstr ls ++ " | wf -file=" ++ treebankResults
demos abstr ls = "gr -number=100 | l -treebank " ++ unlexer abstr ls ++
" | ps -to_html | wf -file=resdemo.html"
lang (lla,la) = lla ++ "/Lang" ++ la ++ ".gf"
try (lla,la) = "api/Try" ++ la ++ ".gf"
math (lla,la) = "mathematical/Mathematical" ++ la ++ ".gf"
symbolic (lla,la) = "mathematical/Symbolic" ++ la ++ ".gf"
except ls es = filter (flip notElem es . snd) ls
only ls es = filter (flip elem es . snd) ls
presApiPath = " -path=api:present "
-- list of languages overriding the definitions above
getOptLangs args = case [ls | a <- args, let (f,ls) = splitAt 6 a, f=="langs="] of
ls:_ -> return $ findLangs $ seps ls
_ -> Nothing
where
seps = words . map (\c -> if c==',' then ' ' else c)
findLangs ls = [lang | lang@(_,la) <- langs, elem la ls]
-- the file name has the form p....pLLL.gf, i.e. 3-letter lang name, suffix .gf
getLangName args = case [ls | a <- args, let (f,ls) = splitAt 5 a, f=="file="] of
fi:_ -> let (nal,ferp) = splitAt 3 (drop 3 (reverse fi)) in return (reverse ferp,reverse nal)
_ -> Nothing
replaceLang s1 s2 = repl where
repl s = case s of
c:cs -> case splitAt lgs s of
(pre,rest) | pre == s1 -> s2 ++ repl rest
_ -> c : repl cs
_ -> s
lgs = 3 -- length s1
unlexer abstr ls =
"-unlexer=\\\"" ++ unwords
[abstr ++ la ++ "=" ++ unl |
lla@(_,la) <- ls, let unl = unlex lla, not (null unl)] ++
"\\\""
where
unlex lla = maybe "" id $ lookup lla langsCoding

34
lib/resource/Makefile Normal file
View File

@@ -0,0 +1,34 @@
RUNGHC=runghc
RUNMAKE=$(RUNGHC) Make.hs
all: link present alltenses math
present:
$(RUNMAKE) present lang
$(RUNMAKE) present api
alltenses:
$(RUNMAKE) lang
$(RUNMAKE) api
lang:
$(RUNMAKE) lang
api:
$(RUNMAKE) api
math:
$(RUNMAKE) math
test:
$(RUNMAKE) test
synopsis:
cd doc ; $(RUNGHC) MkSynopsis ; cd ..
link:
chmod a+x mkPresent
clean:
$(RUNMAKE) clean

View 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 I
ComplA2 : A2 -> NP -> AP ; -- married to her
ReflA2 : A2 -> AP ; -- married to itself
UseA2 : A2 -> A ; -- married
-- Sentence and question complements defined for all adjectival
-- phrases, although the semantics is only clear for some adjectives.
SentAP : AP -> SC -> AP ; -- good that she is here
-- An adjectival phrase can be modified by an *adadjective*, such as "very".
AdAP : AdA -> AP -> AP ; -- very warm
-- The formation of adverbs from adjective (e.g. "quickly") is covered
-- in [Adverb Adverb.html].
}

View File

@@ -0,0 +1,32 @@
--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 ; -- warmly
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 warmly than John
ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly 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 she sleeps
-- Comparison adverbs also work as numeral adverbs.
AdnCAdv : CAdv -> AdN ; -- less (than five)
}

View File

@@ -0,0 +1,63 @@
--1 Obsolete constructs included for backward-compatibility
abstract Backward = Cat ** {
-- from Cat
cat
Slash ;
fun
-- from Verb 19/4/2008
ComplV2 : V2 -> NP -> VP ; -- use it
ComplV3 : V3 -> NP -> NP -> VP ; -- send a message to her
ComplV2V : V2V -> NP -> VP -> VP ; -- cause it to burn
ComplV2S : V2S -> NP -> S -> VP ; -- tell me that it rains
ComplV2Q : V2Q -> NP -> QS -> VP ; -- ask me who came
ComplV2A : V2A -> NP -> AP -> VP ; -- paint it red
ReflV2 : V2 -> VP ; -- use itself
UseVQ : VQ -> V2 ; -- ask (a question)
UseVS : VS -> V2 ; -- know (a secret)
-- from Sentence 19/4/2008
SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees
SlashVVV2 : NP -> VV -> V2 -> Slash; -- (whom) he wants to see
-- from Noun 19/4/2008
NumInt : Int -> Num ; -- 51
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
NoOrd : Ord ;
-- 20/4
DetSg : Quant -> Ord -> Det ; -- the best man
DetPl : Quant -> Num -> Ord -> Det ; -- the five best men
NoNum : Num ;
-- 22/4
DefArt : Quant ; -- the (house), the (houses)
IndefArt : Quant ; -- a (house), (houses)
MassDet : Quant ; -- (beer)
-- from Structural 19/4/2008
that_NP : NP ;
these_NP : NP ;
this_NP : NP ;
those_NP : NP ;
whichPl_IDet : IDet ;
whichSg_IDet : IDet ;
-- from Adverb
AdvSC : SC -> Adv ; -- that he arrives ---- REMOVE?
}

View File

@@ -0,0 +1,134 @@
--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"
ClSlash;-- clause missing NP (S/NP in GPSG) e.g. "she looks at"
SSlash ;-- sentence missing NP e.g. "she has looked 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. "how many"
IQuant; -- interrogative quantifier 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"
VPSlash ; -- verb phrase missing complement e.g. "give to John"
--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"
Quant ; -- quantifier ('nucleus' of Det) e.g. "this/these"
Art ; -- article e.g. "the"
Num ; -- number determining element e.g. "seven"
Card ; -- cardinal number e.g. "seven"
Ord ; -- ordinal number (used in Det) e.g. "seventh"
--2 Numerals
-- Constructed in [Numeral Numeral.html].
Numeral ; -- cardinal or ordinal in words e.g. "five/fifth"
Digits ; -- cardinal or ordinal in digits e.g. "1,000/1,000th"
--2 Structural words
-- Constructed in [Structural Structural.html].
Conj ; -- conjunction e.g. "and"
---b DConj ; -- distributed conjunction 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. "wonder"
VA ; -- adjective-complement verb e.g. "look"
V2V ; -- verb with NP and V complement e.g. "cause"
V2S ; -- verb with NP and S complement e.g. "tell"
V2Q ; -- verb with NP and Q complement e.g. "ask"
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"
-- DEPRECATED: QuantSg, QuantPl
--- QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"
--- QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many"
}

View 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 conjunction 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 e.g. present, past, future
Pol ; -- polarity e.g. positive, negative
Ant ; -- anteriority e.g. 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
}

View 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 ; -- "he walks and she runs"
ConjAP : Conj -> [AP] -> AP ; -- "cold and warm"
ConjNP : Conj -> [NP] -> NP ; -- "she or we"
ConjAdv : Conj -> [Adv] -> Adv ; -- "here or there"
---b DConjS : DConj -> [S] -> S ; -- "either he walks or she runs"
---b DConjAP : DConj -> [AP] -> AP ; -- "both warm and cold"
---b DConjNP : DConj -> [NP] -> NP ; -- "either he or she"
---b DConjAdv : DConj -> [Adv] -> Adv; -- "both here and there"
--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].

View 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 -> ClSlash -> RCl ; -- that he lives in
EmptyRelSlash : RP -> ClSlash -> RCl ; -- he lives in
StrandQuestSlash : IP -> ClSlash -> 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 ;
}

View File

@@ -0,0 +1,22 @@
--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 ;

View 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 is hot
GenericCl : VP -> Cl ; -- one sleeps
CleftNP : NP -> RS -> Cl ; -- it is I who did it
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
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
}

View File

@@ -0,0 +1,13 @@
--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 =
Grammar,
Lexicon
** {
flags startcat=Phr ;
} ;

View File

@@ -0,0 +1,356 @@
abstract Lexicon = Cat ** {
fun
add_V3 : V3 ;
airplane_N : N ;
already_Adv : Adv ;
animal_N : N ;
answer_V2S : V2S ;
apartment_N : N ;
apple_N : N ;
art_N : N ;
ashes_N : N ;
ask_V2Q : V2Q ;
baby_N : N ;
back_N : N ;
bad_A : A ;
bank_N : N ;
bark_N : N ;
beautiful_A : A ;
become_VA : VA ;
beer_N : N ;
beg_V2V : V2V ;
belly_N : N ;
big_A : A ;
bike_N : N ;
bird_N : N ;
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 ;
breast_N : N ;
breathe_V : V ;
broad_A : A ;
brother_N2 : N2 ;
brown_A : A ;
burn_V : V ;
butter_N : N ;
buy_V2 : V2 ;
camera_N : N ;
cap_N : N ;
car_N : N ;
carpet_N : N ;
cat_N : N ;
ceiling_N : N ;
chair_N : N ;
cheese_N : N ;
child_N : N ;
church_N : N ;
city_N : N ;
clean_A : A ;
clever_A : A ;
close_V2 : V2 ;
cloud_N : N ;
coat_N : N ;
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 ;
dig_V : V ;
dirty_A : A ;
distance_N3 : N3 ;
doctor_N : N ;
dog_N : N ;
door_N : N ;
do_V2 : V2 ;
drink_V2 : V2 ;
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 ;
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 ;
full_A : A ;
fun
fun_AV : A ;
garden_N : N ;
girl_N : N ;
give_V3 : V3 ;
glove_N : N ;
gold_N : N ;
good_A : A ;
go_V : V ;
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_A : A ;
house_N : N ;
hunt_V2 : V2 ;
husband_N : N ;
ice_N : N ;
important_A : A ;
industry_N : N ;
iron_N : N ;
john_PN : PN ;
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_A : A ;
lose_V2 : V2 ;
louse_N : N ;
love_N : N ;
love_V2 : V2 ;
man_N : N ;
married_A2 : A2 ;
meat_N : N ;
milk_N : N ;
moon_N : N ;
mother_N2 : N2 ;
mountain_N : N ;
mouth_N : N ;
music_N : N ;
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_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 : A ;
pull_V2 : V2 ;
push_V2 : V2 ;
put_V2 : V2 ;
queen_N : N ;
question_N : N ;
radio_N : N ;
rain_N : N ;
rain_V0 : V ;
read_V2 : V2 ;
ready_A : A ;
reason_N : N ;
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_A : A ;
silver_N : N ;
sing_V : V ;
sister_N : N ;
sit_V : V ;
skin_N : N ;
sky_N : N ;
sleep_V : V ;
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_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_A : A ;
thin_A : A ;
think_V : V ;
throw_V2 : V2 ;
tie_V2 : V2 ;
today_Adv : Adv ;
tongue_N : N ;
tooth_N : N ;
train_N : N ;
travel_V : V ;
tree_N : N ;
turn_V : V ;
ugly_A : A ;
uncertain_A : A ;
understand_V2 : V2 ;
university_N : N ;
village_N : N ;
vomit_V : V ;
wait_V2 : V2 ;
walk_V : V ;
warm_A : A ;
war_N : N ;
wash_V2 : V2 ;
watch_V2 : V2 ;
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 ;
year_N : N ;
yellow_A : A ;
young_A : A ;
}

View File

@@ -0,0 +1,144 @@
--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, by an adverb, or by a relative clause
PPartNP : NP -> V2 -> NP ; -- the man seen
AdvNP : NP -> Adv -> NP ; -- Paris today
RelNP : NP -> RS -> NP ; -- Paris, which is here
-- Determiners can form noun phrases directly.
DetNP : Det -> NP ; -- these five
--2 Determiners
-- The determiner has a fine-grained structure, in which a 'nucleus'
-- quantifier and two optional parts can be discerned: a cardinal and
-- an ordinal numeral.
DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best
DetQuant : Quant -> Num -> Det ; -- these five
-- Whether the resulting determiner is singular or plural depends on the
-- cardinal.
-- All parts of the determiner can be empty, except $Quant$, which is
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
-- the inherent number.
NumSg : Num ;
NumPl : Num ;
NumCard : Card -> Num ;
-- $Card$ consists of either digits or numeral words.
NumDigits : Digits -> Card ; -- 51
NumNumeral : Numeral -> Card ; -- fifty-one
-- The construction of numerals is defined in [Numeral Numeral.html].
-- A $Card$ can be modified by certain adverbs.
AdNum : AdN -> Card -> Card ; -- almost 51
-- An $Ord$ consists of either digits or numeral words.
-- Also superlative forms of adjectives behave syntactically like ordinals.
OrdDigits : Digits -> Ord ; -- 51st
OrdNumeral : Numeral -> Ord ; -- fifty-first
OrdSuperl : A -> Ord ; -- warmest
-- Definite and indefinite noun phrases are sometimes realized as
-- neatly distinct words (Spanish "un, unos ; el, los") but also without
-- any particular word (Finnish; Swedish definites).
DetArtOrd : Art -> Num -> Ord -> Det ; -- the (five) best
DetArtCard : Art -> Card -> Det ; -- the five
IndefArt : Art ;
DefArt : Art ;
-- Articles cannot alone form noun phrases, but need a noun.
DetArtSg : Art -> CN -> NP ; -- the man
DetArtPl : Art -> CN -> NP ; -- the men
-- 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.
MassNP : CN -> NP ; -- (beer)
-- 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$ modules.
PossPron : Pron -> Quant ; -- my (house)
-- 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 ; -- mother of the king
ComplN3 : N3 -> NP -> N2 ; -- distance from this city (to Paris)
-- Relational nouns can also be used without their arguments.
-- The semantics is typically derivative of the relational meaning.
UseN2 : N2 -> CN ; -- mother
Use2N3 : N3 -> N2 ; -- distance (from this city)
Use3N3 : N3 -> N2 ; -- distance (to Paris)
-- 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 bought
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 ; -- question where she sleeps
--2 Apposition
-- This is certainly overgenerating.
ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y)
} ;

View File

@@ -0,0 +1,60 @@
--1 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.
abstract Numeral = Cat ** {
cat
Digit ; -- 2..9
Sub10 ; -- 1..9
Sub100 ; -- 1..99
Sub1000 ; -- 1..999
Sub1000000 ; -- 1..999999
fun
num : Sub1000000 -> Numeral ;
n2, n3, n4, n5, n6, n7, n8, n9 : Digit ;
pot01 : Sub10 ; -- 1
pot0 : Digit -> Sub10 ; -- d * 1
pot110 : Sub100 ; -- 10
pot111 : Sub100 ; -- 11
pot1to19 : Digit -> Sub100 ; -- 10 + d
pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9
pot1 : Digit -> Sub100 ; -- d * 10
pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99
pot2 : Sub10 -> Sub1000 ; -- m * 100
pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
-- Numerals as sequences of digits have a separate, simpler grammar
cat
Dig ; -- single digit 0..9
fun
IDig : Dig -> Digits ; -- 8
IIDig : Dig -> Digits -> Digits ; -- 876
D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig ;
}

View File

@@ -0,0 +1,44 @@
--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 come here, 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) love yourself
UttImpPl : Pol -> Imp -> Utt; -- (don't) love yourselves
UttImpPol : Pol -> Imp -> Utt ; -- (don't) sleep (polite)
-- 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
}

View File

@@ -0,0 +1,41 @@
--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 -> ClSlash -> QCl ; -- whom 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, with or without a noun.
IdetCN : IDet -> CN -> IP ; -- which five songs
IdetIP : IDet -> IP ; -- which five
-- They can be modified with adverbs.
AdvIP : IP -> Adv -> IP ; -- who in Paris
-- Interrogative quantifiers have number forms and can take number modifiers.
IdetQuant : IQuant -> Num -> IDet ; -- which (five)
-- Interrogative adverbs can be formed prepositionally.
PrepIP : Prep -> IP -> IAdv ; -- with whom
-- Interrogative complements to copulas can be both adverbs and
-- pronouns.
CompIAdv : IAdv -> IComp ; -- where (is it)
CompIP : IP -> IComp ; -- who (is it)
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
}

View 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 -> ClSlash -> 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 ; -- the mother of whom
}

View File

@@ -0,0 +1,95 @@
--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 she goes is good
--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.
SlashVP : NP -> VPSlash -> ClSlash ; -- (whom) he sees
AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
SlashVS : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
--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 ; -- love yourselves
--2 Embedded sentences
-- Sentences, questions, and infinitival phrases can be used as
-- subjects and (adverbial) complements.
EmbedS : S -> SC ; -- that she goes
EmbedQS : QS -> SC ; -- who goes
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 ;
UseSlash : Tense -> Ant -> Pol -> ClSlash -> SSlash ;
-- An adverb can be added to the beginning of a sentence.
AdvS : Adv -> S -> S ; -- today, I will go home
-- A sentence can be modified by a relative clause referring to its contents.
RelS : S -> RS -> S ; -- she sleeps, which is good
}
--.
-- 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
-}

View File

@@ -0,0 +1,111 @@
--1 Structural: Structural Words
--
-- Here we have some words belonging to closed classes and appearing
-- in all languages we have considered.
-- 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 = Cat ** {
fun
-- This is an alphabetical list of structural words
above_Prep : Prep ;
after_Prep : Prep ;
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 ;
both7and_DConj : Conj ; -- both...and
---b both7and_DConj : DConj ;
but_PConj : PConj ;
by8agent_Prep : Prep ; -- by (agent)
by8means_Prep : Prep ; -- by (means of)
can8know_VV : VV ; -- can (capacity)
can_VV : VV ; -- can (possibility)
during_Prep : Prep ;
either7or_DConj : Conj ; -- either...or
---b either7or_DConj : DConj ;
every_Det : Det ;
everybody_NP : NP ; -- everybody
everything_NP : NP ;
everywhere_Adv : Adv ;
--- first_Ord : Ord ; DEPRECATED
few_Det : Det ;
for_Prep : Prep ;
from_Prep : Prep ;
he_Pron : Pron ;
here_Adv : Adv ;
here7to_Adv : Adv ; -- to here
here7from_Adv : Adv ; -- from here
how_IAdv : IAdv ;
how8many_IDet : IDet ;
i_Pron : Pron ;
if_Subj : Subj ;
in8front_Prep : Prep ; -- in front of
in_Prep : Prep ;
it_Pron : Pron ;
less_CAdv : CAdv ;
many_Det : Det ;
more_CAdv : CAdv ;
most_Predet : Predet ;
much_Det : Det ;
must_VV : VV ;
---b no_Phr : Phr ;
no_Utt : Utt ;
on_Prep : Prep ;
--- one_Quant : QuantSg ; DEPRECATED
only_Predet : Predet ;
or_Conj : Conj ;
otherwise_PConj : PConj ;
part_Prep : Prep ;
please_Voc : Voc ;
possess_Prep : Prep ; -- of (possessive)
quite_Adv : AdA ;
she_Pron : Pron ;
so_AdA : AdA ;
someSg_Det : Det ;
somePl_Det : Det ;
somebody_NP : NP ;
something_NP : NP ;
somewhere_Adv : Adv ;
that_Quant : Quant ;
there_Adv : Adv ;
there7to_Adv : Adv ; -- to there
there7from_Adv : Adv ; -- from there
therefore_PConj : PConj ;
they_Pron : Pron ;
this_Quant : Quant ;
through_Prep : Prep ;
to_Prep : Prep ;
too_AdA : AdA ;
under_Prep : Prep ;
very_AdA : AdA ;
want_VV : VV ;
we_Pron : Pron ;
whatPl_IP : IP ; -- what (plural)
whatSg_IP : IP ; -- what (singular)
when_IAdv : IAdv ;
when_Subj : Subj ;
where_IAdv : IAdv ;
which_IQuant : IQuant ;
whoPl_IP : IP ; -- who (plural)
whoSg_IP : IP ; -- who (singular)
why_IAdv : IAdv ;
with_Prep : Prep ;
without_Prep : Prep ;
---b yes_Phr : Phr ;
yes_Utt : Utt ;
youSg_Pron : Pron ; -- you (singular)
youPl_Pron : Pron ; -- you (plural)
youPol_Pron : Pron ; -- you (polite)
}

View 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 they here? ...
TExclMark : Phr -> Text -> Text ; -- Let's go! ...
}

View File

@@ -0,0 +1,71 @@
--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
ComplVV : VV -> VP -> VP ; -- want to run
ComplVS : VS -> S -> VP ; -- say that she runs
ComplVQ : VQ -> QS -> VP ; -- wonder who runs
ComplVA : VA -> AP -> VP ; -- they become red
SlashV2a : V2 -> VPSlash ; -- love (it)
Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her)
Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her
SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2S : V2S -> S -> VPSlash ; -- answer (to him) that it is good
SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (him) who came
SlashV2A : V2A -> AP -> VPSlash ; -- paint (it) red
ComplSlash : VPSlash -> NP -> VP ; -- love it
SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy
SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
--2 Other ways of forming verb phrases
-- Verb phrases can also be constructed reflexively and from
-- copula-preceded complements.
ReflVP : VPSlash -> VP ; -- love himself
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 loved
-- 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 man
CompAdv : Adv -> Comp ; -- (be) here
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsBul = Constructors with (Grammar = GrammarBul) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsCat = Constructors with (Grammar = GrammarCat) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsDan = Constructors with (Grammar = GrammarDan) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsEng = Constructors with (Grammar = GrammarEng) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFin = Constructors with (Grammar = GrammarFin) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsFre = Constructors with (Grammar = GrammarFre) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsGer = Constructors with (Grammar = GrammarGer) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsIta = Constructors with (Grammar = GrammarIta) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsNor = Constructors with (Grammar = GrammarNor) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsRus = Constructors with (Grammar = GrammarRus) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSpa = Constructors with (Grammar = GrammarSpa) ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource ConstructorsSwe = Constructors with (Grammar = GrammarSwe) ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
interface Syntax = Constructors, Cat, Structural, Numeral ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxBul of Syntax = ConstructorsBul, CatBul, StructuralBul, NumeralBul ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxCat of Syntax = ConstructorsCat, CatCat, StructuralCat, NumeralCat ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxDan of Syntax = ConstructorsDan, CatDan, StructuralDan, NumeralDan ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxEng of Syntax = ConstructorsEng, CatEng, StructuralEng, NumeralEng ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFin of Syntax = ConstructorsFin, CatFin, StructuralFin, NumeralFin ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxFre of Syntax = ConstructorsFre, CatFre, StructuralFre, NumeralFre ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxGer of Syntax = ConstructorsGer, CatGer, StructuralGer, NumeralGer ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxIta of Syntax = ConstructorsIta, CatIta, StructuralIta, NumeralIta ;

View File

@@ -0,0 +1,5 @@
--# -path=.:alltenses:prelude
instance SyntaxNor of Syntax = ConstructorsNor, CatNor, StructuralNor, NumeralNor
;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxRus of Syntax = ConstructorsRus, CatRus, StructuralRus, NumeralRus ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxSpa of Syntax = ConstructorsSpa, CatSpa, StructuralSpa, NumeralSpa ;

View File

@@ -0,0 +1,4 @@
--# -path=.:alltenses:prelude
instance SyntaxSwe of Syntax = ConstructorsSwe, CatSwe, StructuralSwe, NumeralSwe ;

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryBul = SyntaxBul, LexiconBul, ParadigmsBul - [mkAdv] **
open (P = ParadigmsBul), in {
oper
mkAdv = overload SyntaxBul {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryCat = SyntaxCat, LexiconCat, ParadigmsCat - [mkAdv] **
open (P = ParadigmsCat), in {
oper
mkAdv = overload SyntaxCat {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryDan = SyntaxDan, LexiconDan, ParadigmsDan - [mkAdv] ;

View File

@@ -0,0 +1,13 @@
--# -path=.:alltenses:prelude
resource TryEng = SyntaxEng, LexiconEng, ParadigmsEng - [mkAdv] **
open (P = ParadigmsEng), in {
oper
mkAdv = overload SyntaxEng {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
}

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryFin = SyntaxFin, LexiconFin-[mkOrd], ParadigmsFin - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryFre = SyntaxFre, LexiconFre, ParadigmsFre - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryGer = SyntaxGer, LexiconGer, ParadigmsGer - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryIta = SyntaxIta, LexiconIta, ParadigmsIta - [mkAdv,in_Prep] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryNor = SyntaxNor, LexiconNor, ParadigmsNor - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TryRus = SyntaxRus, LexiconRus, ParadigmsRus - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TrySpa = SyntaxSpa, LexiconSpa, ParadigmsSpa - [mkAdv] ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude
resource TrySwe = SyntaxSwe, LexiconSwe, ParadigmsSwe - [mkAdv] ;

View File

@@ -0,0 +1,43 @@
concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
lin
PositA a = {
s = \\h,g,n,d,c => case h of {
Hum => a.s ! APosit g n d c;
NoHum => case n of {
Pl => a.s ! APosit Fem Sg d c ;
_ => a.s ! APosit g n d c
}
}
};
-- ComparA a np = {
-- s = \\_ => a.s ! AAdj Compar ++ "مِنْ" ++ np.s ! Gen ;
-- } ;
--
-- $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 ;
--
}

View File

@@ -0,0 +1,21 @@
concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
lin
PositAdvAdj a = {s = a.s ! APosit Masc Sg Indef Acc} ;
-- ComparAdvAdj cadv a np = {
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen
-- } ;
-- ComparAdvAdjS cadv a s = {
-- s = cadv.s ++ a.s ! AAdv ++ "تهَن" ++ s.s
-- } ;
PrepNP prep np = {s = prep.s ++ np.s ! Gen} ;
-- AdAdv = cc2 ;
--
-- SubjS = cc2 ;
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
--
-- AdnCAdv cadv = {s = cadv.s ++ "تهَن"} ;
--
}

View File

@@ -0,0 +1,3 @@
--# -path=.:../abstract:../common:prelude
concrete Arabic of ArabicAbs = LangAra ;

View File

@@ -0,0 +1,3 @@
--# -path=.:../abstract:../common:prelude
abstract ArabicAbs = Lang ;

View File

@@ -0,0 +1,103 @@
concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
flags optimize=all_subs ;
lincat
-- Phrase
Utt = {s : Gender => 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 = ResAra.VP ;
VPSlash = ResAra.VP ** {c2 : Str} ;
Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ;
-- SC = {s : Str} ;
--
-- Adjective
AP = {s : Species => Gender => NTable } ;
-- Noun
CN = ResAra.Noun ** {adj : NTable};
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Num, Ord, Card = {s : Gender => State => Case => Str ;
n : Size };
Predet = ResAra.Predet ;
-- DEPRECATED
-- QuantSg, QuantPl =
-- {s : Species => Gender => Case => Str;
-- n : ResAra.Number;
-- d : State;
-- isNum : Bool;
-- isPron : 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;
isNum : Bool;
isPron: Bool} ;
Art = {s : ResAra.Number => Species => Gender => Case => Str;
d : State} ;
-- Numeral
Numeral = {s : CardOrd => Gender => State => Case => Str ;
n : Size } ;
Digits = {s : Str;
n : Size};
-- Structural
Conj = {s : Str ; n : ResAra.Number} ;
-- DConj = {s1,s2 : Str ; n : ResAra.Number} ;
-- 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} ;
V2V, V2S, V2Q = ResAra.Verb ** {c2 : Str} ; --- AR
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; g : Gender; h : Species} ;
}

View 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} ;
--
}

View 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 "مُست"} ;
--
}

View File

@@ -0,0 +1,21 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarAra of Grammar =
NounAra,
VerbAra,
AdjectiveAra,
AdverbAra,
NumeralAra,
SentenceAra,
QuestionAra,
RelativeAra,
ConjunctionAra,
PhraseAra,
TextX - [Utt],
StructuralAra,
IdiomAra
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View 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) ;
--
}

View 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 "ورِتي" "ورْتي" "ورِتّن" ;
}

View File

@@ -0,0 +1,12 @@
--# -path=.:../abstract:../common:prelude
concrete LangAra of Lang =
GrammarAra,
LexiconAra
** {
flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ;
}

View File

@@ -0,0 +1,384 @@
--# -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 = brkN "شقّ" "فِعّة" "فِعَل" Fem NoHum ;
apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ;
art_N = brkN "فنّ" "فَعّ" "فُعُول" Masc NoHum ;
ask_V2Q = dirV2 (regV "يَس؟َل") ;
-- ask_V2Q = dirV2 (v1 "س؟ل" a a) ;
baby_N = brkN "طفل" "فِعل" "أَفعال" Masc Hum;
bad_A = sndA "سو؟" "فَيِّع" ;
bank_N = brkN "بنك" "فَعل" "فُعُول" Masc NoHum ;
beautiful_A = sndA "جمل" "فَعِيل" ;
become_VA = mkVA (v4 "صبح") ;
beer_N = sdfN "بير" "فِعلة" Fem NoHum ;
beg_V2V = dirV2 (v5 "وسل") ;
big_A = sndA "كبر" "فَعِيل" ;
bike_N = sdfN "درج" "فَعّالة" Fem NoHum ;
bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum;
black_A = clrA "سود" ;
blue_A = clrA "زرق" ;
boat_N = brkN "قرب" "فاعِل" "فَواعِل" Masc NoHum ;
book_N = brkN "كتب" "فِعال" "فُعُل" Masc NoHum ;
boot_N = sdfN "جزم" "فَعلة" Fem NoHum ;
boss_N = brkN "دور" "مُفِيع" "مُفَعاء" Masc Hum ;
boy_N = brkN "صبي" "فَعِل" "فُعلان" Masc Hum ;
bread_N = brkN "خبز" "فُعل" "أَفعال" Masc NoHum ;
break_V2 = dirV2 (regV "يَكسُر") ;
-- break_V2 = dirV2 (v1 "كسر" a u) ;
broad_A = sndA "وسع" "فاعِل" ;
brother_N2 = brkN "؟خو" "فَع" "فِعلة" Masc Hum ; --FIXME
brown_A = sndA "بني" "فُعِّل";
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 = brkN "هرّ" "فِعّة" "فِعَل" Fem NoHum ;
ceiling_N = brkN "سقف" "فَعل" "أَفعُل" Masc NoHum ;
chair_N = brkN "كرس" "فُعلِي" "فَعالِي" Masc NoHum ;
cheese_N = brkN "جبن" "فُعلة" "أَفعال" Fem NoHum ;
child_N = brkN "ولد" "فَعَل" "أَفعال" Masc Hum ;
church_N = brkN "كنس" "فَعِيلة" "فَعاٱِل" Fem Hum ;
city_N = brkN "مدن" "فَعِيلة" "فُعُل" Fem NoHum ;
clean_A = sndA "نظف" "فَعِيل" ;
clever_A = sndA "جهد" "مُفتَعِل" ;
close_V2 = dirV2 (v4 "غلق") ;
coat_N = brkN "عطف" "مِفعَل" "مَفاعِل" Masc NoHum ;
cold_A = sndA "برد" "فاعِل" ;
come_V = v1 "جي؟" a i ; --check
computer_N = brkN "حسب" "فاعُول" "فَواعِيل" Masc NoHum ;
country_N = brkN "بلد" "فَعَل" "فِعال" Masc NoHum ;
cousin_N = brkN "قرب" "فَعِيل" "أَفعِلاء" Masc Hum ; -- (<bn / bnt) (cam[ö] / xAl[ö])
cow_N = sdfN "بقر" "فَعلة" Fem NoHum ;
die_V = v1 "موت" a u ; --check
dirty_A = sndA "وسخ" "فَعِل" ;
distance_N3 = mkN3 (sdfN "سوف" "مَفاعة" Fem NoHum) "مِن" "إِلَى" ;
doctor_N = brkN "طبّ" "فَعِيل" "أَفِعّاء" Masc Hum ;
dog_N = brkN "كلب" "فَعل" "فِعال" Masc NoHum ;
door_N = brkN "بوب" "فاع" "أَفعال" Masc NoHum ;
drink_V2 = dirV2 (regV "شَرِب") ;
-- drink_V2 = dirV2 (v1 "شرب" i a) ;
easy_A2V = mkA2 (sndA "سهل" "فَعل") "لِ" ;
eat_V2 = dirV2 (regV "يَ؟كُل") ;
-- eat_V2 = dirV2 (v1 "؟كل" a u) ;
empty_A = sndA "فرغ" "فاعِل" ;
enemy_N = brkN "عدو" "فَعُلّ" "أَفعاء" Masc Hum ;
factory_N = brkN "صنع" "مَفعَل" "مَفاعِل" Masc NoHum ;
father_N2 = brkN "؟ب" "فَع" "أَفعاء" Masc Hum;
fear_VS = mkVS (v1 "خشي" i a );
find_V2 = dirV2 (v1 "وجد" a i ) ;
fish_N = brkN "سمك" "فَعَلة" "أَفعال" Fem NoHum ;
floor_N = brkN "؟رض" "فَعل" "فَعالِي" Fem NoHum;
forget_V2 = dirV2 (v1 "نسي" i a ) ;
fridge_N = sdfN "برد" "فَعّال" Masc NoHum ;
friend_N = brkN "صدق" "فَعِيل" "أَفعِلاء" Masc Hum ; --SadIqö
fruit_N = brkN "فكه" "فاعِلة" "فَواعِل" Fem NoHum ;
fun_AV = sndA "متع" "مُفعِل" ;
garden_N = brkN "حدق" "فَعِيلة" "فَعاٱِل" Fem NoHum ;
girl_N = brkN "بنت" "فِعل" "فَعال" Fem Hum ;
glove_N = sdfN "قفز" "فُعّال" Masc NoHum ;
gold_N = sdfN "ذهب" "فَعَل" Masc NoHum ;
good_A = sndA "جود" "فَيِّع" ; -- Hasan, HisAn
go_V = regV "يَذهَب" ;
-- go_V = v1 "ذهب" a a ;
green_A = clrA "خضر" ;
harbour_N = brkN "رف؟" "مَفعَل" "مَفاعِل" Masc NoHum ; --mInA', marsaY
hate_V2 = dirV2 (regV "كَرِه") ;
hat_N = sdfN "قبع" "فُعَّلة" Fem NoHum ;
have_V2 = dirV2 (regV "يَملِك") ;
-- have_V2 = dirV2 (v1 "ملك" a i) ;
hear_V2 = dirV2 (regV "سَمِع") ;
-- hear_V2 = dirV2 (v1 "سمع" i a) ;
hill_N = brkN "هضب" "فَعلة" "فِعال" Fem NoHum ; --tallö, rAbiyö
hope_VS = mkVS (v1 "رجو" a u) ; --check
horse_N = brkN "حصن" "فِعال" "أَفعِلة" Masc NoHum ;
hot_A = sndA "سخن" "فاعِل" ; --HAr
house_N = brkN "بيت" "فَعل" "فُعُول" Masc NoHum ; --manzil
important_A = sndA "هيم" "فاعّ" ;
industry_N = sdfN "صنع" "فِعالة" Fem NoHum ;
iron_N = brkN "حدّ" "فَعِيل" "فَعائِل" Masc NoHum ;
king_N = brkN "ملك" "فَعِل" "فُعُول" Masc Hum ;
know_V2 = dirV2 (regV "عَرِف") ;
-- know_V2 = dirV2 (v1 "عرف" i a) ;
lake_N = sdfN "بحر" "فُعَيلة" Fem NoHum ;
lamp_N = brkN "صبح" "مِفعال" "مَفاعِيل" Masc NoHum ; --qanDIl, fAnUs
learn_V2 = dirV2 (v5 "علم") ;
leather_N = brkN "جلد" "فِعل" "فُعُول" Masc NoHum ;
leave_V2 = dirV2 (regV "يَترُك") ;
-- leave_V2 = dirV2 (v1 "ترك" a u) ;
like_V2 = dirV2 (regV "هَوِي") ;
-- like_V2 = dirV2 (v1 "هوي" i a) ; --check
listen_V2 = mkV2 (v8 "سمع") "إِلَى" ;
live_V = v1 "عيش" a i ; --check
long_A = sndA "طول" "فَعِيل" ;
lose_V2 = dirV2 (regV "خَسِر") ; --Dayyac, >aDAc
-- lose_V2 = dirV2 (v1 "خسر" i a) ; --Dayyac, >aDAc
love_N = brkN "حبّ" "فُعّ" "فُعّ" Masc NoHum ; -- no plur
love_V2 = dirV2 (v1 "حبّ" a i) ;
man_N = brkN "رجل" "فَعُل" "فِعال" Masc Hum ;
married_A2 = mkA2 (sndA "زوج" "مُتَفَعِّل") "مِن" ;
meat_N = brkN "لحم" "فَعلة" "فُعُول" Masc NoHum ;
milk_N = brkN "حلب" "فَعِيل" "فَعِيل" Masc NoHum ; --no plur
moon_N = brkN "قمر" "فَعَل" "أَفعال" Masc NoHum ;
mother_N2 = sdfN "؟م" "فُعّ" Fem Hum ;
mountain_N = brkN "جبل" "فَعَل" "فِعال" Masc NoHum ;
music_N = mkN (reg "مُوسِيقَى" "مُوسِيقَى") Fem NoHum ; --no plur
narrow_A = sndA "ضيق" "فَعِّل" ;
new_A = sndA "جدّ" "فَعِيل" ;
newspaper_N = brkN "صحف" "فَعِيلة" "فُعُل" Fem NoHum ;
oil_N = brkN "زيت" "فَعل" "فُعُول" Masc NoHum ;
old_A = sndA "قدم" "فَعِيل" ;
open_V2 = dirV2 (regV "يَفتَح") ;
-- open_V2 = dirV2 (v1 "فتح" a a ) ;
paint_V2A = mkV2A (regV "يَدهَن" ) [] ;
-- paint_V2A = mkV2A (v1 "دهن" a a ) [] ;
paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
paris_PN = mkPN "بارِيس" Fem NoHum ;
peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
pen_N = brkN "قلم" "فَعَل" "أَفعال" Masc NoHum;
planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal
plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ;
play_V2 = dirV2 (regV "لَعِب") ;
-- play_V2 = dirV2 (v1 "لعب" i a) ;
policeman_N = sdmN "شرط" "فِعلِي" Masc Hum ;
priest_N = brkN "قسّ" "فِعِّيل" "أَفِعّة" Masc Hum ;
probable_AS = mkAS (sndA "مكن" "مُفعِل") ;
queen_N = sdfN "ملك" "فَعِلة" Fem Hum ;
radio_N = mkN (sndf "راديُو") Masc NoHum ;
rain_V0 = mkV0 (regV "يَمطُر") ;
-- rain_V0 = mkV0 (v1 "مطر" a u) ;
read_V2 = dirV2 (regV "يَقرَ؟") ;
-- read_V2 = dirV2 (v1 "قر؟" a a ) ;
red_A = clrA "حمر" ;
religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ;
restaurant_N = brkN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ;
river_N = brkN "نهر" "فَعل" "أَفعال" Masc NoHum ;
rock_N = brkN "صخر" "فَعلة" "فُعُول" Fem NoHum ;
roof_N = brkN "سطح" "فَعل" "أَفعُل" Masc NoHum ;
rubber_N = brkN "مطّ" "فَعّال" "فَعّال" Masc NoHum ; -- no hum
run_V = regV "يَركُض" ;
-- run_V = v1 "ركض" a u ;
say_VS = mkVS (v1 "قول" a u) ; --check
school_N = brkN "درس" "مَفعَلة" "مَفاعِل" Fem NoHum ;
science_N = brkN "علم" "فِعل" "فُعُول" Masc NoHum ;
sea_N = brkN "بحر" "فَعل" "فُعُول" Masc NoHum ;
seek_V2 = dirV2 (regV "يَطلُب") ;
-- 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 = brkN "خرف" "فَعُول" "فِعال" Masc NoHum ;
ship_N = brkN "سفن" "فَعِيلة" "فُعُل" Fem NoHum ;
shirt_N = brkN "قمص" "فَعِيل" "فُعلان" Masc NoHum ;
shoe_N = brkN "حذو" "فِعاء" "أَفعِية" Masc NoHum ;
shop_N = brkN "تجر" "مَفعَل" "مَفاعِل" Masc NoHum ;
short_A = sndA "قصر" "فَعِيل" ;
silver_N = brkN "فضّ" "فِعّة" "فِعَل" Fem NoHum ;
sister_N = brkN "؟خو" "فُعت" "فَعَوات" Fem Hum ; --FIXME
sleep_V = v1 "نوم" i a ; --check
small_A = sndA "صغر" "فَعِيل" ;
snake_N = sdfN "حيّ" "فَعّة" Fem NoHum ;
sock_N = brkN "جرب" "فَوعَل" "فَواعِل" Masc NoHum ;
speak_V2 = dirV2 (v5 "كلم") ;
star_N = brkN "نجم" "فَعل" "فُعُول" Masc NoHum ; --najmö
steel_N = brkN "فلذ" "فُوعال" "فَواعِل" Masc NoHum ;
stone_N = brkN "حجر" "فَعَل" "أَفعال" Masc NoHum ;
stove_N = brkN "وقد" "مَفعِل" "مَفاعِل" Masc NoHum ;
student_N = brkN "طلب" "فاعِل" "فُعّال" Masc Hum ; --tilmI*
stupid_A = clrA "بله" ;
sun_N = brkN "شمس" "فَعل" "فُعُول" 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 = sndA "سمك" "فَعِيل" ;
thin_A = sndA "رفع" "فَعِيل" ;
train_N = sdfN "قطر" "فِعال" Masc NoHum;
travel_V = v3 "سفر" ;
tree_N = brkN "شجر" "فَعلة" "أَفعال" Fem NoHum ;
ugly_A = sndA "قبح" "فَعِيل" ;
understand_V2 = dirV2 (regV "فَهِم") ;
-- understand_V2 = dirV2 (v1 "فهم" i a ) ;
university_N = sdfN "جمع" "فاعِلة" Fem NoHum ;
village_N = brkN "قري" "فَعلة" "فُعَى" Fem NoHum ; --Daycö
wait_V2 = dirV2 (v8 "نظر") ;
walk_V = v1 "مشي" a i ; --check
warm_A = sndA "دف؟" "فاعِل" ;
war_N = brkN "حرب" "فَعل" "فُعُول" Fem NoHum ;
watch_V2 = dirV2 (v3 "شهد") ;
water_N = mkN (reg "ماء" "مِياه") Fem NoHum ; --"موه" "فاء" "فِياع" ??
white_A = clrA "بيض" ;
window_N = brkN "نفذ" "فاعِلة" "فَواعِل" Fem NoHum ; --$ub~Ak
wine_N = brkN "خمر" "فَعل" "فُعُول" Masc NoHum ;
win_V2 = dirV2 (regV "رَبِح") ;
-- win_V2 = dirV2 (v1 "ربح" i a) ;
woman_N = mkN (reg "إِمرَأَة" "نِسوَة") Fem Hum ;
wonder_VQ = mkVQ (v6 "س؟ل") ;
wood_N = brkN "خشب" "فَعَل" "أَفعال" Masc NoHum ;
write_V2 = dirV2 (regV "يَكتُب") ;
-- write_V2 = dirV2 (v1 "كتب" a u) ;
yellow_A = clrA "صفر" ;
young_A = sndA "شبّ" "فاعّ" ;
do_V2 = dirV2 (regV "يَفعَل") ;
-- do_V2 = dirV2 (v1 "فعل" a a ) ;
now_Adv = mkAdv "الآن" ;
already_Adv = mkAdv "سابِقاً" ;
song_N = brkN "غني" "أَفعِلة" "أَفاعِي" Fem NoHum ;
add_V3 = dirV3 (regV "يَجمَع") "وَ" ;
-- add_V3 = dirV3 (v1 "جمع" a a) "وَ" ;
number_N = brkN "رقم" "فَعل" "أَفعال" Masc NoHum ; --cadad
put_V2 = dirV2 (v1 "وضع" a a );
stop_V = v5 "وقف" ;
jump_V = regV "يَقفِز" ;
-- jump_V = v1 "قفز" a i ;
left_Ord = mkOrd "أَيسَر" "يُسرَى";
right_Ord = mkOrd "أَيمَن" "يُمنَى" ;
far_Adv = mkAdv "بَعِيداً" ;
correct_A = sndA "صحّ" "فَعِيل" ;
dry_A = sndA "نشف" "فاعِل" ;
dull_A = sndA "بهت" "فاعِل" ;
full_A = sndA "مل؟" "فَعِيل" ;
heavy_A = sndA "ثقل" "فَعِيل" ;
near_A = sndA "قرب" "فَعِيل" ;
rotten_A = sndA "فسد" "فاعِل" ;
round_A = sndA "دور" "مُفَعَّل" ;
sharp_A = sndA "حدّ" "فاعّ" ;
smooth_A = sndA "نعم" "فاعِل" ;
straight_A = sndA "قوم" "مُستَفِيع" ;
wet_A = sndA "رطب" "فَعِل" ;
wide_A = sndA "وسع" "فاعِل" ;
animal_N = sdfN "حيّ" "فَعَوان" Masc NoHum ;
ashes_N = brkN "رمد" "فَعال" "أَفعِلة" Masc NoHum;
back_N = brkN "ظهر" "فَعل" "فُعُول" Masc NoHum;
bark_N = brkN "نبح" "فَعل" "فُعال" Masc NoHum;
belly_N = brkN "بطن" "فَعل" "فُعُول" Fem NoHum;
blood_N = brkN "دم" "فَع" "فِعاء" Masc NoHum;
bone_N = brkN "عظم" "فَعلة" "فِعال" Fem NoHum;
breast_N = brkN "صدر" "فَعل" "فُعُول" Masc NoHum;
cloud_N = brkN "غيم" "فَعلة" "فُعُول" Fem NoHum;
day_N = brkN "يوم" "فَعل" "أَفّاع" Masc NoHum;
dust_N = brkN "غبر" "فُعال" "أَفعِلة" Masc NoHum;
ear_N = brkN "؟ذن" "فُعل" "أَفعال" Fem NoHum;
earth_N = brkN "ترب" "فُعلة" "فُعَل" Fem NoHum;
egg_N = sdfN "بيض" "فَعلة" Fem NoHum;
eye_N = brkN "عين" "فَعل" "فُعُول" Fem NoHum;
fat_N = brkN "دهن" "فُعل" "فُعُول" Masc NoHum ;
feather_N = sdfN "ريش" "فِعلة" Fem NoHum;
fingernail_N = brkN "ظفر" "فُعل" "أَفاعِل" Masc NoHum;
fire_N = brkN "نور" "فاع" "فِيعان" Fem NoHum;
flower_N = brkN "زهر" "فَعلة" "فُعُول" Fem NoHum;
fog_N = brkN "ضبّ" "فَعال" "فَعال" Masc NoHum; --no plural ?
foot_N = brkN "قدم" "فَعَل" "أَفعال" Fem NoHum;
forest_N = sdfN "غيب" "فاعة" Fem NoHum;
grass_N = brkN "عشب" "فُعلة" "أَفعال" Fem NoHum;
guts_N = brkN "حشو" "فَعا" "أَفعاء" Fem NoHum;
hair_N = sdfN "شعر" "فَعلة" Fem NoHum ;
hand_N = brkN "يد" "فَع" "أَفاعِي" Fem NoHum ;
head_N = brkN "ر؟س" "فَعل" "فُعُول" Masc NoHum;
heart_N = brkN "قلب" "فَعل" "فُعُول" Masc NoHum;
horn_N = brkN "قرن" "فَعل" "فُعُول" Masc NoHum;
husband_N = brkN "زوج" "فَعل" "أَفعال" Masc NoHum;
ice_N = brkN "ثلج" "فَعل" "فُعُول" Masc NoHum;
knee_N = brkN "ركب" "فُعلة" "فُعَل" Fem NoHum;
leaf_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum;
leg_N = brkN "رجل" "فِعل" "أَفعُل" Fem NoHum;
liver_N = brkN "كبد" "فَعِل" "أَفعال" Masc NoHum ;
louse_N = sdfN "قمل" "فَعلة" Fem NoHum;
mouth_N = brkN "فوه" "فُعل" "أَفعال" Masc NoHum ;
name_N = brkN "؟سم" "فِعل" "فَعالِي" Masc NoHum;
neck_N = brkN "رقب" "فَعَلة" "فِعال" Fem NoHum;
night_N = brkN "ليل" "فَعلة" "فَعالِي" Fem NoHum; --plural?
nose_N = brkN "؟نف" "فَعل" "فُعُول" Masc NoHum;
person_N = brkN "شخص" "فَعل" "أَفعال" Masc Hum;
rain_N = brkN "مطر" "فَعَل" "أَفعال" Masc NoHum;
road_N = brkN "طرق" "فَعِيل" "فُعُل" Fem NoHum;
root_N = brkN "جذر" "فَعل" "فُعُول" Masc NoHum ;
rope_N = brkN "حبل" "فَعل" "فِعال" Masc NoHum;
salt_N = brkN "ملح" "فِعل" "أَفعال" Masc NoHum;
sand_N = brkN "رمل" "فَعل" "فِعال" Masc NoHum;
seed_N = brkN "بذر" "فَعل" "فُعُول" Masc NoHum;
skin_N = brkN "جلد" "فِعل" "فُعُول" Masc NoHum;
sky_N = sdfN "سمو" "فَعاء" Fem NoHum;
smoke_N = brkN "دخن" "فُعال" "أَفعِلة" Masc NoHum;
snow_N = brkN "ثلج" "فَعل" "فُعُول" Masc NoHum;
stick_N = brkN "عصو" "فَعا" "فِعِي" Masc NoHum ; --"عصو"
tail_N = brkN "ذنب" "فَعَل" "أَفعال" Masc NoHum;
tongue_N = brkN "لسن" "فِعال" "أَفعِلة" Masc NoHum;
tooth_N = brkN "سنّ" "فِعل" "أَفعال" Masc NoHum ;
wife_N = sdfN "زوج" "فَعلة" Fem Hum;
wind_N = brkN "ريح" "فِعل" "فِعال" Fem NoHum;
wing_N = brkN "جنح" "فَعال" "أَفعِلة" Masc NoHum ;
worm_N = brkN "دود" "فُعلة" "فِيعان" Fem NoHum ;
year_N = sdfN "سن" "فَعة" Fem NoHum ;
blow_V = regV "يَنفُخ" ;
breathe_V = dirV2 (v5 "نفس") ;
burn_V = regV "يَحرِق" ;
dig_V = regV "يَحفِر" ;
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 = regV "ضَحِك" ;
lie_V = regV "يَكذِب" ;
play_V = regV "لَعِب" ;
sew_V = v1 "خيط" a i ;
sing_V = v2 "غني" ;
sit_V = regV "يَقعُد" ;
smell_V = v1 "شمّ" i a ;
spit_V = regV "يَبصُق" ;
stand_V = v1 "وقف" a i ;
swell_V = v8 "نفخ" ;
swim_V = regV "يَسبَح" ;
think_V = v2 "فكر" ;
turn_V = regV "يَبرُم" ;
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 (regV "يَضرِب" ) ;
hold_V2 = dirV2 (regV "يَمسِك" ) ;
hunt_V2 = dirV2 (v1 "صيد" a i) ;
kill_V2 = dirV2 (regV "يَقتُل" ) ;
pull_V2 = dirV2 (regV "يَسحَب") ;
push_V2 = dirV2 (regV "يَدفَع" ) ;
rub_V2 = dirV2 ( regV "يَفرُك" ) ;
scratch_V2 = dirV2 (regV "يَخدِش" ) ;
split_V2 = dirV2 ( v2 "قسم" ) ;
squeeze_V2 = dirV2 (regV "يَعصِر" ) ;
stab_V2 = dirV2 ( regV "يَطعُن" ) ;
suck_V2 = dirV2 (v1 "مصّ" a u) ;
throw_V2 = dirV2 (v1 "رمي" a i) ;
tie_V2 = dirV2 (regV "يَربُط" ) ;
wash_V2 = dirV2 ( regV "يَغسِل" ) ;
wipe_V2 = dirV2 ( regV "يَمسَح" ) ;
-- other_A = sndA "ْتهر" ;
} ;

View File

@@ -0,0 +1,49 @@
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; --only Const is used now. check StructuralAra
isNum = False;
isPron = False
};
mkPredet : Str -> Bool -> Predet
= \word,decl ->
{ s = \\c =>
case decl of {
True => word + vowel!c;
False => word
};
isDecl = decl
};
mkQuantNum : Str -> Number -> State -> {
s: Species => Gender => Case => Str; n: Number; d : State; isPron: Bool; 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;
isPron = False;
isNum = True
};
vowel : Case => Str =
table {
Nom => "ُ";
Acc => "َ";
Gen => "ِ"
};
}

View File

@@ -0,0 +1,184 @@
concrete NounAra of Noun = CatAra ** open ResAra, Prelude in {
flags optimize=noexpand ;
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 cnB4det det.isPron 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
++ cn.adj ! number ! det.d ! c
};
a = { pgn = agrP3 cn.h cn.g number;
isPron = False }
};
UsePN pn = {
s = pn.s;
a = {pgn = (Per3 pn.g Sg); isPron = False }
};
UsePron p = p ;
PredetNP pred np = {
s = \\c => case pred.isDecl of {
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
False => pred.s!c ++ np.s ! c
};
a = np.a
} ;
{-
--should compile.. not working :( wierd error message.. bug?
PPartNP np v2 =
let x = case np.a.pgn of {
Per3 g n => ( positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ;
_ => \\_ => [] -- not occuring anyway
} in {
s = \\c => np.s ! c ++ x ! c ;
a = np.a
};
-}
-- FIXME try parsing something like "this house now" and you'll get
-- an internal compiler error, but it still works.. wierd..
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s;
a = np.a
};
{-
DetSg quant ord = {
s = \\h,g,c =>
quant.s ! Sg ! h ! g ! c ++ ord.s ! g ! quant.d ! c ;
n = One;
d = quant.d;
isPron = quant.isPron;
isNum =
case ord.n of {
None => False;
_ => True
}
} ;
-}
DetQuantOrd quant num ord = {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c
--FIXME check this:
++ ord.s ! g ! (toDef quant.d num.n) ! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum =
case num.n of {
None => False;
_ => True
}
} ;
DetQuant quant num = {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum =
case num.n of {
None => False;
_ => True
}
} ;
--DEPRECATED
-- SgQuant quant = {s = quant.s ! Sg ; d = quant.d;
-- isPron = quant.isPron; isNum = False} ;
-- PlQuant quant = {s = quant.s ! Pl ; d = quant.d;
-- isPron = quant.isPron; isNum = False} ;
PossPron p = {
s = \\_,_,_,_ => p.s ! Gen;
d = Const;
isPron = True;
isNum = False } ;
NumSg = {
s = \\_,_,_ => [] ;
n = One } ;
NumPl = {
s = \\_,_,_ => [] ;
n = None } ;
NumDigits digits = {
s = \\_,_,_ => digits.s;
n = digits.n
};
NumNumeral numeral = {
s = numeral.s ! NCard ;
n = numeral.n
};
AdNum adn num = {
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
n = num.n } ;
OrdDigits digits = {
s = \\_,d,_ => Al ! d ++ digits.s;
n = digits.n
};
-- OrdNumeral : Numeral -> Ord ; -- fifty-first
OrdNumeral numeral = {
s = numeral.s ! NOrd ;
n = numeral.n
};
-- FIXME, "the biggest house" would better translate into
-- akbaru baytin rather than al-baytu l-2akbaru
-- DetCN (DetSg DefArt (OrdSuperl big_A)) (UseN house_N)
OrdSuperl a = {
s = \\_,d,c => a.s ! AComp d c;
n = One
} ;
DefArt = {
s = \\_,_,_,_ => [];
d = Def} ;
IndefArt = {
s = \\_,_,_,_ => [];
d = Indef} ;
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
-- isNum = False; isPron = False} ;
UseN n = n ** {adj = \\_,_,_ => []};
-- 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} ;
--
-- UseN2 n = n ;
-- UseN3 n = n ;
--
AdjCN ap cn = {
s = \\n,d,c => cn.s ! n ! d ! c;
adj = \\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} ;
-- ApposCN cn np =
}

View File

@@ -0,0 +1,154 @@
concrete NumeralAra of Numeral = CatAra **
open Predef, Prelude, ResAra, MorphoAra in {
lincat
Digit = {s : DForm => CardOrd => Gender => State => Case => Str ;
n : Size } ;
Sub10 = {s : DForm => CardOrd => Gender => State => Case => Str ;
n : Size } ;
Sub100 = {s : CardOrd => Gender => State => Case => Str ;
n : Size} ;
Sub1000 = {s : CardOrd => Gender => State => Case => Str ;
n : Size } ;
Sub1000000 = {s : CardOrd => 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 = mkNum "واحِد" "أَوَّل" "أُولى" ** { 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 = \\co,g,d,c => case dig.n of {
Two => Al ! d + num2.s ! unit ! co ! g ! Const ! c ++ teen ! g ;
_ => dig.s ! unit ! co ! 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 = \\co,g,d,c => n.s ! unit ! co ! g ! d ! c
++ "وَ" ++ dig.s ! ten ! co ! g ! d ! c ;
n = NonTeen
};
lin pot1as2 n = n ;
lin pot2 dig = {
s = \\co,_,d,c => case dig.n of {
One => num100 ! d ! c ;
Two => num200 ! d ! c ;
_ => dig.s ! unit ! co ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةِ"
};
n = Hundreds
};
lin pot2plus m e = {
s = \\co,g,d,c => case m.n of {
One => num100 ! d ! c;
Two => num200 ! d ! c;
_ => m.s ! unit ! co ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةٌ"
} ++ "وَ" ++ e.s ! co ! g ! d ! c ;
n = e.n
};
lin pot2as3 n = n ;
lin pot3 m = {
s = \\co,_,d,c => case m.n of {
One => num1000 ! (definite ! d) ! c;
Two => num2000 ! (definite ! d) ! c;
_ => m.s ! co ! Fem ! (toDef d ThreeTen) ! c ++ "آلافٌ"
} ;
n = m.n
};
--lin pot3plus n m = {
-- s = \\c => n.s ! NCard ++ "تهُْسَند" ++ m.s ! c ; n = Pl} ;
-- numerals as sequences of digits
lincat
Dig = Digits ;
-- Numeral,Digits = {s : Gender => State => Case => Str ;
-- n : Size } ;
lin
IDig d = d ;
IIDig d i = {
s = d.s ++ i.s;
n = ThreeTen ;
} ;
D_0 = mk1Dig "0" ;
D_1 = mk2Dig "1" One ;
D_2 = mk2Dig "2" Two ;
D_3 = mk1Dig "3" ;
D_4 = mk1Dig "4" ;
D_5 = mk1Dig "5" ;
D_6 = mk1Dig "6" ;
D_7 = mk1Dig "7" ;
D_8 = mk1Dig "8" ;
D_9 = mk1Dig "9" ;
oper
mk2Dig : Str -> Size -> Digits = \str,sz -> {
s = str ;
n = sz ;
lock_Digits = <>
};
mk1Dig : Str -> Digits = \str -> {
s = str ;
n = ThreeTen;
lock_Digits = <>
};
}

View 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 {
"ِ" => "ئ";
"ُ" => "ؤ";
"َ" => "أ";
"ْ"|"ا"|"و"|"ي" => "ء"
};
}

View File

@@ -0,0 +1,467 @@
--# -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$.
--
-- The following modules are presupposed:
resource ParadigmsAra = open
Predef,
Prelude,
MorphoAra,
OrthoAra,
CatAra
in {
flags optimize = noexpand;
oper
-- Prepositions are used in many-argument functions for rection.
Preposition : Type ;
--2 Nouns
--This is used for loan words or anything that has untreated irregularities
--in the interdigitization process of its words
mkN : NTable -> Gender -> Species -> N ;
--Takes a root string, a singular pattern string, a broken plural
--pattern string, a gender, and species. Gives a noun.
brkN : Str -> Str -> Str -> Gender -> Species -> N ;
--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 ;
--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 ;
mkPN : Str -> Gender -> Species -> PN ;
--3 Relational nouns
mkN2 : N -> Preposition -> N2 ;
mkN3 : N -> Preposition -> Preposition -> N3 ;
--2 Adjectives
--Takes a root string and a pattern string
sndA : Str -> Str -> A ;
--Takes a root string only
clrA : Str -> A ;
--3 Two-place adjectives
--
-- Two-place adjectives need a preposition for their second argument.
mkA2 : A -> Preposition -> A2 ;
--2 Adverbs
-- Adverbs are not inflected. Most lexical ones have position
-- after the verb. Some can be preverbal.
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 ;
-- (These two functions are synonyms.)
--2 Verbs
--The verb in the imperfect tense gives the most information
regV : Str -> V ;
--Verb Form I : fa`ala, fa`ila, fa`ula
v1 : Str -> Vowel -> Vowel -> V ;
--Verb Form II : fa``ala
v2 : Str -> V ;
--Verb Form III : faa`ala
v3 : Str -> V ;
--Verb Form IV : 'af`ala
v4 : Str -> V ;
--Verb Form V : tafa``ala
v5 : Str -> V ;
--Verb Form VI : tafaa`ala
v6 : Str -> V ;
--Verb Form VIII 'ifta`ala
v8 : Str -> 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 $AS, A2S, AV, A2V$ are just $A$,
-- and the second argument is given
-- as an adverb. Likewise
-- $V0$ is just $V$.
V0 : 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.
regV = \word ->
case word of {
"يَ" + f@_ + c@_ + "ُ" + l@_ => v1 (f+c+l) a u ;
"يَ" + f@_ + c@_ + "ِ" + l@_ => v1 (f+c+l) a i ;
"يَ" + f@_ + c@_ + "َ" + l@_ => v1 (f+c+l) a a ;
f@_ + "َ" + c@_ + "ِ" + l@_ => v1 (f+c+l) i a
};
v1 = \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
};
v2 =
\rootStr ->
let {
root = mkRoot3 rootStr
} in {
s =
case root.l of {
"و"|"ي" => (v2defective root).s;
_ => (v2sound root).s
};
lock_V = <>
};
v3 =
\rootStr ->
let {
tbc = mkRoot3 rootStr ;
} in {
s = (v3sound tbc).s ;
lock_V = <>
};
v4 =
\rootStr ->
let {
root = mkRoot3 rootStr
} in {
s =
case root.l of {
"و"|"ي" => (v4defective root).s;
_ => (v4sound root).s
};
lock_V = <>
};
v5 =
\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 = <>
};
v6 =
\rootStr ->
let {
fqm = mkRoot3 rootStr ;
} in {
s = (v6sound fqm).s ;
lock_V = <>
};
v8 =
\rootStr ->
let {
rbT = mkRoot3 rootStr ;
} in {
s = (v8sound rbT).s ;
lock_V = <>
};
Preposition = Str ;
mkN nsc gen spec =
{ s = nsc; --NTable
g = gen;
h = spec;
lock_N = <>
};
brkN' : 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;
brkN root sg pl gen spec =
let { raw = brkN' 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 = <>
};
sdfN =
\root,sg,gen,spec ->
let { kalima = mkWord sg root;
} in mkN (sndf kalima) gen spec;
sdmN =
\root,sg,gen,spec ->
let { mucallim = mkWord sg root;
} in mkN (sndm mucallim) gen spec;
mkPN = \str,gen,species ->
{ s = \\c => str + indecl!c ;
g = gen;
h = species;
lock_PN = <>
};
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
{ s =
table {
Nom => ana;
Acc => nI;
Gen => I
};
a = {pgn = pgn; isPron = True };
lock_NP = <>
};
-- e.g. al-jamii3, 2a7ad
regNP : Str -> Number -> NP = \word,n ->
{ s = \\c => word + vowel ! c ;
a = {pgn = Per3 Masc n; isPron = False };
lock_NP = <>
};
-- e.g. hadha, dhaalika
indeclNP : Str -> Number -> NP = \word,n ->
{ s = \\c => word ;
a = {pgn = Per3 Masc n; isPron = False };
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;
isPron = False;
isNum = False;
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;
isPron = False;
isNum = False;
lock_Quant = <>
};
sndA root pat =
let raw = sndA' root pat in {
s = \\af =>
case root of {
_ + "؟" + _ => rectifyHmz(raw.s ! af);
_ => raw.s ! af
};
lock_A = <>
};
sndA' : Str -> Str -> A =
\root,pat ->
let { kabIr = mkWord pat root;
akbar = mkWord "أَفعَل" root
} in {
s = table {
APosit g n d c => (positAdj kabIr) ! g ! n ! d ! c ;
AComp d c => (indeclN akbar) ! d ! c
};
lock_A = <>
};
clrA root =
let { eaHmar = mkWord "أَفعَل" root;
HamrA' = mkWord "فَعلاء" root;
Humr = mkWord "فُعل" root
} in {
s = clr eaHmar HamrA' Humr;
lock_A = <>
};
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
mkAdv x = ss x ** {lock_Adv = <>} ;
mkAdV x = ss x ** {lock_AdV = <>} ;
mkAdA x = ss x ** {lock_AdA = <>} ;
mkPreposition p = p ;
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 = <>} ;
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_V2S = <>} ;
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
mkVA v = v ** {lock_VA = <>} ;
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
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 = <>} ;
} ;

View File

@@ -0,0 +1,104 @@
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 = "" } ;
mafcUl = { h = "مَ"; m1 = "ْ" ; m2 = "ُو" ; t = "" } ;
mafcil = { 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 = "" } ;
}

View 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 ! ResAra.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} ;
--
}

View 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
-- } ;
--
}

View 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} ;
--
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
--# -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 {
-- ya2kuluhu
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
<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} ;
}

View File

@@ -0,0 +1,110 @@
concrete StructuralAra of Structural = CatAra **
open MorphoAra, ResAra, ParadigmsAra, Prelude in {
flags optimize=all ;
lin
above_Prep = ss "فَوْقَ" ;
after_Prep = ss "بَعْدَ" ;
all_Predet = mkPredet "كُلّ" True ;
almost_AdA = ss "تَقْرِيباً";
almost_AdN = ss "حَوَالي" ; -- or "تَقرِيبا"
-- 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 "الجَمِيع" Pl ;
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 = mkPron "هُوَ" "هُ" "هُ" (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 = mkPron "أَنَا" "نِي" "ِي" (Per1 Sing);
in_Prep = ss "فِي" ;
-- it_Pron = mkPron "ِت" "ِت" "ِتس" Sg P3 ;
-- less_CAdv = ss "لسّ" ;
many_Det = mkDet "جَمِيع" Pl Const ;
-- more_CAdv = ss "مْري" ;
most_Predet = mkPredet "أَكثَر" True ;
much_Det = mkDet "الكَثِير مِنَ" Pl Const ;
-- must_VV = {
-- s = table VVForm [["بي هَثي تْ"] ; "مُست" ; ["هَد تْ"] ;
-- ["هَد تْ"] ; ["هَثِنغ تْ"] ; "مُستنءت" ; ["هَدنءت تْ"]] ; ----
-- isAux = True
-- } ;
no_Utt = {s = \\_ => "لا"} ;
on_Prep = ss "عَلى" ;
--- DEPREC one_Quant = mkQuantNum "واحِد" Sg Indef ;
only_Predet = mkPredet "فَقَط" False;
-- or_Conj = ss "ْر" ** {n = Sg} ;
-- otherwise_PConj = ss "ْتهروِسي" ;
part_Prep = ss "مِنَ" ;
-- please_Voc = ss "ةلَسي" ;
possess_Prep = ss "ل" ;
-- quite_Adv = ss "قُِتي" ;
she_Pron = mkPron "هِيَ" "ها" "ها" (Per3 Fem Sg) ;
-- 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;
----b that_NP = indeclNP "ذَلِكَ" Sg ;
there_Adv = ss "هُناك" ;
-- there7to_Adv = ss "تهري" ;
-- there7from_Adv = ss ["فرْم تهري"] ;
-- therefore_PConj = ss "تهرفْري" ;
----b these_NP = indeclNP "هَؤُلَاء" Pl ;
they_Pron = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
this_Quant = mkQuant7 "هَذا" "هَذِهِ" "هَذَان" "هَذَيْن" "هَاتَان" "هَاتَيْن" "هَؤُلَاء" Def;
----b this_NP = indeclNP "هَذا" Sg ;
----b those_NP = indeclNP "هَؤُلَاءكَ" Pl ;
through_Prep = ss "عَبْرَ" ;
-- too_AdA = ss "تّْ" ;
to_Prep = ss "إِلى" ;
under_Prep = ss "تَحْتَ" ;
-- very_AdA = ss "ثري" ;
-- want_VV = P.mkVV (P.regV "وَنت") ;
we_Pron = mkPron "نَحنُ" "نا" "نا" (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_Utt = {s = \\_ => "نَعَم"} ;
youSg_Pron = mkPron "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
youPl_Pron = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
youPol_Pron = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
}

View File

@@ -0,0 +1,44 @@
concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
flags optimize=all_subs ;
lin
UseV = predV ;
SlashV2a v = predV v ** {c2 = v.c2};
ComplSlash vp np = insertObj np vp ;
-- 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} ;
--
--
}

View File

@@ -0,0 +1,44 @@
concrete AdjectiveBul of Adjective = CatBul ** open ResBul, Prelude in {
flags coding=cp1251 ;
lin
PositA a = {
s = \\aform => a.s ! aform ;
adv = a.adv ;
isPre = True
} ;
ComparA a np = {
s = \\aform => "ïî" ++ "-" ++ a.s ! aform ++ "îò" ++ np.s ! RObj Acc ;
adv = "ïî" ++ "-" ++ a.adv ++ "îò" ++ np.s ! RObj Acc ;
isPre = True
} ;
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 a np = {
s = \\aform => a.s ! aform ++ a.c2 ++ np.s ! RObj Acc ;
adv = a.adv ++ a.c2 ++ np.s ! RObj Acc ;
isPre = True
} ;
ReflA2 a = {
s = \\aform => a.s ! aform ++ a.c2 ++ ["ñåáå ñè"] ;
adv = a.adv ++ a.c2 ++ ["ñåáå ñè"] ;
isPre = False
} ;
SentAP ap sc = {
s = \\a => ap.s ! a ++ sc.s ;
adv = ap.adv ++ sc.s ;
isPre = False
} ;
AdAP ada ap = {
s = \\a => ada.s ++ ap.s ! a ;
adv = ada.s ++ ap.adv ;
isPre = ap.isPre
} ;
UseA2 a = a ;
}

View File

@@ -0,0 +1,20 @@
concrete AdverbBul of Adverb = CatBul ** open ResBul, Prelude in {
flags coding=cp1251 ;
lin
PositAdvAdj a = {s = a.adv} ;
ComparAdvAdj cadv a np = {
s = cadv.s ++ "ïî" ++ "-" ++ a.s ! ASg Neut Indef ++ "îò" ++ np.s ! RObj Acc
} ;
ComparAdvAdjS cadv a s = {
s = cadv.s ++ "ïî" ++ "-" ++ a.s ! ASg Neut Indef ++ "îò" ++ "êîëêîòî" ++ s.s
} ;
PrepNP prep np = {s = prep.s ++ np.s ! RObj prep.c} ;
AdAdv = cc2 ;
SubjS = cc2 ;
AdnCAdv cadv = {s = cadv.sn ++ "îò"} ;
}

View File

@@ -0,0 +1,8 @@
--# -path=.:../abstract:../common:prelude
concrete Bulgarian of BulgarianAbs =
LangBul,
ExtraBul
** {
flags coding=cp1251 ;
} ;

View File

@@ -0,0 +1,8 @@
--# -path=.:../abstract:../common:prelude
abstract BulgarianAbs =
Lang,
ExtraBulAbs
** {
flags coding=cp1251 ;
} ;

View File

@@ -0,0 +1,126 @@
concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in {
flags coding=cp1251 ;
flags optimize=all_subs ;
lincat
-- Text, Phrase, Utterance
Text = {s : Str} ;
Phr = {s : Str} ;
Utt = {s : Str} ;
Voc = {s : Str} ;
PConj = {s : Str} ;
-- Tense, Anteriority, Polarity
Tense = {s : Str ; t : R.Tense} ;
Ant = {s : Str ; a : R.Anteriority} ;
Pol = {s : Str ; p : R.Polarity} ;
-- Tensed/Untensed
S = {s : Str} ;
QS = {s : QForm => Str} ;
RS = {s : GenNum => Str} ;
SC = {s : Str} ;
SSlash = {s : Agr => Str ; c2 : Preposition} ;
-- Sentence
Cl = {s : ResBul.Tense => Anteriority => Polarity => Order => Str} ;
ClSlash = {
s : Agr => ResBul.Tense => Anteriority => Polarity => Order => Str ;
c2 : Preposition
} ;
Imp = {s : Polarity => GenNum => Str} ;
-- Question
QCl = {s : ResBul.Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Role => QForm => Str; gn : GenNum} ;
IComp = {s : QForm => Str} ;
IDet = {s : DGender => QForm => Str; n : Number ; nonEmpty : Bool} ;
IQuant = {s : GenNum => QForm => Str} ;
-- Relative
RCl = {s : ResBul.Tense => Anteriority => Polarity => GenNum => Str} ;
RP = {s : GenNum => Str} ;
-- Verb
VP = ResBul.VP ;
VPSlash = ResBul.VPSlash ;
Comp = {s : Agr => Str} ;
AdV = {s : Str} ; --lock_AdV : {}} ;
-- Adjective
AP = {s : AForm => Str; adv : Str; isPre : Bool} ;
-- Adjective
Adv = {s : Str} ;
CAdv = {s : Str; sn : Str} ;
IAdv = {s : QForm => Str} ;
AdA = {s : Str} ;
-- Noun
CN = {s : NForm => Str; g : DGender} ;
NP = {s : Role => Str; a : Agr} ;
Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ;
Det = {s : DGender => Role => Str ; n : Number; countable : Bool; spec : Species} ;
Predet = {s : GenNum => Str} ;
Ord = {s : AForm => Str} ;
Num = {s : DGenderSpecies => Str; n : Number; nonEmpty : Bool} ;
Card = {s : DGenderSpecies => Str; n : Number} ;
Quant = {s : AForm => Str} ;
Art = {s : Str; spec : Species} ;
-- Numeral
Numeral = {s : CardOrd => Str; n : Number} ;
Digits = {s : CardOrd => Str; n : Number; tail : DTail} ;
AdN = {s : Str} ;
-- Structural
Conj = {s : Str; distr : Bool; conj : Bool; n : Number} ;
Subj = {s : Str} ;
Prep = {s : Str; c : Case} ;
-- Open lexical classes, e.g. Lexicon
V, VS, VQ, VA = Verb ;
V2, V2A = Verb ** {c2 : Preposition} ;
V2V, V2S, V2Q = Verb ** {c2 : Preposition} ; --- AR
V3 = Verb ** {c2, c3 : Preposition} ;
VV = Verb ;
A = {s : AForm => Str; adv : Str} ;
A2 = {s : AForm => Str; adv : Str; c2 : Str} ;
N = {s : NForm => Str; g : DGender} ;
N2 = {s : NForm => Str; g : DGender} ** {c2 : Preposition} ;
N3 = {s : NForm => Str; g : DGender} ** {c2,c3 : Preposition} ;
PN = {s : Str; g : Gender} ;
-- Tense, Anteriority and Polarity functions
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
}

View File

@@ -0,0 +1,56 @@
concrete ConjunctionBul of Conjunction =
CatBul ** open ResBul, Coordination, Prelude in {
flags coding=cp1251 ;
flags optimize=all_subs ;
lin
ConjS conj ss = {
s = (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj;
} ;
ConjAdv conj ss = {
s = (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj;
} ;
ConjNP conj ss = {
s = \\role => (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role;
a = {gn = conjGenNum (gennum DMasc conj.n) ss.a.gn; p = ss.a.p}
} ;
ConjAP conj ss = {
s = \\aform => (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!aform;
adv = (linCoordSep [])!conj.distr!conj.conj++ss.adv!conj.distr!conj.conj;
isPre = ss.isPre
} ;
-- These fun's are generated from the list cat's.
BaseS x y = {s = \\d,t=>x.s++linCoord!t++ y.s} ;
ConsS x xs = {s = \\d,t=>x.s++(linCoordSep comma)!d!t++xs.s!d!t} ;
BaseAdv x y = {s = \\d,t=>x.s++linCoord!t++ y.s} ;
ConsAdv x xs = {s = \\d,t=>x.s++(linCoordSep comma)!d!t++xs.s!d!t} ;
BaseNP x y =
{s = \\d,t,role=>x.s!role++linCoord!t++y.s!role;
a = conjAgr x.a y.a} ;
ConsNP x xs =
{s = \\d,t,role=>x.s!role++(linCoordSep comma)!d!t++xs.s!d!t!role;
a = conjAgr xs.a x.a} ;
BaseAP x y =
{s = \\d,t,aform=>x.s!aform++linCoord!t++y.s!aform;
adv= \\d,t =>x.adv ++linCoord!t++y.adv;
isPre = andB x.isPre y.isPre} ;
ConsAP x xs =
{s = \\d,t,aform=>x.s!aform++(linCoordSep comma)!d!t++xs.s!d!t!aform;
adv= \\d,t =>x.adv ++(linCoordSep comma)!d!t++xs.adv!d!t;
isPre = andB x.isPre xs.isPre} ;
lincat
[S] = {s : Bool => Bool => Str} ;
[Adv] = {s : Bool => Bool => Str} ;
[NP] = {s : Bool => Bool => Role => Str; a : Agr} ;
[AP] = {s : Bool => Bool => AForm => Str; adv : Bool => Bool => Str; isPre : Bool} ;
}

View File

@@ -0,0 +1,68 @@
concrete ExtraBul of ExtraBulAbs = CatBul **
open ResBul, Coordination, Prelude in {
flags coding=cp1251 ;
lin
PossIndefPron p = {
s = \\aform => p.gen ! (indefAForm ! aform) ;
spec = Indef
} ;
ReflQuant = {
s = \\aform => reflPron ! aform ;
spec = Indef
} ;
ReflIndefQuant = {
s = \\aform => reflPron ! (indefAForm ! aform) ;
spec = Indef
} ;
i8fem_Pron = mkPron "àç" "ìåí" "ìè" "ìîé" "ìîÿ" "ìîÿò" "ìîÿ" "ìîÿòà" "ìîå" "ìîåòî" "ìîè" "ìîèòå" (GSg Fem) P1 ;
i8neut_Pron = mkPron "àç" "ìåí" "ìè" "ìîé" "ìîÿ" "ìîÿò" "ìîÿ" "ìîÿòà" "ìîå" "ìîåòî" "ìîè" "ìîèòå" (GSg Neut) P1 ;
whatSg8fem_IP = mkIP "êàêâà" "êàêâà" (GSg Fem) ;
whatSg8neut_IP = mkIP "êàêâî" "êàêâî" (GSg Neut) ;
whoSg8fem_IP = mkIP "êîÿ" "êîãî" (GSg Fem) ;
whoSg8neut_IP = mkIP "êîå" "êîãî" (GSg Neut) ;
youSg8fem_Pron = mkPron "òè" "òåá" "òè" "òâîé" "òâîÿ" "òâîÿò" "òâîÿ" "òâîÿòà" "òâîå" "òâîåòî" "òâîè" "òâîèòå" (GSg Fem) P2 ;
youSg8neut_Pron = mkPron "òè" "òåá" "òè" "òâîé" "òâîÿ" "òâîÿò" "òâîÿ" "òâîÿòà" "òâîå" "òâîåòî" "òâîè" "òâîèòå" (GSg Neut) P2 ;
youPol8fem_Pron = mkPron "âèå" "âàñ" "âè" "âàø" "âàøèÿ" "âàøèÿò" "âàøà" "âàøàòà" "âàøå" "âàøåòî" "âàøè" "âàøèòå" (GSg Fem) P2 ;
youPol8neut_Pron = mkPron "âèå" "âàñ" "âè" "âàø" "âàøèÿ" "âàøèÿò" "âàøà" "âàøàòà" "âàøå" "âàøåòî" "âàøè" "âàøèòå" (GSg Neut) P2 ;
onePl_Num = {s = table {
DMascIndef | DMascPersonalIndef | DFemIndef | DNeutIndef => "åäíè" ;
DMascDef | DMascDefNom | DMascPersonalDef | DMascPersonalDefNom | DFemDef | DNeutDef => "åäíèòå"
} ;
n = Pl;
nonEmpty = True
} ;
UttImpSg8fem pol imp = {s = pol.s ++ imp.s ! pol.p ! GSg Fem} ;
UttImpSg8neut pol imp = {s = pol.s ++ imp.s ! pol.p ! GSg Fem} ;
oper
reflPron : AForm => Str =
table {
ASg Masc Indef => "ñâîé" ;
ASg Masc Def => "ñâîÿ" ;
ASgMascDefNom => "ñâîÿò" ;
ASg Fem Indef => "ñâîÿ" ;
ASg Fem Def => "ñâîÿòà" ;
ASg Neut Indef => "ñâîå" ;
ASg Neut Def => "ñâîåòî" ;
APl Indef => "ñâîè" ;
APl Def => "ñâîèòå"
} ;
indefAForm : AForm => AForm =
table {
ASg g _ => ASg g Indef ;
ASgMascDefNom => ASg Masc Indef ;
APl _ => APl Indef
} ;
}

View File

@@ -0,0 +1,33 @@
abstract ExtraBulAbs = Extra ** {
flags coding=cp1251 ;
fun
-- Feminine variants of pronouns (those in $Structural$ are
-- masculine, which is the default when gender is unknown).
PossIndefPron : Pron -> Quant ;
ReflQuant : Quant ;
ReflIndefQuant : Quant ;
i8fem_Pron : Pron ;
i8neut_Pron : Pron ;
whatSg8fem_IP : IP ;
whatSg8neut_IP : IP ;
whoSg8fem_IP : IP ;
whoSg8neut_IP : IP ;
youSg8fem_Pron : Pron ;
youSg8neut_Pron : Pron ;
youPol8fem_Pron : Pron ;
youPol8neut_Pron : Pron ;
onePl_Num : Num ;
UttImpSg8fem : Pol -> Imp -> Utt;
UttImpSg8neut : Pol -> Imp -> Utt;
}

View File

@@ -0,0 +1,23 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarBul of Grammar =
NounBul,
VerbBul,
AdjectiveBul,
AdverbBul,
NumeralBul,
SentenceBul,
QuestionBul,
RelativeBul,
ConjunctionBul,
PhraseBul,
TextBul,
StructuralBul,
IdiomBul
** {
flags coding=cp1251 ;
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -0,0 +1,65 @@
concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in {
flags coding=cp1251 ;
flags optimize=all_subs ;
lin
ImpersCl vp = mkClause [] (agrP3 (GSg Neut)) vp ;
GenericCl vp = mkClause "íÿêîé" (agrP3 (GSg Neut)) vp ;
CleftNP np rs =
mkClause (np.s ! RSubj)
{gn=GSg Neut; p=np.a.p}
(insertObj (\\_ => thisRP ! np.a.gn ++ rs.s ! np.a.gn) (predV verbBe)) ;
CleftAdv ad s = {s = \\t,a,p,o => case p of {Pos=>[]; Neg=>"íå"} ++ ad.s ++ s.s } ;
ExistNP np =
{ s = \\t,a,p,o =>
let verb = case p of {
Pos => mkV186 "èìàì" ;
Neg => mkV186 "íÿìàì"
} ;
agr=agrP3 (GSg Neut);
present = verb ! (VPres (numGenNum agr.gn) agr.p) ;
aorist = verb ! (VAorist (numGenNum agr.gn) agr.p) ;
perfect = verb ! (VPerfect (aform agr.gn Indef (RObj Acc))) ;
auxPres = auxBe ! VPres (numGenNum agr.gn) agr.p ;
auxAorist = auxBe ! VAorist (numGenNum agr.gn) agr.p ;
auxCondS = auxWould ! VAorist (numGenNum agr.gn) agr.p ;
v : {aux1:Str; aux2:Str; main:Str}
= case <t,a> of {
<Pres,Simul> => {aux1=[]; aux2=[]; main=present} ;
<Pres,Anter> => {aux1=[]; aux2=auxPres; main=perfect} ;
<Past,Simul> => {aux1=[]; aux2=[]; main=aorist} ;
<Past,Anter> => {aux1=[]; aux2=auxAorist; main=perfect} ;
<Fut, Simul> => {aux1="ùå"; aux2=[]; main=present} ;
<Fut, Anter> => {aux1="ùå"++auxPres; aux2=[]; main=perfect} ;
<Cond,_> => {aux1=auxCondS; aux2=[]; main=perfect}
} ;
in case o of {
Main => v.aux1 ++ v.main ++ v.aux2 ++ np.s ! RObj Acc ;
Inv => np.s ! RObj Acc ++ v.aux1 ++ v.main ++ v.aux2 ;
Quest => v.aux1 ++ v.main ++ "ëè" ++ v.aux2 ++ np.s ! RObj Acc
}
} ;
ExistIP ip =
mkQuestion {s = ip.s ! RSubj}
(mkClause "òóê" (agrP3 ip.gn) (predV verbBe)) ;
ProgrVP vp = {
s = \\_ => vp.s ! Imperf ;
ad = vp.ad ;
compl = vp.compl ;
vtype = vp.vtype
} ;
ImpPl1 vp = {s = "íåêà" ++ daComplex vp ! Perf ! {gn = GPl ; p = P1}} ;
}

View File

@@ -0,0 +1,12 @@
--# -path=.:../abstract:../common:prelude
concrete LangBul of Lang =
GrammarBul,
LexiconBul
** {
flags coding=cp1251 ;
flags startcat = Phr ; unlexer = text ; lexer = text ; erasing = on ; coding = cp1251 ;
} ;

View File

@@ -0,0 +1,380 @@
--# -path=.:prelude
concrete LexiconBul of Lexicon = CatBul **
open ParadigmsBul, ResBul, Prelude in {
flags coding=cp1251 ;
flags
optimize=values ;
lin
airplane_N = mkN007 "ñàìîëåò" ;
answer_V2S = mkV2S (actionV (mkV187 "îòãîâàðÿì") (mkV173 "îòãîâîðÿ")) naP ;
apartment_N = mkN007 "àïàðòàìåíò" ;
apple_N = mkN041 "ÿáúëêà" ;
art_N = mkN054 "èçêóñòâî" ;
ask_V2Q = mkV2Q (stateV (mkV186 "ïèòàì")) noPrep ;
baby_N = mkN065 "áåáå" ;
bad_A = mkA076 "ëîø" ;
bank_N = mkN041 "áàíêà" ;
beautiful_A = mkA076 "êðàñèâ" ;
become_VA = mkVA (actionV (mkV186 "ñòàâàì") (mkV152 "ñòàíà")) ;
beer_N = mkN041 "áèðà" ;
beg_V2V = mkV2V (stateV (mkV173 "ìîëÿ")) noPrep zaP ;
big_A = mkA081 "ãîëÿì" ;
bike_N = mkN061 "êîëåëî" ;
bird_N = mkN041 "ïòèöà" ;
black_A = mkA079 "÷åðåí" ;
blue_A = mkA086 "ñèí" ;
boat_N = mkN007 "êîðàá" ;
book_N = mkN041 "êíèãà" ;
boot_N = mkN041 "îáóâêà" ;
boss_N = mkN001 "øåô" ;
boy_N = mkN065 "ìîì÷å" ;
bread_N = mkN001 "õëÿá" ;
break_V2 = dirV2 (actionV (mkV173 "÷óïÿ") (mkV173 "ñ÷óïÿ")) ;
broad_A = mkA079 "îáøèðåí" ;
brother_N2 = prepN2 (mkN025 "áðàò") naP ;
brown_A = mkA076 "êàôÿâ" ;
butter_N = mkN054 "ìàñëî" ;
buy_V2 = dirV2 (actionV (mkV186 "êóïóâàì") (mkV173 "êóïÿ")) ;
camera_N = mkN041 "êàìåðà" ;
cap_N = mkN041 "øàïêà" ;
car_N = mkN041 "êîëà" ;
carpet_N = mkN007 "êèëèì" ;
cat_N = mkN041 "êîòêà" ;
ceiling_N = mkN007 "òàâàí" ;
chair_N = mkN001 "ñòîë" ;
cheese_N = mkN066 "ñèðåíå" ;
child_N = mkN067 "äåòå" ;
church_N = mkN041 "öúðêâà" ;
city_N = mkN001 "ãðàä" ;
clean_A = mkA076 "÷èñò" ;
clever_A = mkA079 "óìåí" ;
close_V2 = dirV2 (actionV (mkV187 "çàòâàðÿì") (mkV173 "çàòâîðÿ")) ;
coat_N = mkN054 "ïàëòî" ;
cold_A = mkA076 "ñòóäåí" ;
come_V = actionV (mkV186 "èäâàì") (table { -- special case "äîéäè", "äîéäåòå" are archaic
VImperative Sg => "åëà";
VImperative Pl => "åëàòå";
vform => mkV146a "äîéäà" ! vform}) ;
computer_N = mkN009 "êîìïþòúð" ;
country_N = mkN041 "äúðæàâà" ;
cousin_N = mkN007a "áðàòîâ÷åä" ;
cow_N = mkN041 "êðàâà" ;
die_V = actionV (mkV186 "óìèðàì") (mkV150a "óìðà") ;
dirty_A = mkA079 "ìðúñåí" ;
distance_N3 = prepN3 (mkN072 "ðàçñòîÿíèå") otP doP ;
doctor_N = mkN007a "äîêòîð" ;
dog_N = mkN065 "êó÷å" ;
door_N = mkN041 "âðàòà" ;
drink_V2 = dirV2 (stateV (mkV163 "ïèÿ")) ;
easy_A2V = mkA2V (mkA079 "ëåñåí") zaP ;
eat_V2 = dirV2 (stateV (mkV169 "ÿì")) ;
empty_A = mkA079 "ïðàçåí" ;
enemy_N = mkN001 "âðàã" ;
factory_N = mkN041 "ôàáðèêà" ;
father_N2 = prepN2 (mkN038 "áàùà") naP ;
fear_VS = mkVS (stateV (mkV186 "ñòðàõóâàì")) ;
find_V2 = dirV2 (actionV (mkV186 "íàìèðàì") (mkV173 "íàìåðÿ")) ;
fish_N = mkN041 "ðèáà" ;
floor_N = mkN007 "åòàæ" ;
fridge_N = mkN007 "ôðèçåð" ;
friend_N = mkN031a "ïðèÿòåë" ;
fruit_N = mkN001 "ïëîä" ;
fun_AV = mkAV (mkA079 "çàáàâåí") ;
forget_V2 = dirV2 (actionV (mkV187 "çàáðàâÿì") (mkV173 "çàáðàâÿ")) ;
garden_N = mkN041 "ãðàäèíà" ;
girl_N = mkN065 "ìîìè÷å" ;
glove_N = mkN041 "ðúêàâèöà" ;
gold_N = mkN054 "çëàòî" ;
good_A = adjAdv (mkA080 "äîáúð") "äîáðå" ;
go_V = actionV (mkV186 "îòèâàì") (mkV146 "îòèäà") ;
green_A = mkA076 "çåëåí" ;
harbour_N = mkN066 "ïðèñòàíèùå" ;
hate_V2 = dirV2 (stateV (mkV173 "ìðàçÿ")) ;
hat_N = mkN041 "øàïêà" ;
have_V2 = dirV2 (stateV (mkV186 "èìàì")) ;
hear_V2 = dirV2 (actionV (mkV186 "÷óâàì") (mkV163 "÷óÿ")) ;
hill_N = mkN001 "õúëì" ;
hope_VS = mkVS (medialV (stateV (mkV186 "íàäÿâàì")) Acc) ;
horse_N = mkN035 "êîí" ;
hot_A = mkA076 "ãîðåù" ;
house_N = mkN041 "êúùà" ;
important_A = mkA079 "âàæåí" ;
industry_N = mkN047 "èíäóñòðèÿ" ;
iron_N = mkN057 "æåëÿçî" ;
king_N = mkN035a "öàð" ;
know_V2 = dirV2 {
s = \\_,vform => case vform of {
VPassive aform => (mkA079 "èçâåñòåí").s ! aform ;
_ => mkV162 "çíàÿ" ! vform
} ;
vtype = VNormal ;
lock_V = <>
} ;
lake_N = mkN054 "åçåðî" ;
lamp_N = mkN041 "ëàìïà" ;
learn_V2 = dirV2 (actionV (mkV176 "ó÷à") (mkV176 "íàó÷à")) ;
leather_N = mkN041 "êîæà" ;
leave_V2 = dirV2 (actionV (mkV187 "îñòàâÿì") (mkV173 "îñòàâÿ")) ;
like_V2 = dirV2 (actionV (mkV186 "õàðåñâàì") (mkV186 "õàðåñàì")) ;
listen_V2 = dirV2 (stateV (mkV186 "ñëóøàì")) ;
live_V = stateV (mkV160 "æèâåÿ") ;
long_A = mkA080 "äúëúã" ;
lose_V2 = dirV2 (actionV (mkV173 "ãóáÿ") (mkV173 "çàãóáÿ")) ;
love_N = mkN049 "ëþáîâ" ;
love_V2 = dirV2 (stateV (mkV186 "îáè÷àì")) ;
man_N = mkN024 "ìúæ" ;
married_A2 = mkA2 (mkA076 "æåíåí") zaP ;
meat_N = mkN054 "ìåñî" ;
milk_N = mkN057 "ìëÿêî" ;
moon_N = mkN041 "ëóíà" ;
mother_N2 = prepN2 (mkN041a "ìàéêà") naP ;
mountain_N = mkN041 "ïëàíèíà" ;
music_N = mkN041 "ìóçèêà" ;
narrow_A = mkA084 "òåñåí" ;
new_A = mkA076 "íîâ" ;
newspaper_N = mkN014 "âåñòíèê" ;
oil_N = mkN065 "îëèî" ;
old_A = mkA076 "ñòàð" ;
open_V2 = dirV2 (actionV (mkV187 "îòâàðÿì") (mkV173 "îòâîðÿ")) ;
paint_V2A = mkV2A (actionV (mkV186 "ðèñóâàì") (mkV186 "íàðèñóâàì")) noPrep ;
paper_N = mkN047 "õàðòèÿ" ;
paris_PN = mkPN "Ïàðèæ" Masc ;
peace_N = mkN040a "ìèð" ;
pen_N = mkN041 "ïèñàëêà" ;
planet_N = mkN041 "ïëàíåòà" ;
plastic_N = mkN041 "ïëàñòìàñà" ;
play_V2 = dirV2 (stateV (mkV161 "èãðàÿ")) ;
policeman_N = mkN032a "ïîëèöàé" ;
priest_N = mkN014 "ñâåùåíèê" ;
probable_AS = mkAS (mkA079 "âåðîÿòåí") ;
queen_N = mkN041 "êðàëèöà" ;
radio_N = mkN054 "ðàäèî" ;
rain_V0 = mkV0 (stateV (mkV174 "âàëè")) ;
read_V2 = dirV2 (stateV (mkV145 "÷åòà")) ;
red_A = mkA076 "÷åðâåí" ;
religion_N = mkN047 "ðåëèãèÿ" ;
restaurant_N = mkN007 "ðåñòîðàíò" ;
river_N = mkN041 "ðåêà" ;
rock_N = mkN041 "ñêàëà" ;
roof_N = mkN007 "ïîêðèâ" ;
rubber_N = mkN041 "ãóìà" ;
run_V = stateV (mkV186 "áÿãàì") ;
say_VS = mkVS (actionV (mkV186 "êàçâàì") (mkV156 "êàæà")) ;
school_N = mkN066 "ó÷èëèùå" ;
science_N = mkN041 "íàóêà" ;
sea_N = mkN065 "ìîðå" ;
seek_V2 = dirV2 (stateV (mkV173 "òúðñÿ")) ;
see_V2 = dirV2 (actionV (mkV186 "âèæäàì") (mkV181 "âèäÿ")) ;
sell_V3 = dirV3 (stateV (mkV186 "ïðîäàâàì")) naP ;
send_V3 = dirV3 (actionV (mkV186 "ïðàùàì") (mkV173 "ïðàòÿ")) doP ;
sheep_N = mkN044 "îâöà" ;
ship_N = mkN007 "êîðàá" ;
shirt_N = mkN041 "ðèçà" ;
shoe_N = mkN041 "îáóâêà" ;
shop_N = mkN007 "ìàãàçèí" ;
short_A = mkA076 "êúñ" ;
silver_N = mkN054 "ñðåáðî" ;
sister_N = mkN041a "ñåñòðà" ;
sleep_V = stateV (mkV182 "ñïÿ") ;
small_A = mkA080 "ìàëúê" ;
snake_N = mkN047 "çìèÿ" ;
sock_N = mkN007 "÷îðàï" ;
speak_V2 = dirV2 (stateV (mkV173 "ãîâîðÿ")) ;
star_N = mkN041 "çâåçäà" ;
steel_N = mkN041 "ñòîìàíà" ;
stone_N = mkN017 "êàìúê" ;
stove_N = mkN041 "ïå÷êà" ;
student_N = mkN007a "ñòóäåíò" ;
stupid_A = mkA076 "ãëóïàâ" ;
sun_N = mkN066 "ñëúíöå" ;
switch8off_V2 = dirV2 (actionV (mkV186 "èçêëþ÷âàì") (mkV176 "èçêëþ÷à")) ;
switch8on_V2 = dirV2 (actionV (mkV186 "âêëþ÷âàì") (mkV176 "âêëþ÷à")) ;
table_N = mkN041 "ìàñà" ;
talk_V3 = mkV3 (stateV (mkV173 "ãîâîðÿ")) naP zaP ;
teacher_N = mkN031a "ó÷èòåë" ;
teach_V2 = dirV2 (actionV (mkV186 "ïðåïîäàâàì") (mkV168 "ïðåïîäàì")) ;
television_N = mkN047 "òåëåâèçèÿ" ;
thick_A = mkA076 "äåáåë" ;
thin_A = mkA080 "òúíúê" ;
train_N = mkN001 "âëàê" ;
travel_V = stateV (mkV186 "ïúòóâàì") ;
tree_N = mkN061 "äúðâî" ;
ugly_A = mkA076 "ãëóïàâ" ;
understand_V2 = dirV2 (actionV (mkV186 "ðàçáèðàì") (mkV170 "ðàçáåðà")) ;
university_N = mkN007 "óíèâåðñèòåò" ;
village_N = mkN054 "ñåëî" ;
wait_V2 = prepV2 (stateV (mkV186 "÷àêàì")) zaP ;
walk_V = stateV (mkV173 "õîäÿ") ;
warm_A = mkA080 "òîïúë" ;
war_N = mkN041 "âîéíà" ;
watch_V2 = dirV2 (stateV (mkV186 "ãëåäàì")) ;
water_N = mkN041 "âîäà" ;
white_A = mkA081 "áÿë" ;
window_N = mkN008 "ïðîçîðåö" ;
wine_N = mkN054 "âèíî" ;
win_V2 = dirV2 (actionV (mkV186 "ïîáåæäàâàì") (mkV174 "ïîáåäÿ")) ;
woman_N = mkN041a "æåíà" ;
wonder_VQ = mkVQ (medialV (actionV (mkV186 "ó÷óäâàì") (mkV173 "÷óäÿ")) Acc) ;
wood_N = mkN041 "äúðâåñèíà" ;
write_V2 = dirV2 (stateV (mkV159 "ïèøà")) ;
yellow_A = mkA076 "æúëò" ;
young_A = mkA076 "ìëàä" ;
do_V2 = dirV2 (actionV (mkV173 "ïðàâÿ") (mkV173 "íàïðàâÿ")) ;
now_Adv = mkAdv "ñåãà" ;
already_Adv = mkAdv "âå÷å" ;
song_N = mkN050 "ïåñåí" ;
add_V3 = dirV3 (actionV (mkV186 "ñúáèðàì") (mkV170 "ñúáåðà")) sP ;
number_N = mkN054 "÷èñëî" ;
put_V2 = prepV2 (actionV (mkV186 "ñëàãàì") (mkV176 "ñëîæà")) noPrep ;
stop_V = actionV (mkV186 "ñïèðàì") (mkV150 "ñïðà") ;
jump_V = actionV (mkV186 "ñêà÷àì") (mkV176 "ñêî÷à") ;
left_Ord = mkA081 "ëÿâ" ** {nonEmpty=True} ;
right_Ord = mkA084 "äåñåí" ** {nonEmpty=True} ;
far_Adv = mkAdv "äàëå÷å" ;
correct_A = mkA079 "ïðàâèëåí" ;
dry_A = mkA076 "ñóõ" ;
dull_A = mkA076 "òúï" ;
full_A = mkA079 "ïúëåí" ;
heavy_A = mkA080 "òåæúê" ;
near_A = mkA080 "áëèçúê" ;
rotten_A = mkA076 "ïðîãíèë" ;
round_A = mkA080 "êðúãúë" ;
sharp_A = mkA080 "îñòúð" ;
smooth_A = mkA080 "ãëàäúê" ;
straight_A = mkA081 "ïðÿê" ;
wet_A = mkA080 "ìîêúð" ; ----
wide_A = mkA076 "øèðîê" ;
animal_N = mkN062 "æèâîòíî" ;
ashes_N = mkN049 "ïåïeë" ;
back_N = mkN003 "ãðúá" ;
bark_N = mkN028 "ëàé" ;
belly_N = mkN007 "êîðåì" ;
blood_N = mkN053 "êðúâ" ;
bone_N = mkN049 "êîñò" ;
breast_N = mkN041 "ãúðäà" ;
cloud_N = mkN014 "îáëàê" ;
day_N = mkN033 "äåí" ;
dust_N = mkN001 "ïðàõ" ;
ear_N = mkN064 "óõî" ;
earth_N = mkN047 "çåìÿ" ;
egg_N = mkN066 "ÿéöå" ;
eye_N = mkN063 "îêî" ;
fat_N = mkN041 "fat" ;
feather_N = mkN038 "áàùà" ;
fingernail_N = mkN034 "íîêúò" ;
fire_N = mkN030 "îãúí" ;
flower_N = mkN068 "öâåòå" ;
fog_N = mkN041 "ìúãëà" ;
foot_N = mkN041 "ñòúïêà" ;
forest_N = mkN041 "ãîðà" ;
grass_N = mkN041 "òðåâà" ;
guts_N = mkN054 "÷åðâî" ;
hair_N = mkN041 "êîñà" ;
hand_N = mkN045 "ðúêà" ;
head_N = mkN041 "ãëàâà" ;
heart_N = mkN066 "ñúðöå" ;
horn_N = mkN001 "ðîã" ;
husband_N = mkN015 "ñúïðóã" ; -- personal
ice_N = mkN001 "ëåä" ;
knee_N = mkN058 "êîëÿíî" ;
leaf_N = mkN054 "ëèñòî" ;
leg_N = mkN022 "êðàê" ;
liver_N = mkN001 "äðîá" ;
louse_N = mkN041 "âúøêà" ;
mouth_N = mkN042 "óñòà" ;
name_N = mkN069 "èìå" ;
neck_N = mkN003 "ãðúá" ;
night_N = mkN049 "íîù" ;
nose_N = mkN001 "íîñ" ;
person_N = mkN014 "÷îâåê" ;
rain_N = mkN001 "äúæä" ;
road_N = mkN037 "ïúò" ;
root_N = mkN007 "êîðåí" ;
rope_N = mkN065 "âúæå" ;
salt_N = mkN049 "ñîë" ;
sand_N = mkN014 "ïÿñúê" ;
seed_N = mkN069 "ñåìå" ;
skin_N = mkN041 "êîæà" ;
sky_N = mkN070 "íåáå" ;
smoke_N = mkN014 "ïóøåê" ;
snow_N = mkN002 "ñíÿã" ;
stick_N = mkN041 "ïðú÷êà" ;
tail_N = mkN041 "îïàøêà" ;
tongue_N = mkN014 "åçèê" ;
tooth_N = mkN007 "çúá" ;
wife_N = mkN041 "ñúïðóãà" ;
wind_N = mkN004 "âÿòúð" ;
wing_N = mkN056 "êðèëî" ;
worm_N = mkN032 "÷åðâåé" ;
year_N = mkN041 "ãîäèíà" ;
blow_V = stateV (mkV186 "äóõàì") ;
breathe_V = dirV2 (stateV (mkV186 "äèøàì")) ;
burn_V = actionV (mkV187 "èçãàðÿì") (mkV177 "èçãîðÿ") ;
dig_V = stateV (mkV161 "êîïàÿ") ;
fall_V = actionV (mkV186 "ïàäàì") (mkV152 "ïàäíà") ;
float_V = stateV (mkV186 "ïëàâàì") ;
flow_V = stateV (mkV148 "òåêà") ;
fly_V = stateV (mkV177 "ëåòÿ") ;
freeze_V = stateV (mkV186 "çàìðúçâàì") ;
give_V3 = dirV3 (actionV (mkV186 "äàâàì") (mkV186 "äàì")) naP ;
laugh_V = medialV (stateV (mkV160 "ñìåÿ")) Acc ;
lie_V = stateV (mkV178 "ëåæà") ;
play_V = stateV (mkV161 "èãðàÿ") ;
sew_V = stateV (mkV163 "øèÿ") ;
sing_V = stateV (mkV164 "ïåÿ") ;
sit_V = stateV (mkV177 "ñåäÿ") ;
smell_V = stateV (mkV159 "ìèðèøà") ;
spit_V = stateV (mkV163 "ïëþÿ") ;
stand_V = stateV (mkV180 "ñòîÿ") ;
swell_V = actionV (mkV186 "íàäóâàì") (mkV163 "íàäóÿ") ;
swim_V = stateV (mkV186 "ïëóâàì") ;
think_V = stateV (mkV173 "ìèñëÿ") ;
turn_V = actionV (mkV186 "îáðúùàì") (mkV152 "îáúðíà") ;
vomit_V = actionV (mkV186 "ïîâðúùàì") (mkV152 "ïîâúðíà") ;
bite_V2 = dirV2 (stateV (mkV154 "õàïÿ")) ;
count_V2 = dirV2 (stateV (mkV175 "áðîÿ")) ;
cut_V2 = dirV2 (stateV (mkV157 "ðåæà")) ;
fear_V2 = dirV2 (medialV (stateV (mkV186 "ñòðàõóâàì")) Acc) ;
fight_V2 = dirV2 (medialV (stateV (mkV173 "áîðÿ")) Acc) ;
hit_V2 = dirV2 (actionV (mkV187 "óäðÿì") (mkV173 "óäàðÿ")) ;
hold_V2 = dirV2 (stateV (mkV179 "äúðæà")) ;
hunt_V2 = dirV2 (stateV (mkV174 "ëîâÿ")) ;
kill_V2 = dirV2 (actionV (mkV186 "óáèâàì") (mkV163 "óáèÿ")) ;
pull_V2 = dirV2 (stateV (mkV186 "äúðïàì")) ;
push_V2 = dirV2 (stateV (mkV186 "áóòàì")) ;
rub_V2 = dirV2 (stateV (mkV163 "òðèÿ")) ;
scratch_V2 = dirV2 (actionV (mkV186 "äðàñêàì") (mkV152 "äðàñíà")) ;
split_V2 = dirV2 (actionV (mkV187 "ðàçäåëÿì") (mkV174 "ðàçäåëÿ")) ;
squeeze_V2 = dirV2 (actionV (mkV186 "ñòèñêàì") (mkV152 "ñòèñíà")) ;
stab_V2 = dirV2 (actionV (mkV186 "ïðîìóøâàì") (mkV176 "ïðîìóøà")) ;
suck_V2 = dirV2 (stateV (mkV155 "ñó÷à")) ;
throw_V2 = dirV2 (actionV (mkV187 "õâúðëÿì") (mkV173 "õâúðëÿ")) ;
tie_V2 = dirV2 (actionV (mkV186 "âðúçâàì") (mkV156 "âúðæà")) ;
wash_V2 = dirV2 (stateV (mkV163 "ìèÿ")) ;
wipe_V2 = dirV2 (stateV (mkV159 "áúðøà")) ;
grammar_N = mkN041 "ãðàìàòèêà" ;
language_N = mkN014 "åçèê" ;
rule_N = mkN054 "ïðàâèëî" ;
john_PN = mkPN "Äæîí" Masc ;
question_N = mkN007 "âúïðîñ" ;
ready_A = mkA076 "ãîòîâ" ;
reason_N = mkN041 "ïðè÷èíà" ;
today_Adv = mkAdv "äíåñ" ;
uncertain_A = mkA079 "íåÿñåí" ;
oper
zaP = mkPrep "çà" Acc ;
naP = mkPrep [] Dat ;
otP = mkPrep "îò" Acc ;
doP = mkPrep "äî" Acc ;
sP = mkPrep (pre { "ñ" ;
"ñúñ" / strs {"ñ" ; "ç" ; "Ñ" ; "Ç"}
}) Acc ;
} ;

View File

@@ -0,0 +1,178 @@
--# -path=.:../../prelude
--1 A Simple English Resource Morphology
--
-- Aarne Ranta 2002 -- 2005
--
-- This resource morphology contains definitions needed in the resource
-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which
-- gives a higher-level access to this module.
resource MorphoBul = ResBul ** open
Predef,
Prelude,
CatBul
in {
flags coding=cp1251 ;
flags optimize=all ;
oper
--2 Determiners
mkDeterminerSg : Str -> Str -> Str -> {s : DGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako ->
{s = \\g,_ => table DGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ;
mkDeterminerPl : Str -> {s : DGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki ->
{s = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ;
mkQuant : Str -> Str -> Str -> Str -> {s : AForm => Str} = \tozi,tazi,towa,tezi -> {
s = \\aform => case aform of {
ASg Masc _ => tozi ;
ASgMascDefNom => tozi ;
ASg Fem _ => tazi ;
ASg Neut _ => towa ;
APl _ => tezi
}
} ;
--2 Verbs
mkVerb : (_,_,_,_,_,_,_,_,_:Str) -> VTable =
\cheta,chete,chetoh,chetqh,chel,chetql,cheten,chetqst,cheti ->
table {
VPres Sg P1 => cheta;
VPres Sg P2 => chete + "ø";
VPres Sg P3 => chete;
VPres Pl P1 => case chete of {
_ + ("à"|"ÿ") => chete + "ìå";
_ => chete + "ì"
};
VPres Pl P2 => chete + "òå";
VPres Pl P3 => case cheta of {
vika + "ì" => case chete of {
dad + "å" => dad + "àò";
vika => vika + "ò"
};
_ => cheta + "ò"
};
VAorist Sg P1 => chetoh;
VAorist Sg _ => case chetoh of {
chet+"îõ" => chete;
zova+ "õ" => zova
};
VAorist Pl P1 => chetoh + "ìå";
VAorist Pl P2 => chetoh + "òå";
VAorist Pl P3 => chetoh + "à";
VImperfect Sg P1 => chetqh;
VImperfect Sg _ => case chete of {
rabot + "è" => rabot + "eøå";
_ => chete + "øå"
};
VImperfect Pl P1 => chetqh + "ìå";
VImperfect Pl P2 => chetqh + "òå";
VImperfect Pl P3 => chetqh + "à";
VPerfect aform =>let chel1 : Str =
case chel of {
pas+"úë" => pas+"ë";
_ => chel
}
in (mkAdjective chel
(chel+"èÿ")
(chel+"èÿò")
(chel1+"a")
(chel1+"àòà")
(chel1+"î")
(chel1+"îòî")
(ia2e chel1+"è")
(ia2e chel1+"èòå")).s ! aform ;
VPluPerfect aform => regAdjective chetql ! aform ;
VPassive aform => regAdjective cheten ! aform ;
VPresPart aform => regAdjective chetqst ! aform ;
VImperative Sg => cheti;
VImperative Pl => case cheti of {
chet + "è" => chet + "åòå";
ela => ela + "òå"
};
VGerund => case chete of {
rabot + "è" => rabot + "åéêè";
_ => chete + "éêè"
}
} ;
--2 Nouns
mkNoun : Str -> Str -> Str -> Str -> DGender -> N = \sg,pl,count,voc,g -> {
s = table {
NF Sg Indef => sg ;
NF Sg Def => case sg of {
_+"à"=>sg+"òà" ;
_+"ÿ"=>sg+"òà" ;
_+"î"=>sg+"òî" ;
_+"å"=>sg+"òî" ;
_+"è"=>sg+"òî" ;
s+"é"=>s +"ÿ" ;
_+("òåë"|"àð"|"ÿð"|"äåí"
|"ïúò"|"îãúí"|"ñúí"
|"êîí"|"êðàë"|"öàð"
|"çåò"|"ëàêúò"|"íîêúò")
=>sg +"ÿ" ;
_ =>case g of {
DFem => sg+"òà" ;
_ => sg+"à"
}
} ;
NF Pl Indef => pl ;
NF Pl Def => case pl of {
_+"à"=>pl+"òà" ;
_+"å"=>pl+"òå" ;
_+"è"=>pl+"òå" ;
s+"ÿ"=>s +"òà" ;
s =>s +"òå"
} ;
NFSgDefNom => case sg of {
_+"à"=>sg+"òà" ;
_+"ÿ"=>sg+"òà" ;
_+"î"=>sg+"òî" ;
_+"å"=>sg+"òî" ;
_+"è"=>sg+"òî" ;
s+"é"=>s +"ÿò" ;
_+("òåë"|"àð"|"ÿð"|"äåí"
|"ïúò"|"îãúí"|"ñúí"
|"êîí"|"êðàë"|"öàð"
|"çåò"|"ëàêúò"|"íîêúò")
=>sg+"ÿò" ;
_ =>case g of {
DFem => sg+"òà" ;
_ => sg+"úò"
}
} ;
NFPlCount => count ;
NFVocative => voc
} ;
g = g ;
lock_N = <>
} ;
--2 Adjectives
mkAdjective : (_,_,_,_,_,_,_,_,_ : Str) -> A =
\dobyr,dobria,dobriat,dobra,dobrata,dobro,dobroto,dobri,dobrite -> {
s = table {
ASg Masc Indef => dobyr ;
ASg Masc Def => dobria ;
ASgMascDefNom => dobriat ;
ASg Fem Indef => dobra ;
ASg Fem Def => dobrata ;
ASg Neut Indef => dobro ;
ASg Neut Def => dobroto ;
APl Indef => dobri ;
APl Def => dobrite
} ;
adv = dobro ;
lock_A = <>
} ;
}

View File

@@ -0,0 +1,184 @@
--# -path=.:../abstract:../../prelude:../common
resource MorphoFunsBul = open
Prelude,
CatBul,
MorphoBul
in {
flags coding=cp1251 ;
oper
--2 Adverbs
-- Adverbs are not inflected. Most lexical ones have position
-- after the verb. Some can be preverbal (e.g. "always").
mkAdv : Str -> Adv = \x -> ss x ** {lock_Adv = <>} ;
mkAdV : Str -> AdV = \x -> ss x ** {lock_AdV = <>} ;
-- Adverbs modifying adjectives and sentences can also be formed.
mkAdA : Str -> AdA = \x -> ss x ** {lock_AdA = <>} ;
--2 Adjectives
--
AS, A2S, AV : Type = A ;
A2V : Type = A2 ;
mkA2 : A -> Prep -> A2 ;
mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
mkAS : A -> AS ;
mkAS v = v ** {lock_A = <>} ;
mkA2S : A -> Prep -> A2S ;
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
mkAV : A -> AV ;
mkAV v = v ** {lock_A = <>} ;
mkA2V : A -> Prep -> A2V ;
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
--2 Verbs
--
medialV : V -> Case -> V ;
medialV v c = {s = v.s; vtype = VMedial c; lock_V=<>} ;
phrasalV : V -> Case -> V ;
phrasalV v c = {s = v.s; vtype = VPhrasal c; lock_V=<>} ;
actionV : VTable -> VTable -> V ;
actionV imperf perf = {
s = table {Imperf=>imperf; Perf=>perf};
vtype = VNormal;
lock_V=<>
} ;
stateV : VTable -> V ;
stateV vtable = {
s = \\_=>vtable;
vtype = VNormal;
lock_V=<>
} ;
--3 Zero-place verbs
--
V0 : Type = V ;
mkV0 : V -> V0 ;
mkV0 v = v ** {lock_V = <>} ;
--3 Two-place verbs
--
prepV2 : V -> Prep -> V2 ;
prepV2 v p = {s = v.s; c2 = p; vtype = v.vtype; lock_V2 = <>} ;
dirV2 : V -> V2 ;
dirV2 v = prepV2 v noPrep ;
--3 Three-place verbs
--
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
mkV3 v p q = {s = v.s; s1 = v.s1; c2 = p; c3 = q; vtype = v.vtype; lock_V3 = <>} ;
dirV3 : V -> Prep -> V3 ; -- give,_,to
dirV3 v p = mkV3 v noPrep p ;
dirdirV3 : V -> V3 ; -- give,_,_
dirdirV3 v = dirV3 v noPrep ;
--3 Other verbs
--
-- V2S, V2V, V2Q : Type = V2 ;
mkV2S : V -> Prep -> V2S ;
mkV2S v p = prepV2 v p ** {lock_V2S = <>} ;
mkV2V : V -> Prep -> Prep -> V2V ;
mkV2V v p t = prepV2 v p ** {s4 = t ; lock_V2V = <>} ;
mkV2A : V -> Prep -> V2A ;
mkV2A v p = prepV2 v p ** {lock_V2A = <>} ;
mkV2Q : V -> Prep -> V2Q ;
mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ;
mkVS : V -> VS ;
mkVS v = v ** {lock_VS = <>} ;
mkVV : V -> VV ;
mkVV v = v ** {lock_VV = <>} ;
mkVA : V -> VA ;
mkVA v = v ** {lock_VA = <>} ;
mkV2A : V -> Prep -> V2A ;
mkV2A v p = prepV2 v p ** {lock_V2A = <>} ;
mkVQ : V -> VQ ;
mkVQ v = v ** {lock_VQ = <>} ;
mkV2Q : V -> Prep -> V2Q ;
mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ;
--2 Nouns
--3 Two-place Nouns
--
prepN2 : N -> Prep -> N2 ;
prepN2 n p = {s = n.s; g = n.g; c2 = p; lock_N2 = <>} ;
dirN2 : N -> N2 ;
dirN2 n = prepN2 n noPrep ;
--3 Three-place Nouns
--
prepN3 : N -> Prep -> Prep -> N3 ;
prepN3 n p q = {s = n.s; g = n.g; c2 = p; c3 = q; lock_N3 = <>} ;
dirN3 : N -> Prep -> N3 ;
dirN3 n p = prepN3 n noPrep p ;
dirdirN3 : N -> N3 ;
dirdirN3 n = dirN3 n noPrep ;
--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.
mkPrep : Str -> Case -> Prep = \p,c -> {s = p; c = c; lock_Prep = <>} ;
noPrep : Prep = mkPrep [] Acc ;
--2 Proper Names
--
mkPN : Str -> Gender -> PN ;
mkPN s g = {s = s; g = g ; lock_PN = <>} ;
--2 IAdv
--
mkIAdv : Str -> IAdv ;
mkIAdv s = {s = table {QDir=>s;QIndir=>s+"ňî"}; lock_IAdv = <>} ;
}

View File

@@ -0,0 +1,188 @@
concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
flags coding=cp1251 ;
flags optimize=all_subs ;
lin
DetCN = detCN ;
DetNP det = detCN det {s = \\_ => [] ; g = DNeut} ; ---- FIXME AR
oper
detCN :
{s : DGender => Role => Str ; n : Number; countable : Bool; spec : Species} ->
{s : NForm => Str; g : DGender} ->
{s : Role => Str; a : Agr}
=
\det,cn ->
{ s = \\role => let nf = case <det.n,det.spec> of {
<Sg,Def> => case role of {
RSubj => NFSgDefNom ;
RVoc => NFVocative ;
_ => NF Sg Def
} ;
<Sg,Indef> => case role of {
RVoc => NFVocative ;
_ => NF Sg Indef
} ;
<Pl,Def> => NF det.n det.spec ;
<Pl,Indef> => case cn.g of {
DMascPersonal => NF Pl Indef;
_ => case det.countable of {
True => NFPlCount ;
False => NF Pl Indef
}
}
} ;
s = det.s ! cn.g ! role ++ cn.s ! nf
in case role of {
RObj Dat => "íà" ++ s;
_ => s
} ;
a = {gn = gennum cn.g det.n; p = P3} ;
} ;
lin
UsePN pn = { s = \\role => case role of {
RObj Dat => "íà" ++ pn.s;
_ => pn.s
} ;
a = {gn = GSg pn.g; p = P3}
} ;
UsePron p = {s = p.s; a=p.a} ;
PredetNP pred np = {
s = \\c => pred.s ! np.a.gn ++ np.s ! c ;
a = np.a
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! Perf ! VPassive (aform np.a.gn Indef c) ;
a = np.a
} ;
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
a = np.a
} ;
DetQuant quant num = {
s = \\g,c => quant.s ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++
num.s ! dgenderSpecies g Indef c ;
n = num.n ;
countable = num.nonEmpty ;
spec=Indef
} ;
DetQuantOrd = \quant, num, ord -> {
s = \\g,c => quant.s ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++
num.s ! dgenderSpecies g Indef c ++
ord.s ! aform (gennum g num.n) Indef c ;
n = num.n ;
countable = num.nonEmpty ;
spec=Indef
} ;
DetArtCard art card = {
s = \\g,c => art.s ++
card.s ! dgenderSpecies g art.spec c ;
n = card.n ;
countable = True ;
spec=Indef
} ;
DetArtOrd art num ord = {
s = \\g,c => art.s ++
num.s ! dgenderSpecies g art.spec c ++
ord.s ! aform (gennum g num.n) (case num.nonEmpty of {False => art.spec; _ => Indef}) c ;
n = num.n ;
countable = num.nonEmpty ;
spec=Indef
} ;
DetArtPl art = detCN {
s = \\g,c => art.s ;
n = Pl ;
countable = False ;
spec=art.spec;
} ;
DetArtSg art = detCN {
s = \\g,c => art.s ;
n = Sg ;
countable = False ;
spec=art.spec;
} ;
PossPron p = {
s = p.gen
} ;
NumSg = {s = \\_ => []; n = Sg; nonEmpty = False} ;
NumPl = {s = \\_ => []; n = Pl; nonEmpty = False} ;
NumCard n = n ** {nonEmpty = True} ;
NumDigits n = {s = \\gspec => n.s ! NCard gspec; n = n.n} ;
OrdDigits n = {s = \\aform => n.s ! NOrd aform} ;
NumNumeral numeral = {s = \\gspec => numeral.s ! NCard gspec; n = numeral.n; nonEmpty = True} ;
OrdNumeral numeral = {s = \\aform => numeral.s ! NOrd aform} ;
AdNum adn num = {s = \\gspec => adn.s ++ num.s ! gspec; n = num.n; nonEmpty = num.nonEmpty} ;
OrdSuperl a = {s = \\aform => "íàé" ++ "-" ++ a.s ! aform} ;
DefArt = {
s = [] ;
spec = ResBul.Def
} ;
IndefArt = {
s = [] ;
spec = ResBul.Indef
} ;
MassNP = detCN {
s = \\_,_ => [] ;
spec = Indef ;
countable = False ; n = Sg ---- FIXME is this correct? AR
} ;
UseN noun = noun ;
UseN2 noun = noun ;
ComplN2 f x = {s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c; g=f.g} ;
ComplN3 f x = {s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c; c2 = f.c3; g=f.g} ;
Use2N3 f = {s = f.s ; g=f.g ; c2 = f.c2} ;
Use3N3 f = {s = f.s ; g=f.g ; c2 = f.c3} ;
AdjCN ap cn = {
s = \\nf => case ap.isPre of {
True => (ap.s ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
False => (cn.s ! nf) ++ (ap.s ! nform2aform (indefNForm nf) cn.g)
} ;
g = cn.g
} ;
RelCN cn rs = {
s = \\nf => cn.s ! nf ++ rs.s ! gennum cn.g (numNForm nf) ;
g = cn.g
} ;
AdvCN cn ad = {
s = \\nf => cn.s ! nf ++ ad.s ;
g = cn.g
} ;
SentCN cn sc = {s = \\nf => cn.s ! nf ++ sc.s; g=DNeut} ;
ApposCN cn np = {s = \\nf => cn.s ! nf ++ np.s ! RSubj; g=cn.g} ;
---- FIXME AR
RelNP np rs = {
s = \\r => np.s ! r ++ rs.s ! np.a.gn ; ---- gennum cn.g (numNForm nf) ;
a = np.a
} ;
}

Some files were not shown because too many files have changed in this diff Show More