forked from GitHub/gf-rgl
converted Urdu to utf8
This commit is contained in:
38
src/urdu/transliterated/IdiomUrd.gf
Normal file
38
src/urdu/transliterated/IdiomUrd.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
flags coding = utf8;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkSClause [] (agrP3 Masc Sg) vp ;
|
||||
GenericCl vp = mkSClause "kwy" (agrP3 Masc Sg) vp ;
|
||||
|
||||
CleftNP np rs =
|
||||
let cl = mkSClause (np.s ! NPC rs.c) (np.a) (predAux auxBe);
|
||||
in
|
||||
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||
|
||||
CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s};
|
||||
|
||||
ExistNP np =
|
||||
mkSClause "whaN" (agrP3 (fromAgr np.a).g (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! NPC Obl) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
let cl = mkSClause ("whaN" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe);
|
||||
in {
|
||||
s = \\t,p,qf => case qf of {
|
||||
QDir => cl.s ! t ! p ! ODir;
|
||||
QIndir => cl.s ! t! p ! ODir
|
||||
}
|
||||
};
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ;
|
||||
|
||||
|
||||
ImpPl1 vp = {s = "Aw" ++ infVP True vp (agrP1 Masc Pl)} ;
|
||||
ImpP3 np vp = {s = np.s!NPC Dir ++ "kw" ++ (vp.s ! VPImp ).inf ++ "dw"};
|
||||
|
||||
|
||||
}
|
||||
|
||||
369
src/urdu/transliterated/LexiconUrd.gf
Normal file
369
src/urdu/transliterated/LexiconUrd.gf
Normal file
@@ -0,0 +1,369 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconUrd of Lexicon = CatUrd **
|
||||
--open ResUrd, Prelude in {
|
||||
open ParadigmsUrd, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
coding = utf8;
|
||||
|
||||
lin
|
||||
airplane_N = mkN "jhaz" ;
|
||||
answer_V2S = mkV2 (compoundV "jwab" (mkV "dyna")) ;
|
||||
apartment_N = mkN "kmrh" ;
|
||||
apple_N = mkN "syb" ;
|
||||
art_N = mkN "fn" ;
|
||||
ask_V2Q = mkV2 (mkV "pwch-na") ;
|
||||
baby_N = mkN "bch" ;
|
||||
bad_A = mkA "bra" ;
|
||||
bank_N = mkN "bank" ;
|
||||
beautiful_A = mkA "KwbSwrt" ;
|
||||
become_VA = mkV "bnna";
|
||||
beer_N = mkN "beer" ;
|
||||
beg_V2V = mkV2V (compoundV "altja" (mkV "krna")) "sE" "kh" False;
|
||||
big_A = mkA "bRa" ;
|
||||
bike_N = mkN "saycl" feminine ;
|
||||
bird_N = mkN "prndh" ;
|
||||
black_A = mkA "kala" ;
|
||||
blue_A = mkA "nyla" ;
|
||||
boat_N = mkN "kXty" ;
|
||||
book_N = mkN "ktab" feminine ;
|
||||
boot_N = mkN "jwta" ;
|
||||
boss_N = mkN "Sahb" ;
|
||||
boy_N = mkN "lRka" ;
|
||||
bread_N = mkN "rwty" ;
|
||||
break_V2 = mkV2 (mkV "twRna") ;
|
||||
broad_A = mkA "kh-la" ;
|
||||
brother_N2 = mkN2 (mkN "bh-ay") (mkPrep "ka") "kE" ; --not correct
|
||||
brown_A = mkA "nswary" ;
|
||||
butter_N = mkN "mkh-n" ;
|
||||
buy_V2 = mkV2 (mkV "Krydna");
|
||||
camera_N = mkN "kymrh" ;
|
||||
cap_N = mkN "twpy" ;
|
||||
car_N = mkN "gaRy" ;
|
||||
carpet_N = mkN "tpay^y" ;
|
||||
cat_N = mkN "bly" ;
|
||||
ceiling_N = mkN "ch-t" feminine ;
|
||||
chair_N = mkN "krsy" ;
|
||||
cheese_N = mkN "pnyr" feminine ;
|
||||
child_N = mkN "bch" ;
|
||||
church_N = mkCmpdNoun "grja" (mkN "gh-r") ;
|
||||
city_N = mkN "Xhr" ;
|
||||
clean_A = mkA "Saf" ;
|
||||
clever_A = mkA "hwXyar" ;
|
||||
close_V2 = mkV2 (compoundV "bnd" do_V2);
|
||||
coat_N = mkN "kwT" ;
|
||||
cold_A = mkA "Th-nDa" ;
|
||||
come_V = mkV "Ana" ;
|
||||
computer_N = mkN "kmpywTr" ;
|
||||
country_N = mkN "mlk" ;
|
||||
cousin_N = mkCmpdNoun "cca" (mkN "zad") ; -- a compund noun made of two nouns
|
||||
cow_N = mkN "gaE" feminine ;
|
||||
die_V = mkV "mrna" ;
|
||||
dirty_A = mkA "gnda" ;
|
||||
distance_N3 = mkN3 (mkN "faSlh") (mkPrep "ka") "kE" "sE" ;
|
||||
doctor_N = mkN "mealj" ;
|
||||
dog_N = mkN "kta" ;
|
||||
door_N = mkN "drwzh" ;
|
||||
drink_V2 = mkV2 (mkV "pyna");
|
||||
easy_A2V = mkA "Asan" "" ;
|
||||
eat_V2 = mkV2 (mkV "kh-ana") "" ;
|
||||
empty_A = mkA "Kaly" ;
|
||||
enemy_N = mkN "dXmn" ;
|
||||
factory_N = mkN "karKanh" ;
|
||||
father_N2 = mkN2 (mkN "aba") (mkPrep "ka") "kE" ;
|
||||
fear_VS = mkV "drna";
|
||||
find_V2 = mkV2 (mkV "pana") ;
|
||||
fish_N = mkN "mch-ly" ;
|
||||
floor_N = mkN "frX" ;
|
||||
forget_V2 = mkV2 (mkV "bh-wlna") ;
|
||||
fridge_N = mkN "fryg" ;
|
||||
friend_N = mkN "dwst" masculine ;
|
||||
fruit_N = mkN "ph-l" ;
|
||||
-- fun_AV = mkAV (regA "fun") ;
|
||||
garden_N = mkN "baG" ;
|
||||
girl_N = mkN "lRky" ;
|
||||
glove_N = mkN "dstanh" ;
|
||||
gold_N = mkN "swna" ;
|
||||
good_A = mkA "ach-a" ;
|
||||
go_V = mkV "jana" ;
|
||||
green_A = mkA "sbz" ;
|
||||
harbour_N = mkCmpdNoun "bndr" (mkN "gah") ;
|
||||
hate_V2 = mkV2 (compoundV "nfrt" do_V2) ;
|
||||
hat_N = mkN "twpy" ;
|
||||
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
|
||||
hear_V2 = mkV2 (mkV "snna") ;
|
||||
hill_N = mkN "phaRy" ;
|
||||
hope_VS = (compoundV "amyd" do_V2);
|
||||
horse_N = mkN "gh-wRa" ;
|
||||
hot_A = mkA "grm" ;
|
||||
house_N = mkN "gh-r" ;
|
||||
important_A = mkA "ahm" ;
|
||||
industry_N = mkN "Snet" feminine ;
|
||||
iron_N = mkN "lwha" ;
|
||||
king_N = mkN "badXah" ;
|
||||
know_V2 = mkV2 (mkV "janna") ;
|
||||
know_VS = mkV "janna";
|
||||
lake_N = mkN "jh-yl" feminine ;
|
||||
lamp_N = mkN "lymp" ;
|
||||
learn_V2 = mkV2 (mkV "sykh-na") ;
|
||||
leather_N = mkN "cmRa" ;
|
||||
leave_V2 = mkV2 (mkV "jana") ;
|
||||
like_V2 = mkV2 (compoundV "psnd" do_V2);
|
||||
listen_V2 = mkV2 (mkV "snna") ;
|
||||
live_V = mkV "rhna" ; ---- touch
|
||||
long_A = mkA "lmba" ;
|
||||
lose_V2 = mkV2 (compoundV "kh-w" do_V2) ;
|
||||
love_N = mkN "mHbt" ;
|
||||
love_V2 = mkV2 (compoundV "pyar" do_V2) "kw";
|
||||
man_N = mkN "Admy" ; -- not correct according to rules should be discussed
|
||||
married_A2 = mkA "Xady krna" "sE" ;
|
||||
meat_N = mkN "gwXt" ;
|
||||
milk_N = mkN "dwdh-" ;
|
||||
moon_N = mkN "cand" ;
|
||||
mother_N2 = mkN2 (mkN "maN") (mkPrep "ky") "kE"; -- not covered need to be discussed
|
||||
mountain_N = mkN "phaRy" ;
|
||||
music_N = mkN "mwsyqy" ;
|
||||
narrow_A = mkA "baryk" ;
|
||||
new_A = mkA "nya" ;
|
||||
newspaper_N = mkN "aKbar" ;
|
||||
oil_N = mkN "tyl" ;
|
||||
old_A = mkA "bwRh-a" ;
|
||||
open_V2 = mkV2 (mkV "kh-wlna") ;
|
||||
paint_V2A = mkV2 (compoundV "rng" do_V2) ;
|
||||
paper_N = mkN "kaGz" ;
|
||||
paris_PN = mkPN "pyrs" ;
|
||||
peace_N = mkN "amn" ;
|
||||
pen_N = mkN "pnsl" ;
|
||||
planet_N = mkN "syarh" ;
|
||||
plastic_N = mkN "plasTk" ;
|
||||
play_V2 = mkV2 (mkV "kh-ylna") ;
|
||||
policeman_N = mkCmpdNoun "pwlys" (mkN "wala") ;
|
||||
priest_N = (mkN "pyGmbr") ;
|
||||
-- probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = mkN "Xhzady" ;
|
||||
radio_N = mkN "ryDyw" ;
|
||||
rain_V0 = compoundV "barX" (mkV "hwna" ) ;
|
||||
read_V2 = mkV2 (mkV "pRh-na");
|
||||
red_A = mkA "lal" ;
|
||||
religion_N = mkN "mzhb" ;
|
||||
restaurant_N = mkN "hwTl" ;
|
||||
river_N = mkN "drya" masculine ;
|
||||
rock_N = mkN "cTan" ;
|
||||
roof_N = mkN "ch-t" masculine ;
|
||||
rubber_N = mkN "rbR" ;
|
||||
run_V = mkV "dwRna" ;
|
||||
say_VS = mkV "khna" ;
|
||||
school_N = mkN "skwl" ;
|
||||
science_N = mkN "sans" ;
|
||||
sea_N = mkN "smndr" ;
|
||||
seek_V2 = mkV2 (compoundV "tlaX" do_V2) ;
|
||||
see_V2 = mkV2 (mkV "dykh-na") ;
|
||||
sell_V3 = mkV3 (mkV "bycna") "kw" "";
|
||||
send_V3 = mkV3 (mkV "bh-yjna") "kw" "";
|
||||
sheep_N = mkN "bh-yR" feminine ;
|
||||
ship_N = mkN "jhaz" ;
|
||||
shirt_N = mkN "qmyZ-" feminine;
|
||||
shoe_N = mkN "jwta" ;
|
||||
shop_N = mkN "dwkan" feminine ;
|
||||
short_A = mkA "ch-wTa" ;
|
||||
silver_N = mkN "candy" ;
|
||||
sister_N = mkN "bhn" feminine ;
|
||||
sleep_V = mkV "swna" ;
|
||||
small_A = mkA "ch-wTa" ;
|
||||
snake_N = mkN "sanp" ;
|
||||
sock_N = mkN "jrab" feminine ;
|
||||
speak_V2 = mkV2 (mkV "bwlna") ;
|
||||
star_N = mkN "stara" ;
|
||||
steel_N = mkN "styl" ;
|
||||
stone_N = mkN "pth-r" ;
|
||||
stove_N = mkN "cwlha" ;
|
||||
student_N = mkCmpdNoun "t-alb" (mkN "elm") ;
|
||||
stupid_A = mkA "aHmq" ;
|
||||
sun_N = mkN "swrj" ;
|
||||
switch8off_V2 = mkV2 (mkV "clana") ;
|
||||
switch8on_V2 = mkV2 (compoundV "bnd" do_V2) ;
|
||||
table_N = mkN "myz" feminine ;
|
||||
talk_V3 = mkV3 (mkV "bwlna") "sE" "kE barE meN";
|
||||
teacher_N = mkN "istad" ;
|
||||
teach_V2 = mkV2 (mkV "pRh-na") ;
|
||||
television_N = mkN "telywyzn" ;
|
||||
thick_A = mkA "mwTa" ;
|
||||
thin_A = mkA "ptla" ;
|
||||
train_N = mkN "gaRy" ;
|
||||
travel_V = (compoundV "sfr" do_V2) ;
|
||||
tree_N = mkN "drKt" masculine ;
|
||||
-- ---- trousers_N = mkN "trousers" ;
|
||||
ugly_A = mkA "bdSwrt" ;
|
||||
understand_V2 = mkV2 (mkV "smjh-na") ;
|
||||
university_N = mkN "ywnywrsTy" ;
|
||||
village_N = mkN "gawN" ;
|
||||
wait_V2 = mkV2 (compoundV "antz-ar" do_V2) ;
|
||||
walk_V = mkV "clna" ;
|
||||
warm_A = mkA "grm" ;
|
||||
war_N = mkN "jng" ;
|
||||
watch_V2 = mkV2 (mkV "dykh-na") ;
|
||||
water_N = mkN "pany" ; -- not covered masculine ending with y
|
||||
white_A = mkA "sfyd" ;
|
||||
window_N = mkN "kh-Rky" ;
|
||||
wine_N = mkN "Xrab" feminine ;
|
||||
win_V2 = mkV2 (mkV "jytna") ;
|
||||
woman_N = mkN "ewrt" feminine ;
|
||||
wonder_VQ = compoundV "Heran" (mkV "hwna") ;
|
||||
wood_N = mkN "lkRy" ;
|
||||
write_V2 = mkV2 (mkV "lkh-na") ;
|
||||
yellow_A = mkA "pyla" ;
|
||||
young_A = mkA "jwan" ;
|
||||
do_V2 = mkV2 (mkV "krna") ;
|
||||
now_Adv = mkAdv "ab" ;
|
||||
already_Adv = mkAdv "phlE hy" ;
|
||||
song_N = mkN "gana" ;
|
||||
add_V3 = mkV3 (compoundV "aZ-afh" do_V2) "" "" ;
|
||||
number_N = mkN "hndsh" ;
|
||||
put_V2 = mkV2 (mkV "Dalna") ;
|
||||
stop_V = mkV "rkna" ;
|
||||
jump_V = mkV "ch-langna" ;
|
||||
|
||||
left_Ord = {s = "bayaN" ; n = singular};
|
||||
right_Ord = {s= "dayaN" ; n = singular};
|
||||
far_Adv = mkAdv "dwr" ;
|
||||
correct_A = mkA "Syh" ;
|
||||
dry_A = mkA "KXk" ;
|
||||
dull_A = mkA "nalik" ;
|
||||
full_A = mkA "mkml" ;
|
||||
heavy_A = mkA "bh-ary" ;
|
||||
near_A = mkA "qryb" ;
|
||||
rotten_A = mkA "Krab" ;
|
||||
round_A = mkA "gwl" ;
|
||||
sharp_A = mkA "tyz" ;
|
||||
smooth_A = mkA "hmwar" ;
|
||||
straight_A = mkA "sydh-a" ;
|
||||
wet_A = mkA "gyla" ; ----
|
||||
wide_A = mkA "kh-la" ;
|
||||
animal_N = mkN "janwr" ;
|
||||
ashes_N = mkN "rakh-" feminine; -- FIXME: plural only?
|
||||
back_N = mkN "qmr" feminine ;
|
||||
bark_N = mkN "bark" ;
|
||||
belly_N = mkN "dh-ny" ;
|
||||
blood_N = mkN "Kwn" ;
|
||||
bone_N = mkN "hDy" ;
|
||||
breast_N = mkN "ch-aty" ;
|
||||
cloud_N = mkN "badl" ;
|
||||
day_N = mkN "dn" ;
|
||||
dust_N = mkN "dh-wl" ;
|
||||
ear_N = mkN "kan" ;
|
||||
earth_N = mkN "zmyn" feminine ;
|
||||
egg_N = mkN "anDh" ;
|
||||
eye_N = mkN "Ankh-" feminine ;
|
||||
fat_N = mkN "mwta" ;
|
||||
feather_N = mkN "pr" ;
|
||||
fingernail_N = mkN "naKn" ;
|
||||
fire_N = mkN "Ag" feminine ;
|
||||
flower_N = mkN "ph-wl" ;
|
||||
fog_N = mkN "dh-nd" feminine ;
|
||||
foot_N = mkN "pawN" ; -- not properly covered need to be discussed
|
||||
forest_N = mkN "njgl" ;
|
||||
grass_N = mkN "gh-s" feminine ;
|
||||
guts_N = mkN "gut" ; -- FIXME: no singular
|
||||
hair_N = mkN "bal" ;
|
||||
hand_N = mkN "hath-" ;
|
||||
head_N = mkN "sr" ;
|
||||
heart_N = mkN "dl" ;
|
||||
horn_N = mkN "gh-nty" ;
|
||||
husband_N = mkN "Xwhr" ;
|
||||
ice_N = mkN "brf" feminine ;
|
||||
knee_N = mkN "khny" ;
|
||||
leaf_N = mkN "pth" ;
|
||||
leg_N = mkN "tang" feminine ;
|
||||
liver_N = mkN "jgr" ;
|
||||
louse_N = mkN "gh-r" ;
|
||||
mouth_N = mkN "mnh" ;
|
||||
name_N = mkN "nam" ;
|
||||
neck_N = mkN "grdn" feminine ;
|
||||
night_N = mkN "rat" feminine ;
|
||||
nose_N = mkN "nak" ;
|
||||
person_N = mkN "XKS" ;
|
||||
rain_N = mkN "barX" feminine ;
|
||||
road_N = mkN "sRk" ;
|
||||
root_N = mkN "gR" feminine ;
|
||||
rope_N = mkN "rsy" ;
|
||||
salt_N = mkN "nmk" feminine ;
|
||||
sand_N = mkN "ryt" feminine ;
|
||||
seed_N = mkN "byj" ;
|
||||
skin_N = mkN "jld" feminine ;
|
||||
sky_N = mkN "Asman" ;
|
||||
smoke_N = mkN "dh-waN"; -- singular masc nouns ending with aN,wN yet to be implemented
|
||||
snow_N = mkN "brf" feminine ;
|
||||
stick_N = mkN "ch-Ry" ;
|
||||
tail_N = mkN "dm" ;
|
||||
tongue_N = mkN "zban" feminine ;
|
||||
tooth_N = mkN "dant" masculine;
|
||||
wife_N = mkN "bywy" ;
|
||||
wind_N = mkN "Andh-y" ;
|
||||
wing_N = mkN "pr" ;
|
||||
worm_N = mkN "grm" ;
|
||||
year_N = mkN "sal" ;
|
||||
blow_V = mkV "clna" ;
|
||||
breathe_V = compoundV "sans" (mkV "lyna" ) ;
|
||||
burn_V = mkV "jlna" ;
|
||||
dig_V = mkV "kh-wdna" ;
|
||||
fall_V = mkV "grna" ;
|
||||
float_V = mkV "tyrna" ;
|
||||
flow_V = mkV "bhna" ;
|
||||
fly_V = mkV "aRna" ;
|
||||
freeze_V = mkV "jmna";
|
||||
give_V3 = mkV3 (mkV "dyna") "kw" "";
|
||||
laugh_V = mkV "hnsna" ;
|
||||
-- lie_N = mkN "jh-wt" masculine ;
|
||||
lie_V = compoundV "jh-wt" (mkV "bwlna" );
|
||||
play_V = mkV "kh-ylna" ;
|
||||
sew_V = mkV "syna" ;
|
||||
sing_V = mkV "gana" ;
|
||||
sit_V = mkV "byTh-na" ;
|
||||
smell_V = mkV "swngna" ;
|
||||
spit_V = mkV "th-wkna" ;
|
||||
stand_V = compoundV "kh-RE" (mkV "hwna" );
|
||||
swell_V = mkV "swjh-na" ;
|
||||
swim_V = mkV "tyrna" ;
|
||||
think_V = mkV "swcna" ;
|
||||
turn_V = mkV "mRna";
|
||||
vomit_V = compoundV "alty" (mkV "krna") ;
|
||||
bite_V2 = mkV2 (mkV "katna") ;
|
||||
count_V2 = mkV2 (mkV "gnna") ;
|
||||
cut_V2 = mkV2 (mkV "katna") ;
|
||||
fear_V2 = mkV2 (mkV "Drna") ;
|
||||
fight_V2 = mkV2 (mkV "lRna") ;
|
||||
hit_V2 = mkV2 (compoundV "th-wkr" (mkV "marna" ));
|
||||
hold_V2 = mkV2 (mkV "pkRna") ;
|
||||
hunt_V2 = mkV2 (compoundV "Xkar" do_V2);
|
||||
kill_V2 = mkV2 (compoundV "mar" (mkV "Dalna" )) ;
|
||||
pull_V2 = mkV2 (mkV "kh-ncna");
|
||||
push_V2 = mkV2 (mkV "dh-kylna") "kw" ;
|
||||
rub_V2 = mkV2 (mkV "rgRna") ;
|
||||
scratch_V2 = mkV2 (mkV "kh-rcna") "kw" ;
|
||||
split_V2 = mkV2 (mkV "banta") "kw" ;
|
||||
-- squeeze_V2 = dirV2 (regV "squeeze") ;
|
||||
-- stab_V2 = dirV2 (regDuplV "stab") ;
|
||||
suck_V2 = mkV2 (mkV "cwsna") ;
|
||||
throw_V2 = mkV2 (mkV "ph-ynkna") ;
|
||||
tie_V2 = mkV2 (mkV "bandh-na") ;
|
||||
wash_V2 = mkV2 (mkV "dh-wna") ;
|
||||
wipe_V2 = mkV2 (compoundV "Saf" (mkV "krna" ));
|
||||
|
||||
---- other_A = regA "other" ;
|
||||
|
||||
grammar_N = mkN "grdan" ;
|
||||
language_N = mkN "zban" feminine ;
|
||||
rule_N = mkN "aSwl" ;
|
||||
|
||||
---- added 4/6/2007
|
||||
john_PN = mkPN "jon" ;
|
||||
question_N = mkN "swal" ;
|
||||
-- ready_A = regA "ready" ;
|
||||
reason_N = mkN "wjh" feminine ;
|
||||
today_Adv = mkAdv "Aj" ;
|
||||
uncertain_A = mkA ["Gyr yqyny"] ;
|
||||
|
||||
|
||||
}
|
||||
461
src/urdu/transliterated/MorphoUrd.gf
Normal file
461
src/urdu/transliterated/MorphoUrd.gf
Normal file
@@ -0,0 +1,461 @@
|
||||
--# -path=.:../../prelude
|
||||
--
|
||||
----1 A Simple Urdu Resource Morphology
|
||||
----
|
||||
---- Shafqat Virk, Aarne Ranta,2009
|
||||
----
|
||||
---- This resource morphology contains definitions needed in the resource
|
||||
---- syntax. To build a lexicon, it is better to use $ParadigmsUrd$, which
|
||||
---- gives a higher-level access to this module.
|
||||
--
|
||||
resource MorphoUrd = ResUrd ** open Prelude,Predef in {
|
||||
|
||||
flags optimize=all ;
|
||||
coding = utf8;
|
||||
|
||||
----2 Nouns
|
||||
oper
|
||||
mkNoun : (x1,_,_,_,_,x6 : Str) -> Gender -> Noun =
|
||||
\sd,so,sv,pd,po,pv,g -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Dir => sd ;
|
||||
Obl => so ;
|
||||
Voc => sv
|
||||
} ;
|
||||
Pl => table {
|
||||
Dir => pd ;
|
||||
Obl => po ;
|
||||
Voc => pv
|
||||
}
|
||||
} ;
|
||||
|
||||
g = g
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
regNoun : Str -> Noun ;
|
||||
regNoun s = case s of {
|
||||
_ + "ya" => mkN05 (s);
|
||||
_ + ("a"|"e"|"h") => mkN01 (s);
|
||||
_ + "y" => mkN03 (s);
|
||||
_ + ("aN"|"wN") => mkN04 (s);
|
||||
_ + "w^" => mkN12 (s);
|
||||
_ => regNoun2 (s)
|
||||
};
|
||||
regNoun2 : Str -> Noun;
|
||||
regNoun2 s = let c = if_then_else Bool (eq (last s) "a" ) True (if_then_else Bool (eq (last s) "h") True (if_then_else Bool (eq (last s) "e") True False))
|
||||
in case c of {
|
||||
False => mkN02 (s);
|
||||
True => mkN01 (s)
|
||||
};
|
||||
|
||||
reggNoun : Str -> Gender -> Noun ;
|
||||
reggNoun s g = let c = if_then_else Bool (eq (last s) "a" ) True (if_then_else Bool (eq (dp 2 s) "aN") True (if_then_else Bool (eq (dp 2 s) "wN") True False))
|
||||
in case <s,g,c> of {
|
||||
<_ + "t",Fem,_> => mkN10 (s);
|
||||
<_ + "t",Masc,_> => mkN02 (s);
|
||||
<_ + "w",Masc,_> => mkN11 (s);
|
||||
<_ + "w",Fem,_> => mkN07 (s);
|
||||
<_ + "ya",Fem,_> => mkN05 (s);
|
||||
<_ + "ya",Masc,_> => mkN02 (s);
|
||||
<_,Fem,False> => mkN08 (s);
|
||||
<_,Fem,_> => mkN09 (s)
|
||||
|
||||
};
|
||||
|
||||
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
|
||||
-- Arabic nouns ends with h. also taken as Masc
|
||||
|
||||
mkN01 : Str -> Noun ;
|
||||
mkN01 lRka = let end = last (lRka) ;
|
||||
lRk = if_then_else Str (eq end "e") lRka (tk 1 lRka)
|
||||
in mkNoun (lRka) (lRk+"E") (lRk+"E")
|
||||
(lRk+"E") (lRk+"wN") (lRk+"w")
|
||||
Masc ;
|
||||
|
||||
-- masculine nouns does not end with a, h, e, an
|
||||
|
||||
mkN02 : Str -> Noun ;
|
||||
mkN02 mrd = let mrdwN = mrd+"wN" ;
|
||||
mrdw = tk 1 mrdwN
|
||||
in mkNoun mrd mrd mrd
|
||||
mrd mrdwN mrdw
|
||||
Masc ;
|
||||
|
||||
-- feminine Nouns end with y
|
||||
|
||||
mkN03 : Str -> Noun ;
|
||||
mkN03 krsy = let krsyaN = krsy+"aN" ;
|
||||
krsywN = krsy+"wN" ;
|
||||
krsyw = tk 1 krsywN
|
||||
in mkNoun krsy krsy krsy
|
||||
krsyaN krsywN krsyw
|
||||
Fem ;
|
||||
|
||||
-- feminine nouns end with a, aN, wN
|
||||
mkN04 : Str -> Noun ;
|
||||
mkN04 n = case last n of {
|
||||
"a" => let bla = n
|
||||
in mkNoun bla bla bla
|
||||
(bla+"y^yN") (bla+"w^N") (bla+"w^")
|
||||
Fem ;
|
||||
_ => let maN = n ; -- ends with aN and wN
|
||||
ma = tk 1 maN
|
||||
in mkNoun maN maN maN
|
||||
(ma+"y^yN") (ma+"w^N") (ma+"w^N")
|
||||
Fem
|
||||
|
||||
};
|
||||
--feminine nouns end with ya
|
||||
|
||||
mkN05 : Str -> Noun ;
|
||||
mkN05 gRya = let gRy = (tk 1 gRya)
|
||||
in mkNoun gRya gRya gRya
|
||||
(gRya+"N") (gRy+"wN") (gRy+"w")
|
||||
Fem ;
|
||||
|
||||
-- feminine nouns end with w
|
||||
|
||||
mkN07 : Str -> Noun ;
|
||||
mkN07 khshbw = mkNoun khshbw khshbw khshbw
|
||||
(khshbw + "y^yN") (khshbw + "w^N") (khshbw + "w^")
|
||||
Fem ;
|
||||
|
||||
-- Loan arabic feminine nouns end with t
|
||||
-- this is a noun that shows state, condition
|
||||
|
||||
mkN10 : Str -> Noun ;
|
||||
mkN10 ndamt = mkNoun ndamt ndamt ndamt
|
||||
(ndamt+"yN") (ndamt+"wN") (ndamt+"w")
|
||||
Fem ;
|
||||
-- Worst case function
|
||||
mkN : (_,_,_,_,_,_ : Str) -> Gender -> Noun ;
|
||||
mkN sgNom sgObl sgVoc plNom plObl plVoc g =
|
||||
mkNoun sgNom sgObl sgVoc plNom plObl plVoc g ;
|
||||
|
||||
mkN06 : Str -> Noun ;
|
||||
mkN06 rya = mkNoun rya rya rya
|
||||
(rya+"y^yN") (rya+"w^N") rya
|
||||
Fem ;
|
||||
|
||||
-- feminine nouns that do not end with a, N, w, wN
|
||||
|
||||
mkN08 : Str -> Noun ;
|
||||
mkN08 ktab = mkNoun ktab ktab ktab
|
||||
(ktab+"yN") (ktab+"wN") (ktab+"w")
|
||||
Fem ;
|
||||
|
||||
-- Loan arabic feminine nouns
|
||||
|
||||
mkN09 : Str -> Noun ;
|
||||
mkN09 ahsan = mkNoun ahsan ahsan ahsan
|
||||
(ahsan+"at") (ahsan+"at") (ahsan+"w")
|
||||
Fem ;
|
||||
-- (variants{ahsan+"at";ahsan+"wN"})
|
||||
-- Loan persian maculine nouns end with w
|
||||
|
||||
mkN11 : Str -> Noun ;
|
||||
mkN11 alw = mkNoun alw alw alw
|
||||
alw (alw+"w^N") (alw+"w^")
|
||||
Masc ;
|
||||
|
||||
|
||||
-- Loan persian maculine nouns end with w^
|
||||
|
||||
mkN12 : Str -> Noun ;
|
||||
mkN12 bhao = mkNoun (bhao) (bhao) (bhao)
|
||||
(bhao) (bhao) (bhao)
|
||||
Masc ;
|
||||
----2 Determiners
|
||||
IDeterminer = {s:Gender => Str ; n : Number};
|
||||
makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => s1 ;
|
||||
Fem => s2
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => s3 ;
|
||||
Fem => s4
|
||||
}
|
||||
} ;
|
||||
|
||||
n = n
|
||||
};
|
||||
|
||||
makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> {
|
||||
s = table {
|
||||
Masc => s1;
|
||||
Fem => s2
|
||||
};
|
||||
n = n
|
||||
};
|
||||
|
||||
-- Proposition
|
||||
|
||||
makePrep : Str -> Preposition = \str -> {s = str};
|
||||
|
||||
----2 Pronouns
|
||||
PronForm = {s:Pronoun => Str};
|
||||
makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm =
|
||||
\y1,y2,y3,y4,y5,y6 -> {
|
||||
s = table {
|
||||
P Sg _ Dir _ => y1;
|
||||
P Sg _ Obl _ => y2;
|
||||
P Sg _ Voc _ => y3;
|
||||
P Pl _ Dir _ => y4;
|
||||
P Pl _ Obl _ => y5;
|
||||
P Pl _ Voc _ => y6
|
||||
};
|
||||
};
|
||||
|
||||
-- DemonPronForm = {s:DemPronForm => Str};
|
||||
mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12:Str) -> DemPronForm =
|
||||
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12 -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => table {
|
||||
Dir => y1 ;
|
||||
Obl => y2 ;
|
||||
Voc => y3
|
||||
};
|
||||
Fem => table {
|
||||
Dir => y4 ;
|
||||
Obl => y5 ;
|
||||
Voc => y6
|
||||
}
|
||||
};
|
||||
Pl => table {
|
||||
Masc => table {
|
||||
Dir => y7 ;
|
||||
Obl => y8 ;
|
||||
Voc => y9
|
||||
};
|
||||
Fem => table {
|
||||
Dir => y10 ;
|
||||
Obl => y11 ;
|
||||
Voc => y12
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
makeDemonPronForm : Str -> Str -> Str -> DemPronForm ;
|
||||
makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn "";
|
||||
-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary;
|
||||
|
||||
PersPron = {s: PersPronForm => Str};
|
||||
|
||||
mkPersPron:(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> PersPron =
|
||||
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> {
|
||||
s =
|
||||
table {
|
||||
PPF Sg Pers1 Dir => y1;
|
||||
PPF Sg Pers1 Obl => y2;
|
||||
PPF Sg Pers1 Voc => y3;
|
||||
PPF Sg Pers2_Casual Dir => y4;
|
||||
PPF Sg Pers2_Casual Obl => y5;
|
||||
PPF Sg Pers2_Casual Voc => y6;
|
||||
PPF Sg Pers2_Familiar Dir => y7;
|
||||
PPF Sg Pers2_Familiar Obl => y8;
|
||||
PPF Sg Pers2_Familiar Voc => y9;
|
||||
PPF Sg Pers2_Respect Dir => y10;
|
||||
PPF Sg Pers2_Respect Obl => y11;
|
||||
PPF Sg Pers2_Respect Voc => y12;
|
||||
PPF Sg Pers3_Near Dir => y13;
|
||||
PPF Sg Pers3_Near Obl => y14;
|
||||
PPF Sg Pers3_Near Voc => y15;
|
||||
PPF Sg Pers3_Distant Dir => y16;
|
||||
PPF Sg Pers3_Distant Obl => y17;
|
||||
PPF Sg Pers3_Distant Voc => y18;
|
||||
PPF Pl Pers1 Dir => y19;
|
||||
PPF Pl Pers1 Obl => y20;
|
||||
PPF Pl Pers1 Voc => y21;
|
||||
PPF Pl Pers2_Casual Dir => y22;
|
||||
PPF Pl Pers2_Casual Obl => y23;
|
||||
PPF Pl Pers2_Casual Voc => y24;
|
||||
PPF Pl Pers2_Familiar Dir => y25;
|
||||
PPF Pl Pers2_Familiar Obl => y26;
|
||||
PPF Pl Pers2_Familiar Voc => y27;
|
||||
PPF Pl Pers2_Respect Dir => y28;
|
||||
PPF Pl Pers2_Respect Obl => y29;
|
||||
PPF Pl Pers2_Respect Voc => y30;
|
||||
PPF Pl Pers3_Near Dir => y31;
|
||||
PPF Pl Pers3_Near Obl => y32;
|
||||
PPF Pl Pers3_Near Voc => y33;
|
||||
PPF Pl Pers3_Distant Dir => y34;
|
||||
PPF Pl Pers3_Distant Obl => y35;
|
||||
PPF Pl Pers3_Distant Voc => y36
|
||||
};
|
||||
};
|
||||
|
||||
makePersPron : PersPron;
|
||||
makePersPron = mkPersPron "m(a)yN" "m(o)j'|h" "" "t(o)w " "t(o)j|h" "t(o)w " "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)s" "" "w(o)h" "a(o)s" ""
|
||||
"h(a)m" "h(a)m" "" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)n" "" "w(o)h" "a(o)n" "" ;
|
||||
|
||||
mkPron : (x1,x2,x3:Str) -> {s:Case => Str} =
|
||||
\y1,y2,y3 -> { s =
|
||||
table {
|
||||
Dir => y1;
|
||||
Obl => y2;
|
||||
Voc => y3
|
||||
}
|
||||
};
|
||||
|
||||
------- PossPronForm yet to be implemented
|
||||
|
||||
-- IntPronForm = {s:InterrPronForm => Str};
|
||||
IntPronForm = {s: Case => Str};
|
||||
mkIntPronForm : (x1,x2,x3:Str) -> IntPronForm =
|
||||
\y1,y2,y3 -> {
|
||||
s =
|
||||
table {
|
||||
Dir => y1;
|
||||
Obl => y2;
|
||||
Voc => y3
|
||||
}
|
||||
};
|
||||
|
||||
----2 Adjectives
|
||||
-- defined in ResUrd
|
||||
|
||||
----3 Verbs
|
||||
CommonVF = {s : VTense => UPerson => Number => Gender => Str} ;
|
||||
|
||||
mkVerb : (x1: Str) -> Verb = \inf ->
|
||||
let root = (tk 2 inf); inf_obl = ((tk 1 inf) + "E"); inf_fem = ((tk 1 inf) + "y")
|
||||
in { s = table {
|
||||
|
||||
VF tense person number gender => (mkCmnVF root tense person number gender).s ;
|
||||
Inf => inf ;
|
||||
Root => root ;
|
||||
Inf_Obl => inf_obl ;
|
||||
Inf_Fem => inf_fem
|
||||
|
||||
|
||||
}
|
||||
} ;
|
||||
rem_y : Str -> Str;
|
||||
rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str)
|
||||
in rt st;
|
||||
rt: Str -> Str;
|
||||
rt r = r;
|
||||
mkCmnVF : Str -> VTense -> UPerson -> Number -> Gender -> {s:Str} =
|
||||
\root,t,p,n,g ->
|
||||
{s =
|
||||
let form1 = case (last root) of {
|
||||
"a"|"A"|"w" => root + "w^N" ;
|
||||
_ => root + "wN"
|
||||
};
|
||||
form2 = case (last root) of {
|
||||
"a"|"A"|"w" => root + "y^N" ;
|
||||
_ => root + "yN"
|
||||
};
|
||||
in
|
||||
case <t,p,n,g> of {
|
||||
<Subj,Pers1,Sg,_> => form1 ;
|
||||
<Subj,Pers1,Pl,_> => form2 ;
|
||||
<Subj,_,_,_> => (mkImpert root p n g).s ;
|
||||
<Perf,_,_,_> => case root of {
|
||||
"hw" => (mkPastInd root p n g).s ;
|
||||
"ja" => (mkPastInd "gy" p n g).s ;
|
||||
"kr" => (mkPastInd "k" p n g).s ;
|
||||
"dE" => (mkPastInd "d" p n g).s ;
|
||||
"lE" => (mkPastInd "l" p n g).s ;
|
||||
_ => (mkPastInd root p n g).s };
|
||||
<Imperf,Pers2_Familiar,Sg,Masc> => root + "tE";
|
||||
<Imperf,Pers2_Familiar,Sg,Fem> => root + "ty"; --variants{root+"ty" ; root+"tyN"};
|
||||
<Imperf,Pers2_Familiar,Pl,Masc> => root + "tE";
|
||||
<Imperf,Pers2_Familiar,Pl,Fem> => root+"tyN";
|
||||
<Imperf,Pers2_Respect,Sg,Masc> => root + "tE";
|
||||
<Imperf,Pers2_Respect,Sg,Fem> => root + "ty"; --variants{root+"ty" ; root+"tyN"};
|
||||
<Imperf,Pers2_Respect,Pl,Masc> => root + "tE";
|
||||
<Imperf,Pers2_Respect,Pl,Fem> => root+"tyN";
|
||||
<Imperf,_,Sg,Masc> => root+"ta";
|
||||
<Imperf,_,Sg,Fem> => root+"ty";
|
||||
<Imperf,_,Pl,Masc> => root+"te";
|
||||
<Imperf,_,Pl,Fem> => root+"tyN"
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g ->
|
||||
{s = let roo = root ;
|
||||
a = case (last root) of {
|
||||
"a"|"A"|"w"|"k" => "ya" ;
|
||||
_ => "a"
|
||||
} ;
|
||||
y = case (last root) of {
|
||||
"a"|"A"|"w" => "y^y" ;
|
||||
_ => "y"
|
||||
} ;
|
||||
e = case (last root) of {
|
||||
"a"|"A"|"w"|"k" => "y^E" ;
|
||||
_ => "E"
|
||||
} ;
|
||||
yN = case (last root) of {
|
||||
"a"|"A"|"w" => "y^yN" ;
|
||||
_ => "yN"
|
||||
} ;
|
||||
|
||||
in
|
||||
case <p,n,g> of {
|
||||
<Pers1,Sg,Masc> => roo+a ;
|
||||
<Pers1,Sg,Fem> => roo+y ;
|
||||
<Pers1,Pl,Masc> => roo+e ;
|
||||
<Pers1,Pl,Fem> => roo+yN ;
|
||||
|
||||
<Pers2_Casual,Sg,Masc> => roo+a ;
|
||||
<Pers2_Casual,Sg,Fem> => roo+y ;
|
||||
<Pers2_Casual,Pl,Masc> => roo+e ;
|
||||
<Pers2_Casual,Pl,Fem> => roo+yN ;
|
||||
|
||||
<Pers2_Familiar,Sg,Masc> => roo+e ;
|
||||
<Pers2_Familiar,Sg,Fem> => roo+y; --variants{roo+y ; roo+yN} ;
|
||||
<Pers2_Familiar,Pl,Masc> => roo+e ;
|
||||
<Pers2_Familiar,Pl,Fem> => roo+yN ;
|
||||
|
||||
<Pers2_Respect,Sg,Masc> => roo+e ;
|
||||
<Pers2_Respect,Sg,Fem> => roo+yN; --variants{roo+yN ; roo+y} ;
|
||||
<Pers2_Respect,Pl,Masc> => roo+e ;
|
||||
<Pers2_Respect,Pl,Fem> => roo+yN ;
|
||||
<_,Sg,Masc> => roo + a;
|
||||
<_,Sg,Fem> => roo+y ;
|
||||
<_,Pl,Masc> => roo + e;
|
||||
<_,Pl,Fem> => roo+yN
|
||||
|
||||
} ;
|
||||
} ;
|
||||
|
||||
mkImpert : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g ->
|
||||
{s = let roo = root ;
|
||||
w = case (last root) of {
|
||||
"a"|"A"|"w" => "w^" ;
|
||||
_ => "w"
|
||||
} ;
|
||||
yN = case (last root) of {
|
||||
"a"|"A"|"w" => "y^yN" ;
|
||||
_ => "yN"
|
||||
} ;
|
||||
yE = case (last root) of {
|
||||
"a"|"A"|"w" => "y^yE" ;
|
||||
_ => "yE"
|
||||
} ;
|
||||
e = case (last root) of {
|
||||
"a"|"A"|"w" => "y^E" ;
|
||||
_ => "E"
|
||||
} in
|
||||
case <p,n,g> of {
|
||||
<Pers1,_,_> => ""; --nonExist ;
|
||||
<Pers2_Casual,Sg,_> => root ;
|
||||
<Pers2_Casual,Pl,_> => roo+w ;
|
||||
<Pers2_Familiar,_,_> => roo+w ;
|
||||
<Pers2_Respect,Sg,_> => roo+w; --variants{roo+w; roo+yN; roo+yE} ;
|
||||
<Pers2_Respect,Pl,_> => roo+yN; --variants{roo+yN; roo+yE} ;
|
||||
<_,Sg,_> => roo+e ;
|
||||
<_,Pl,_> => roo+yN
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
127
src/urdu/transliterated/NumeralUrd.gf
Normal file
127
src/urdu/transliterated/NumeralUrd.gf
Normal file
@@ -0,0 +1,127 @@
|
||||
concrete NumeralUrd of Numeral = CatUrd ** open ResUrd in {
|
||||
-- By Harald Hammarström
|
||||
-- Modification for Urdu Shafqat Virk
|
||||
flags coding=utf8 ;
|
||||
--- still old Devanagari coding
|
||||
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||
param Size = sing | less100 | more100 ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||
|
||||
|
||||
lincat Dig = { s:Str ; n : Number};
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ;
|
||||
lincat Sub100 = {s : Str ; size : Size ; n : Number} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ;
|
||||
lincat Sub1000000 = { s : Str ; n : Number } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = table {
|
||||
NCard => x0.s ;
|
||||
NOrd => x0.s ++ "waN" -- need to use mkOrd which will make irregular ordinals but it gives path error
|
||||
};
|
||||
n = x0.n
|
||||
} ;
|
||||
oper mkOrd : Str -> Str =
|
||||
\s -> case s of {
|
||||
"ek" => "phla";
|
||||
"do" => "dwsra";
|
||||
"ti:n" => "tesra";
|
||||
"ca:r" => "cwth-a";
|
||||
("cHah"|"cHa"|"cHai") => "ch-Ta";
|
||||
_ => s ++ "waN"
|
||||
};
|
||||
-- {s = \\_ => x0.s ; n = x0.n} ;
|
||||
|
||||
|
||||
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||
\do -> \bis -> \sz ->
|
||||
{s = table {unit => do ; ten => bis } ;
|
||||
size = sz ; n = Pl} ;
|
||||
|
||||
lin n2 = mkNum "dw" "bys" r2 ;
|
||||
lin n3 = mkNum "tyn" "tys" r3 ;
|
||||
lin n4 = mkNum "car" "calys" r4 ;
|
||||
lin n5 = mkNum "panc" "pcas" r5 ;
|
||||
lin n6 = mkNum "ch-" "sath-" r6 ;
|
||||
lin n7 = mkNum "sat" "str" r7;
|
||||
lin n8 = mkNum "Ath-" "asy" r8;
|
||||
lin n9 = mkNum "nw" "nwE" r9 ;
|
||||
|
||||
oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table {
|
||||
sg => a1 + "ah" ;
|
||||
r2 => a2 + "i:s" ;
|
||||
r3 => a3 + "ti:s" ;
|
||||
r4 => a4 + "a:li:s" ;
|
||||
r5 => a5 + "an" ;
|
||||
r6 => a6 + "saTH" ;
|
||||
r7 => a7 + "hattar" ;
|
||||
r8 => a8 + "a:si:" ;
|
||||
r9 => a9 + "a:nave"
|
||||
} ;
|
||||
|
||||
oper rows : DSize => DSize => Str = table {
|
||||
sg => mkR "gyarh" "ikk" "ikat" "ekt" "ikyaw" "ik" "ik" "iky" "iky" ;
|
||||
r2 => mkR "barh" "bay" "bat" "bay" "baw" "ba" "ba" "bay" "b" ;
|
||||
r3 => mkR "tyr" "ty" "tyn" "tnt" "trp" "try" "t" "tr" "tr" ;
|
||||
r4 => mkR "cwd" "cwb" "cwn" "cwa" "cww" "cwn" "cwh" "cwr" "cwr" ;
|
||||
r5 => mkR "pnd" "pcy" "pyn" "pnta" "pcp" "pyn" "ph" "pc" "pc" ;
|
||||
r6 => mkR "swl" "ch-b" "ch-t" "ch-y" "ch-p" "ch-ya" "ch-" "ch-y" "ch-y" ;
|
||||
r7 => mkR "str" "sta" "syn" "snt" "staw" "sta" "sr" "st" "sta" ;
|
||||
r8 => mkR "ath-ar" "ath-ay" "aR" "aRt" "ath-aw" "aR" "ath-" "ath-" "ath-" ;
|
||||
r9 => table {sg => "anys" ; r2 => "antys" ; r3 => "antalys" ;
|
||||
r4 => "ancas" ; r5 => "ansth-" ; r6 => "anhtr" ;
|
||||
r7 => "anasy" ;
|
||||
r8 => "ananwE" ; r9 => "nnanwE" }
|
||||
} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "ayk" ; _ => "dummy" } ; size = sg ; n = Sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "das" ; size = less100 ; n = Pl} ;
|
||||
lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ;
|
||||
lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size ; n = n.n } ;
|
||||
|
||||
lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ;
|
||||
lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ;
|
||||
|
||||
lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size ; n = n.n} ;
|
||||
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||
s2 = d.s ! unit ++ "lakh-" ; size = more100 ; n = d.n} ;
|
||||
lin pot2plus d e =
|
||||
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||
s2 = (d.s ! unit) ++ "lakh-" ++ (mkhazar e.s e.size) ;
|
||||
size = more100 ; n = d.n} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s ; n = n.n} ;
|
||||
lin pot3 n = {s = table { sing => ekhazar ;
|
||||
less100 => n.s ++ "hzar" ;
|
||||
more100 => n.s2 } ! n.size ; n = n.n} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sing => ekhazar ;
|
||||
less100 => n.s ++ "hzar" ;
|
||||
more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ;
|
||||
|
||||
lin D_0 = { s = "0" ; n = Sg};
|
||||
lin D_1 = { s = "1" ; n = Sg};
|
||||
lin D_2 = { s = "2" ; n = Pl};
|
||||
lin D_3 = { s = "3" ; n = Pl};
|
||||
lin D_4 = { s = "4" ; n = Pl};
|
||||
lin D_5 = { s = "5" ; n = Pl};
|
||||
lin D_6 = { s = "6" ; n = Pl};
|
||||
lin D_7 = { s = "7" ; n = Pl};
|
||||
lin D_8 = { s = "8" ; n = Pl};
|
||||
lin D_9 = { s = "9" ; n = Pl};
|
||||
lin IDig d = { s = \\_ => d.s ; n = d.n} ;
|
||||
lin IIDig d dg = { s = \\df => dg.s ! df ++ d.s ; n = Pl }; -- need to use + rather than ++, but gives error need to discuss
|
||||
|
||||
oper ekhazar : Str = variants {"hzar" ; "ayk" ++ "hzar"} ;
|
||||
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "hzar"} ! sz ;
|
||||
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sw" ; _ => s ++ "sw"} ! sz ;
|
||||
}
|
||||
641
src/urdu/transliterated/ResUrd.gf
Normal file
641
src/urdu/transliterated/ResUrd.gf
Normal file
@@ -0,0 +1,641 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
--
|
||||
--1 Urdu auxiliary operations.
|
||||
--
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work.
|
||||
|
||||
resource ResUrd = ParamX ** open Prelude,Predef in {
|
||||
|
||||
flags optimize=all ;
|
||||
coding = utf8;
|
||||
|
||||
param
|
||||
Case = Dir | Obl | Voc ;
|
||||
Gender = Masc | Fem ;
|
||||
VTense = Subj | Perf | Imperf;
|
||||
UPerson = Pers1
|
||||
| Pers2_Casual
|
||||
| Pers2_Familiar
|
||||
| Pers2_Respect
|
||||
| Pers3_Near
|
||||
| Pers3_Distant;
|
||||
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg Agr ;
|
||||
RCase = RC Number Case ;
|
||||
|
||||
-- for Numerial
|
||||
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
-----------------------------------------
|
||||
-- Urd Pronouns
|
||||
-----------------------------------------
|
||||
|
||||
Pronoun = P Number Gender Case UPerson;
|
||||
PersPronForm = PPF Number UPerson Case;
|
||||
|
||||
-------------------------------------------
|
||||
--Verbs
|
||||
-------------------------------------------
|
||||
|
||||
VerbForm = VF VTense UPerson Number Gender
|
||||
| Inf
|
||||
| Root
|
||||
| Inf_Obl
|
||||
| Inf_Fem;
|
||||
oper
|
||||
Noun = {s : Number => Case => Str ; g : Gender} ;
|
||||
Verb = {s : VerbForm => Str} ;
|
||||
Preposition = {s : Str};
|
||||
DemPronForm = {s : Number => Gender => Case => Str};
|
||||
PossPronForm = {s : Number => Gender => Case => Str};
|
||||
Determiner = {s : Number => Gender => Str ; n : Number};
|
||||
|
||||
-- a useful oper
|
||||
eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ;
|
||||
|
||||
-----------------------------------------------
|
||||
-- Urd Adjectives
|
||||
-----------------------------------------------
|
||||
|
||||
Adjective = { s: Number => Gender => Case => Degree => Str };
|
||||
|
||||
|
||||
mkAdjective : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> Adjective =
|
||||
\y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => table {
|
||||
Dir => table {
|
||||
Posit => y1 ;
|
||||
Compar => y2 ;
|
||||
Superl => y3
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y4 ;
|
||||
Compar => y5 ;
|
||||
Superl => y6
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y7 ;
|
||||
Compar => y8 ;
|
||||
Superl => y9
|
||||
}
|
||||
};
|
||||
Fem => table {
|
||||
Dir => table {
|
||||
Posit => y10 ;
|
||||
Compar => y11 ;
|
||||
Superl => y12
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y13 ;
|
||||
Compar => y14 ;
|
||||
Superl => y15
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y16 ;
|
||||
Compar => y17 ;
|
||||
Superl => y18
|
||||
}
|
||||
}
|
||||
};
|
||||
Pl => table {
|
||||
Masc => table {
|
||||
Dir => table {
|
||||
Posit => y19 ;
|
||||
Compar => y20 ;
|
||||
Superl => y21
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y22 ;
|
||||
Compar => y23 ;
|
||||
Superl => y24
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y25 ;
|
||||
Compar => y26 ;
|
||||
Superl => y27
|
||||
}
|
||||
};
|
||||
Fem => table {
|
||||
Dir => table {
|
||||
Posit => y28 ;
|
||||
Compar => y29 ;
|
||||
Superl => y30
|
||||
};
|
||||
Obl => table {
|
||||
Posit => y31 ;
|
||||
Compar => y32 ;
|
||||
Superl => y33
|
||||
};
|
||||
Voc => table {
|
||||
Posit => y34 ;
|
||||
Compar => y35 ;
|
||||
Superl => y36
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
regAdjective : Str -> Adjective;
|
||||
regAdjective x = case x of {
|
||||
acch + ("a"|"aN") => mkAdjective x ("bht" ++ x) ("sab sE" ++ x) (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y")
|
||||
(acch +"E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E")
|
||||
(acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y");
|
||||
|
||||
_ => mkAdjective x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
x x x x x x x x x
|
||||
};
|
||||
|
||||
|
||||
|
||||
RefPron : Str;
|
||||
RefPron = "Kwd";
|
||||
|
||||
----------------------------------------------------------
|
||||
-- Grammar part
|
||||
----------------------------------------------------------
|
||||
|
||||
param
|
||||
Agr = Ag Gender Number UPerson ;
|
||||
NPCase = NPC Case | NPObj | NPErg ;
|
||||
|
||||
oper
|
||||
np2pronCase : (Case => Str) -> NPCase -> Str = \ppf,npc -> case npc of {
|
||||
NPC c => ppf ! c;
|
||||
NPObj => ppf ! Dir ;
|
||||
NPErg => ppf ! Obl ++ "ne"
|
||||
} ;
|
||||
|
||||
toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of {
|
||||
NPC c => pn ! c ;
|
||||
NPObj => pn ! Dir ;
|
||||
NPErg => pn ! Obl ++ "ne"
|
||||
} ;
|
||||
detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of {
|
||||
NPC c => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ;
|
||||
NPObj => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ;
|
||||
NPErg => dt.s ! Sg ! Masc ++ cn.s ! nn ! Obl ++ "ne"
|
||||
} ;
|
||||
det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of {
|
||||
NPC c => dt.s ! Sg ! Masc ;
|
||||
NPObj => dt.s ! Sg ! Masc ;
|
||||
NPErg => dt.s ! Sg ! Masc ++ "ne"
|
||||
} ;
|
||||
|
||||
------------------------------------------
|
||||
-- Agreement transformations
|
||||
-----------------------------------------
|
||||
toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g ->
|
||||
Ag g n p;
|
||||
|
||||
|
||||
fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of {
|
||||
Ag g n p => {n = n ; p = p ; g = g}
|
||||
} ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||
let a = fromAgr a0 ; b = fromAgr b0
|
||||
in
|
||||
toAgr
|
||||
(conjNumber a.n b.n)
|
||||
b.p a.g;
|
||||
|
||||
giveNumber : Agr -> Number =\a -> case a of {
|
||||
Ag _ n _ => n
|
||||
};
|
||||
giveGender : Agr -> Gender =\a -> case a of {
|
||||
Ag g _ _ => g
|
||||
};
|
||||
|
||||
defaultAgr : Agr = agrP3 Masc Sg ;
|
||||
agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ;
|
||||
personalAgr : Agr = agrP1 Masc Sg ;
|
||||
agrP1 : Gender -> Number -> Agr = \g,n -> Ag g n Pers1 ;
|
||||
|
||||
param
|
||||
CPolarity =
|
||||
CPos
|
||||
| CNeg Bool ; -- contracted or not
|
||||
|
||||
oper
|
||||
contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
|
||||
Pos => CPos ;
|
||||
Neg => CNeg b
|
||||
} ;
|
||||
|
||||
NP : Type = {s : NPCase => Str ; a : Agr} ;
|
||||
|
||||
param
|
||||
CTense = CPresent | CPast | CFuture ;
|
||||
|
||||
oper
|
||||
copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g ->
|
||||
case <t,n,p,g> of {
|
||||
<CPresent,Sg,Pers1,_ > => "hwN" ;
|
||||
<CPresent,Sg,Pers2_Casual,_ > => "hE" ;
|
||||
<CPresent,Sg,Pers2_Familiar,_ > => "hw" ;
|
||||
<CPresent,Sg,Pers2_Respect,_ > => "hyN" ;
|
||||
<CPresent,Sg,Pers3_Near,_ > => "hE" ;
|
||||
<CPresent,Sg,Pers3_Distant,_ > => "hE" ;
|
||||
<CPresent,Pl,Pers1,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers2_Casual,_ > => "hw" ;
|
||||
<CPresent,Pl,Pers2_Familiar,_ > => "hw" ;
|
||||
<CPresent,Pl,Pers2_Respect,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers3_Near,_ > => "hyN" ;
|
||||
<CPresent,Pl,Pers3_Distant,_ > => "hyN" ;
|
||||
<CPast,Sg,Pers1,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers1,Fem > => "th-y" ;
|
||||
<CPast,Sg,Pers2_Casual,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers2_Casual,Fem > => "th-y" ;
|
||||
<CPast,Sg,Pers2_Familiar,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers2_Familiar,Fem > => "th-y" ;
|
||||
<CPast,Sg,Pers2_Respect,Masc > => "th-E" ;
|
||||
<CPast,Sg,Pers2_Respect,Fem > => "th-yN" ;
|
||||
<CPast,Sg,Pers3_Near,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers3_Near,Fem > => "th-y" ;
|
||||
<CPast,Sg,Pers3_Distant,Masc > => "th-a" ;
|
||||
<CPast,Sg,Pers3_Distant,Fem > => "th-y" ;
|
||||
<CPast,Pl,Pers1,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers1,Fem > => "th-yN" ;
|
||||
<CPast,Pl,Pers2_Casual,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers2_Casual,Fem > => "th-yN" ;
|
||||
<CPast,Pl,Pers2_Familiar,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers2_Familiar,Fem > => "th-yN" ;
|
||||
<CPast,Pl,Pers2_Respect,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers2_Respect,Fem > => "th-yN" ;
|
||||
<CPast,Pl,Pers3_Near,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers3_Near,Fem > => "th-yN" ;
|
||||
<CPast,Pl,Pers3_Distant,Masc > => "th-E" ;
|
||||
<CPast,Pl,Pers3_Distant,Fem > => "th-yN" ;
|
||||
<CFuture,Sg,Pers1,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers1,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers2_Casual,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers2_Casual,Fem > => "gi" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Masc > => "gE" ;
|
||||
<CFuture,Sg,Pers2_Familiar,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers2_Respect,Masc > => "gE" ;
|
||||
<CFuture,Sg,Pers2_Respect,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers3_Near,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers3_Near,Fem > => "gy" ;
|
||||
<CFuture,Sg,Pers3_Distant,Masc > => "ga" ;
|
||||
<CFuture,Sg,Pers3_Distant,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers1,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers1,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Casual,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Casual,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Familiar,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers2_Respect,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers2_Respect,Fem > => "gy" ;
|
||||
<CFuture,Pl,Pers3_Near,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Near,Fem > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Distant,Masc > => "gE" ;
|
||||
<CFuture,Pl,Pers3_Distant,Fem > => "gy"
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
param
|
||||
VPPTense =
|
||||
VPPres
|
||||
|VPPast
|
||||
|VPFutr;
|
||||
|
||||
VPHTense =
|
||||
VPGenPres -- impf hum nahim "I go"
|
||||
| VPImpPast -- impf Ta nahim "I went"
|
||||
| VPFut -- fut na/nahim "I shall go"
|
||||
| VPContPres -- stem raha hum nahim "I am going"
|
||||
| VPContPast -- stem raha Ta nahim "I was going"
|
||||
| VPContFut
|
||||
| VPPerfPres -- perf hum na/nahim "I have gone"
|
||||
| VPPerfPast -- perf Ta na/nahim "I had gone"
|
||||
| VPPerfFut
|
||||
| VPPerfPresCont
|
||||
| VPPerfPastCont
|
||||
| VPPerfFutCont
|
||||
| VPSubj -- subj na "I may go"
|
||||
;
|
||||
|
||||
VPHForm =
|
||||
VPTense VPPTense Agr -- 9 * 12
|
||||
| VPReq
|
||||
| VPImp
|
||||
| VPReqFut
|
||||
| VPInf
|
||||
| VPStem
|
||||
;
|
||||
|
||||
VType = VIntrans | VTrans | VTransPost ;
|
||||
|
||||
oper
|
||||
|
||||
objVType : VType -> NPCase = \vt -> case vt of {
|
||||
VTrans => NPObj ;
|
||||
_ => NPC Obl
|
||||
} ;
|
||||
|
||||
VPH : Type = {
|
||||
s : VPHForm => {fin, inf : Str} ;
|
||||
obj : {s : Str ; a : Agr} ;
|
||||
subj : VType ;
|
||||
comp : Agr => Str;
|
||||
inf : Str;
|
||||
ad : Str;
|
||||
embComp : Str ;
|
||||
} ;
|
||||
|
||||
VPHSlash = VPH ** {c2 : Compl} ;
|
||||
|
||||
Compl : Type = {s : Str ; c : VType} ;
|
||||
|
||||
predV : Verb -> VPH = \verb -> {
|
||||
s = \\vh =>
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = verb.s ! VF Imperf p n g } ;
|
||||
VPTense VPPast (Ag g n p) => {fin = [] ; inf =verb.s ! VF Perf p n g} ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = verb.s ! VF Subj p n g } ;
|
||||
VPStem => {fin = [] ; inf = verb.s ! Root};
|
||||
_ => {fin = [] ; inf = verb.s ! Root}
|
||||
};
|
||||
obj = {s = [] ; a = defaultAgr} ;
|
||||
subj = VTrans ;
|
||||
inf = verb.s ! Inf;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
|
||||
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
|
||||
predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ;
|
||||
|
||||
|
||||
raha : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "rha").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
cka : Gender -> Number -> Str = \g,n ->
|
||||
(regAdjective "cka").s ! n ! g ! Dir ! Posit ;
|
||||
|
||||
hw : UPerson -> Number -> Str = \pp,n ->
|
||||
case <pp,n> of {
|
||||
<Pers1,_> => "hwN";
|
||||
<_,Pl> => "hwN";
|
||||
<_,_> => "hw"
|
||||
};
|
||||
|
||||
predAux : Aux -> VPH = \verb -> {
|
||||
s = \\vh =>
|
||||
let
|
||||
|
||||
inf = verb.inf ;
|
||||
part = verb.ppart ;
|
||||
|
||||
in
|
||||
case vh of {
|
||||
VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ;
|
||||
VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ;
|
||||
VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ;
|
||||
VPStem => {fin = [] ; inf = "rh" };
|
||||
_ => {fin = part ; inf = [] }
|
||||
};
|
||||
obj = {s = [] ; a = defaultAgr} ;
|
||||
subj = VIntrans ;
|
||||
inf = verb.inf;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
|
||||
Aux = {
|
||||
inf,ppart,prpart : Str
|
||||
} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
inf = "" ;
|
||||
ppart = "" ;
|
||||
prpart = ""
|
||||
} ;
|
||||
|
||||
Clause : Type = {s : VPHTense => Polarity => Order => Str} ;
|
||||
mkClause : NP -> VPH -> Clause = \np,vp -> {
|
||||
s = \\vt,b,ord =>
|
||||
let
|
||||
subjagr : NPCase * Agr = case vt of {
|
||||
VPImpPast => case vp.subj of {
|
||||
VTrans => <NPErg, vp.obj.a> ;
|
||||
VTransPost => <NPErg, defaultAgr> ;
|
||||
_ => <NPC Dir, np.a>
|
||||
} ;
|
||||
_ => <NPC Dir, np.a>
|
||||
} ;
|
||||
subj = subjagr.p1 ;
|
||||
agr = subjagr.p2 ;
|
||||
n = (fromAgr agr).n;
|
||||
p = (fromAgr agr).p;
|
||||
g = (fromAgr agr).g;
|
||||
vps = case vt of {
|
||||
|
||||
VPGenPres => vp.s ! VPTense VPPres agr ;
|
||||
VPImpPast => vp.s ! VPTense VPPast agr ;
|
||||
VPFut => vp.s ! VPTense VPFutr agr ;
|
||||
VPContPres =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContPast =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContFut =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ;
|
||||
VPPerfPres =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfPast =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfFut =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ;
|
||||
VPPerfPresCont =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
|
||||
VPPerfPastCont =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ;
|
||||
VPPerfFutCont =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ;
|
||||
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" }
|
||||
|
||||
};
|
||||
|
||||
|
||||
quest =
|
||||
case ord of
|
||||
{ ODir => [];
|
||||
OQuest => "kya" };
|
||||
na =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "na" };
|
||||
nahim =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "nhyN" };
|
||||
in
|
||||
case vt of {
|
||||
VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ;
|
||||
_ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
|
||||
|
||||
} ;
|
||||
|
||||
mkSClause : Str -> Agr -> VPH -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,b,ord =>
|
||||
let
|
||||
n = (fromAgr agr).n;
|
||||
p = (fromAgr agr).p;
|
||||
g = (fromAgr agr).g;
|
||||
vps = case t of {
|
||||
VPGenPres => vp.s ! VPTense VPPres agr ;
|
||||
VPImpPast => vp.s ! VPTense VPPast agr ;
|
||||
VPFut => vp.s ! VPTense VPFutr agr ;
|
||||
VPContPres =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContPast =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPContFut =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ;
|
||||
VPPerfPres =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfPast =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ;
|
||||
VPPerfFut =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ;
|
||||
VPPerfPresCont =>
|
||||
{fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPPerfPastCont =>
|
||||
{fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ;
|
||||
VPPerfFutCont =>
|
||||
{fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ;
|
||||
VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" }
|
||||
|
||||
};
|
||||
|
||||
quest =
|
||||
case ord of
|
||||
{ ODir => [];
|
||||
OQuest => "kya" };
|
||||
na =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "na" };
|
||||
nahim =
|
||||
case b of
|
||||
{ Pos => [];
|
||||
Neg => "nhyN" };
|
||||
in
|
||||
case t of {
|
||||
VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp;
|
||||
_ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp};
|
||||
} ;
|
||||
|
||||
insertSubj : UPerson -> Str -> Str = \p,s ->
|
||||
case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"};
|
||||
|
||||
insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp;
|
||||
comp = \\a => vp.comp ! a ++ obj1 ! a
|
||||
} ;
|
||||
insertVV : Str -> VPH -> VPH = \obj1,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp;
|
||||
comp = \\a => vp.comp ! a ++ obj1
|
||||
} ;
|
||||
|
||||
insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> {
|
||||
s = vp.s;
|
||||
obj = vp.obj ;
|
||||
subj = vp.subj ;
|
||||
inf = vp.inf;
|
||||
ad = vp.ad;
|
||||
embComp = vp.embComp ++ obj1;
|
||||
comp = vp.comp
|
||||
|
||||
} ;
|
||||
|
||||
insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp ->
|
||||
insertObj obj vp ** {c2 = vp.c2} ;
|
||||
insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp ->
|
||||
insertObj2 obj vp ** {c2 = vp.c2} ;
|
||||
|
||||
infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a ->
|
||||
vp.obj.s ++ vp.inf ++ vp.comp ! a ;
|
||||
infVV : Bool -> VPH -> Str = \isAux,vp ->
|
||||
case isAux of {False => vp.inf ; True => (vp.s ! VPImp).fin };
|
||||
|
||||
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
|
||||
s = vps.s ;
|
||||
obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ;
|
||||
subj = vps.c2.c ;
|
||||
inf = vps.inf;
|
||||
ad = vps.ad;
|
||||
embComp = vps.embComp;
|
||||
comp = vps.comp
|
||||
} ;
|
||||
|
||||
insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vp.subj ;
|
||||
ad = vp.ad ;
|
||||
embComp = vp.embComp;
|
||||
comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a
|
||||
} ;
|
||||
|
||||
insertAdV : Str -> VPH -> VPH = \ad,vp -> {
|
||||
s = vp.s ;
|
||||
obj = vp.obj ;
|
||||
inf = vp.inf ;
|
||||
subj = vp.subj;
|
||||
ad = vp.ad ++ ad ;
|
||||
embComp = vp.embComp;
|
||||
comp = vp.comp
|
||||
} ;
|
||||
conjThat : Str = "kh" ;
|
||||
|
||||
-- strings collected from syntax files, AR
|
||||
|
||||
oper
|
||||
sE_Str = "sE" ;
|
||||
ka_Str = "ka" ;
|
||||
hr_kwy_Str = "hr kwy" ;
|
||||
rakh6na_Str = "rakh-na" ;
|
||||
comma_Str = "," ;
|
||||
agr_Str = "agr" ;
|
||||
nE_Str = "nE" ;
|
||||
jw_Str = "jw" ;
|
||||
js_Str = "js" ;
|
||||
jn_Str = "jn" ;
|
||||
mt_Str = "mt" ;
|
||||
nh_Str = "nh" ;
|
||||
waN_Str = "waN" ;
|
||||
awr_Str = "awr" ;
|
||||
ky_Str = "ky" ;
|
||||
kw_Str = "kw" ;
|
||||
|
||||
}
|
||||
|
||||
128
src/urdu/transliterated/StructuralUrd.gf
Normal file
128
src/urdu/transliterated/StructuralUrd.gf
Normal file
@@ -0,0 +1,128 @@
|
||||
concrete StructuralUrd of Structural = CatUrd **
|
||||
open MorphoUrd, ParadigmsUrd, Prelude, NounUrd in {
|
||||
|
||||
flags optimize=all ;
|
||||
coding = utf8;
|
||||
|
||||
lin
|
||||
above_Prep = ss "awpr" ;
|
||||
after_Prep = ss "kE bed" ;
|
||||
all_Predet = ss "tmam" ;
|
||||
almost_AdA, almost_AdN = ss "tqryba" ;
|
||||
although_Subj = ss "agrch-" ;
|
||||
always_AdV = ss "hmyXh" ;
|
||||
and_Conj = sd2 [] "awr" ** {n = Pl} ;
|
||||
because_Subj = ss "kywnkh-" ;
|
||||
before_Prep = ss "phlE" ;
|
||||
behind_Prep = ss "pych-E" ;
|
||||
between_Prep = ss "drmyaN" ;
|
||||
both7and_DConj = sd2 "dwnwN" "awr" ** {n = Pl} ;
|
||||
but_PConj = ss "lykn" ;
|
||||
by8agent_Prep = ss "" ;
|
||||
by8means_Prep = ss "" ;
|
||||
can8know_VV,can_VV = mkV "skna" ** { isAux = True} ;
|
||||
during_Prep = ss ["kE drmyaN"] ;
|
||||
either7or_DConj = sd2 "kwy ayk" "ya" ** {n = Sg} ;
|
||||
everybody_NP = MassNP (UseN (ParadigmsUrd.mkN "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" Masc )); -- not a good way coz need to include NounUrd
|
||||
every_Det = mkDet "hr" "hr" "hr" "hr" Sg;
|
||||
everything_NP = MassNP (UseN (ParadigmsUrd.mkN "hr cyz" "hr cyz" "hr cyzw" "sb cyzyN" "sb cyzwN" "sb cyzw" Masc ));
|
||||
everywhere_Adv = ss "hr jgh" ;
|
||||
few_Det = mkDet "cnd" "cnd" "cnd" "cnd" Pl ;
|
||||
for_Prep = ss "kylyE" ;
|
||||
from_Prep = ss "sE" ;
|
||||
he_Pron = personalPN "wh" "as" "" "as ka" Sg Masc Pers3_Distant ;
|
||||
here_Adv = ss "yhaN" ;
|
||||
here7to_Adv = ss ["yhaN pr"] ;
|
||||
here7from_Adv = ss ["yhaN sE"] ;
|
||||
how_IAdv = ss "how" ;
|
||||
how8many_IDet = makeIDet "ktnE" "ktny" Pl ;
|
||||
if_Subj = ss "agr" ;
|
||||
in8front_Prep = ss ["kE samnE"] ;
|
||||
i_Pron = personalPN "myN" "mjh-" "" "myra" Sg Masc Pers1;
|
||||
in_Prep = ss "meN" ;
|
||||
it_Pron = personalPN "yh" "yh" "yh" "as ka" Sg Masc Pers3_Near;
|
||||
less_CAdv = {s = "km" ; p = ""} ;
|
||||
many_Det = mkDet "bht zyadh" "bht zyadh" "bht zyadh" "bht zyadh" Pl ;
|
||||
more_CAdv = {s = "zyadh-" ; p = "" } ;
|
||||
most_Predet = ss "zyadh tr" ;
|
||||
much_Det = mkDet "bht" "bht" "bht" "bht" Sg ;
|
||||
-- must_VV = {
|
||||
-- s = table {
|
||||
-- VVF VInf => ["have to"] ;
|
||||
-- VVF VPres => "must" ;
|
||||
-- VVF VPPart => ["had to"] ;
|
||||
-- VVF VPresPart => ["having to"] ;
|
||||
-- VVF VPast => ["had to"] ; --# notpresent
|
||||
-- VVPastNeg => ["hadn't to"] ; --# notpresent
|
||||
-- VVPresNeg => "mustn't"
|
||||
-- } ;
|
||||
-- isAux = True
|
||||
-- } ;
|
||||
-----b no_Phr = ss "no" ;
|
||||
no_Utt = ss "nhyN" ;
|
||||
on_Prep = ss "pr" ;
|
||||
-- one_Quant = demoPN "ayk" "ayk" "ayk" ; -- DEPRECATED
|
||||
only_Predet = ss "srf" ;
|
||||
or_Conj = sd2 [] "ya" ** {n = Sg} ;
|
||||
otherwise_PConj = ss "ya ph-r" ;
|
||||
part_Prep = ss "" ;
|
||||
please_Voc = ss "mhrbani" ;
|
||||
possess_Prep = ss "ka" ;
|
||||
quite_Adv = ss "khamosh" ;
|
||||
she_Pron = personalPN "wh" "as" "wh" "as ky" Sg Fem Pers3_Distant ;
|
||||
so_AdA = ss "so" ;
|
||||
somebody_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy" "kwy" "kwy" "kwy" "kwy" "kwy" Masc ));
|
||||
someSg_Det = mkDet "kch-" "kch-" "kch-" "kch-" Sg ;
|
||||
somePl_Det = mkDet "kch-" "kch-" "kch-" "kch-" Pl ;
|
||||
something_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy cyz" "kwy cyz" "kwy cyz" "kh- cyzyN" "kh- cyzwN" "kh- cyzw" Masc ));
|
||||
somewhere_Adv = ss "khin pr" ;
|
||||
that_Quant = demoPN "wh" "as" "an" ;
|
||||
that_Subj = ss "kh";
|
||||
there_Adv = ss "whaN" ;
|
||||
there7to_Adv = ss "whaN pr" ;
|
||||
there7from_Adv = ss ["whaN sE"] ;
|
||||
therefore_PConj = ss "as lyE" ;
|
||||
they_Pron = personalPN "wh" "wh" "wh" "an ka" Pl Masc Pers3_Distant ; ----
|
||||
this_Quant = demoPN "yh" "as" "an";
|
||||
through_Prep = ss ["myN sE"] ;
|
||||
too_AdA = ss "bht" ;
|
||||
to_Prep = ss "kw" ;
|
||||
under_Prep = ss "nycE" ;
|
||||
very_AdA = ss "bht" ;
|
||||
want_VV = mkV "cahna" ** { isAux = False} ;
|
||||
we_Pron = personalPN "hm" "hm" "hm" "hmara" Pl Masc Pers1 ;
|
||||
whatSg_IP = mkIP "kya" "kis" "kis" Sg Masc ;
|
||||
whatPl_IP = mkIP "kya" "kin" "kin" Pl Masc ;
|
||||
when_IAdv = ss "kb" ;
|
||||
when_Subj = ss "kb" ;
|
||||
where_IAdv = ss "khaN" ;
|
||||
which_IQuant = {s = \\_ => "kwn sy"} ;
|
||||
-- whichPl_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ;
|
||||
-- whichSg_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ;
|
||||
whoSg_IP = mkIP "kwn" "kis" "kis" Sg Masc ;
|
||||
whoPl_IP = mkIP "kwn" "kn" "knhwN" Pl Masc ;
|
||||
why_IAdv = ss "kywN" ;
|
||||
without_Prep = ss ["kE bGyr"] ;
|
||||
with_Prep = ss ["kE sath-"] ;
|
||||
-- yes_Phr = ss "haN" ;
|
||||
yes_Utt = ss "haN" ;
|
||||
youSg_Pron = personalPN "tm" "tm" "tm" "tmh-ara" Sg Masc Pers2_Casual ;
|
||||
youPl_Pron = personalPN "tm" "tm" "tm" "tmh-ara" Pl Masc Pers2_Casual ;
|
||||
youPol_Pron = personalPN "Ap" "AP" "AP" "Ap ka" Sg Masc Pers2_Respect ;
|
||||
no_Quant = demoPN " kwy nhyN" "kwy nhyN" "kwy nhyN" ;
|
||||
not_Predet = {s="nhyN"} ;
|
||||
if_then_Conj = sd2 "agr" "tw" ** {n = Sg} ;
|
||||
at_least_AdN = ss ["km az km"] ;
|
||||
at_most_AdN = ss ["zyadh sE zyadh"];
|
||||
nothing_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" Masc ));
|
||||
except_Prep = ss "swaE" ;
|
||||
nobody_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" Masc ));
|
||||
|
||||
as_CAdv = {s = "etna" ; p = "jtna"} ;
|
||||
|
||||
have_V2 = mkV2 (mkV "rakh-na") "" ;
|
||||
|
||||
language_title_Utt = ss "ardw" ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user