Commit 8249d941 authored by Gérard Huet's avatar Gérard Huet

Morpho_ext => Morpho_scl

parent 7d0951b7
......@@ -167,12 +167,12 @@ lexer.cmi : ../ZEN/word.cmo phases.cmo morphology.cmi load_transducers.cmo \
html.cmo dispatcher.cmi
lexer.cmo : ../ZEN/word.cmo web.cmo transduction.cmo skt_morph.cmi \
segmenter.cmo phases.cmo naming.cmo morphology.cmi morpho_string.cmo \
morpho_html.cmo morpho_ext.cmo morpho.cmo load_transducers.cmo \
morpho_scl.cmo morpho_html.cmo morpho.cmo load_transducers.cmo \
load_morphs.cmo html.cmo dispatcher.cmi ../ZEN/deco.cmo cgi.cmo canon.cmo \
auto.cmi lexer.cmi
lexer.cmx : ../ZEN/word.cmx web.cmx transduction.cmx skt_morph.cmi \
segmenter.cmx phases.cmx naming.cmx morphology.cmi morpho_string.cmx \
morpho_html.cmx morpho_ext.cmx morpho.cmx load_transducers.cmx \
morpho_scl.cmx morpho_html.cmx morpho.cmx load_transducers.cmx \
load_morphs.cmx html.cmx dispatcher.cmx ../ZEN/deco.cmx cgi.cmx canon.cmx \
auto.cmi lexer.cmi
rank.cmo : ../ZEN/word.cmo web.cmo phases.cmo morphology.cmi \
......@@ -189,11 +189,11 @@ reader.cmo : web.cmo scl_parser.cmo sanskrit.cmi rank.cmo phases.cmo \
reader.cmx : web.cmx scl_parser.cmx sanskrit.cmx rank.cmx phases.cmx \
paths.cmx html.cmx encode.cmx control.cmx checkpoints.cmx cgi.cmx \
canon.cmx
parser.cmo : ../ZEN/word.cmo web.cmo uoh_interface.cmo skt_morph.cmi \
parser.cmo : ../ZEN/word.cmo web.cmo skt_morph.cmi scl_parser.cmo \
sanskrit.cmi SCLpaths.cmo paths.cmo paraphrase.cmi ../ZEN/list2.cmo \
lexer.cmi inflected.cmi html.cmo ../ZEN/gen.cmo encode.cmo date.cmo \
control.cmo constraints.cmi checkpoints.cmo cgi.cmo canon.cmo
parser.cmx : ../ZEN/word.cmx web.cmx uoh_interface.cmx skt_morph.cmi \
parser.cmx : ../ZEN/word.cmx web.cmx skt_morph.cmi scl_parser.cmx \
sanskrit.cmx SCLpaths.cmx paths.cmx paraphrase.cmx ../ZEN/list2.cmx \
lexer.cmx inflected.cmx html.cmx ../ZEN/gen.cmx encode.cmx date.cmx \
control.cmx constraints.cmx checkpoints.cmx cgi.cmx canon.cmx
......@@ -209,12 +209,6 @@ paraphrase.cmo : web.cmo skt_morph.cmi morphology.cmi html.cmo \
constraints.cmi paraphrase.cmi
paraphrase.cmx : web.cmx skt_morph.cmi morphology.cmi html.cmx \
constraints.cmx paraphrase.cmi
reader_plugin.cmo : ../ZEN/word.cmo web.cmo sanskrit.cmi phases.cmo \
morphology.cmi ../ZEN/list2.cmo lexer.cmi html.cmo encode.cmo control.cmo \
constraints.cmi cgi.cmo canon.cmo
reader_plugin.cmx : ../ZEN/word.cmx web.cmx sanskrit.cmx phases.cmx \
morphology.cmi ../ZEN/list2.cmx lexer.cmx html.cmx encode.cmx control.cmx \
constraints.cmx cgi.cmx canon.cmx
bank_lexer.cmo :
bank_lexer.cmx :
regression.cmo : web.cmo version.cmo sanskrit.cmi rank.cmo encode.cmo \
......@@ -268,6 +262,10 @@ morpho_html.cmx : ../ZEN/word.cmx web.cmx transduction.cmx multilingual.cmx \
chapters.cmx canon.cmx
chapters.cmo : ../ZEN/word.cmo order.cmo encode.cmo ../ZEN/deco.cmo
chapters.cmx : ../ZEN/word.cmx order.cmx encode.cmx ../ZEN/deco.cmx
morpho_scl.cmo : ../ZEN/word.cmo skt_morph.cmi phonetics.cmo naming.cmo \
morphology.cmi ../ZEN/list2.cmo ../ZEN/deco.cmo canon.cmo
morpho_scl.cmx : ../ZEN/word.cmx skt_morph.cmi phonetics.cmx naming.cmx \
morphology.cmi ../ZEN/list2.cmx ../ZEN/deco.cmx canon.cmx
mk_index_page.cmo : web.cmo paths.cmo html.cmo
mk_index_page.cmx : web.cmx paths.cmx html.cmx
mk_grammar_page.cmo : web.cmo paths.cmo html.cmo
......@@ -276,7 +274,3 @@ mk_reader_page.cmo : web.cmo paths.cmo html.cmo control.cmo cgi.cmo
mk_reader_page.cmx : web.cmx paths.cmx html.cmx control.cmx cgi.cmx
mk_sandhi_page.cmo : web.cmo html.cmo
mk_sandhi_page.cmx : web.cmx html.cmx
morpho_ext.cmo : ../ZEN/word.cmo skt_morph.cmi phonetics.cmo naming.cmo \
morphology.cmi ../ZEN/list2.cmo ../ZEN/deco.cmo canon.cmo
morpho_ext.cmx : ../ZEN/word.cmx skt_morph.cmi phonetics.cmx naming.cmx \
morphology.cmi ../ZEN/list2.cmx ../ZEN/deco.cmx canon.cmx
......@@ -131,14 +131,14 @@ value rec str_phase = fun
;
value print_scl_morph pvs gen form tag = do
{ ps (xml_begin "tag")
; Morpho_scl.print_ext_inflected_link pvs form gen tag
; Morpho_scl.print_scl_inflected pvs form gen tag
; ps (xml_end "tag")
}
;
value print_scl_tags pvs phase form tags =
let table_ext phase =
let table phase =
xml_begin_with_att "tags" [ ("phase",str_phase phase) ] in do
{ ps (table_ext phase)
{ ps (table phase)
; List.iter (print_scl_morph pvs (generative phase) form) tags
; ps (xml_end "tags")
}
......@@ -239,7 +239,7 @@ value print_segment offset (phase,rword,transition) = do
}
}
;
(* Similarly for [Reader_plugin] mode (without offset and transitions) *)
(* Similarly for [scl_plugin] mode (without offset and transitions) *)
value print_scl_segment counter (phase,rword) =
let print_pada rword =
let word = Morpho_html.visargify rword in
......
......@@ -175,7 +175,8 @@ value tags_of phase word =
let sfx_tag = Deco.assoc sfx (morpho_tags sfx_ph) in
Taddhita (ph,form) [ 0 :: sfx ] sfx_ph sfx_tag
| _ -> Atomic (Deco.assoc word (morpho_tags phase))
(* NB Atomic comprises tin verbal forms of roots as well as sup atomic forms *)
(* NB Atomic comprises tin verbal forms of roots as well as sup atomic forms
and all the pure stems collections Iic Iiv etc. *)
]
;
......
......@@ -19,20 +19,20 @@ open Naming; (* [look_up_homo homo_undo unique_kridantas lexical_kridantas] *)
value ps = print_string
;
value pr_ext_gana k = ps (string_of_int k)
value pr_scl_gana k = ps (string_of_int k)
;
value print_ext_number = fun
value print_scl_number = fun
[ Singular -> ps "<sg/>"
| Dual -> ps "<du/>"
| Plural -> ps "<pl/>"
]
and print_ext_gender = fun
and print_scl_gender = fun
[ Mas -> ps "<m/>"
| Neu -> ps "<n/>"
| Fem -> ps "<f/>"
| Deictic _ -> ps "<d/>"
]
and print_ext_case = fun
and print_scl_case = fun
[ Nom -> ps "<nom/>"
| Acc -> ps "<acc/>"
| Ins -> ps "<ins/>"
......@@ -42,73 +42,73 @@ and print_ext_case = fun
| Loc -> ps "<loc/>"
| Voc -> ps "<voc/>"
]
and print_ext_person = fun
and print_scl_person = fun
[ First -> ps "<fst/>"
| Second -> ps "<snd/>"
| Third -> ps "<thd/>"
]
and print_ext_voice = fun
and print_scl_voice = fun
[ Active -> ps "<ac/>"
| Middle -> ps "<md/>"
| Passive -> ps "<ps/>"
]
and print_ext_pr_mode = fun
and print_scl_pr_mode = fun
[ Present -> ps "<pr gana="
| Imperative -> ps "<imp gana="
| Optative -> ps "<opt gana="
| Imperfect -> ps "<impft gana="
]
and print_ext_pr_mode_ps = fun
and print_scl_pr_mode_ps = fun
[ Present -> ps "<prps/>"
| Imperative -> ps "<impps/>"
| Optative -> ps "<optps/>"
| Imperfect -> ps "<impftps/>"
]
and print_ext_tense = fun
and print_scl_tense = fun
[ Future -> ps "<fut/>"
| Perfect -> ps "<pft/>"
| Aorist k -> do { ps "<aor gana="; pr_ext_gana k; ps "/>" }
| Injunctive k -> do { ps "<inj gana="; pr_ext_gana k; ps "/>" }
| Aorist k -> do { ps "<aor gana="; pr_scl_gana k; ps "/>" }
| Injunctive k -> do { ps "<inj gana="; pr_scl_gana k; ps "/>" }
| Conditional -> ps "<cond/>"
| Benedictive -> ps "<ben/>"
]
;
value print_ext_paradigm = fun
[ Conjug t v -> do { print_ext_tense t; print_ext_voice v }
| Presenta k pr -> do { print_ext_pr_mode pr; pr_ext_gana k;
value print_scl_paradigm = fun
[ Conjug t v -> do { print_scl_tense t; print_scl_voice v }
| Presenta k pr -> do { print_scl_pr_mode pr; pr_scl_gana k;
ps "/><ac/>" }
| Presentm k pr -> do { print_ext_pr_mode pr; pr_ext_gana k;
| Presentm k pr -> do { print_scl_pr_mode pr; pr_scl_gana k;
ps "/><md/>" }
| Presentp pr -> print_ext_pr_mode_ps pr
| Presentp pr -> print_scl_pr_mode_ps pr
| Perfut v -> ps "<perfut/>" (* TODO: mark voice *)
]
and print_ext_conjugation = fun
and print_scl_conjugation = fun
[ Primary -> ()
| Causative -> ps "<ca/>"
| Intensive -> ps "<int/>"
| Desiderative -> ps "<des/>"
]
and print_ext_nominal = fun
and print_scl_nominal = fun
[ Ppp -> ps "<pp/>"
| Pppa -> ps "<ppa/>"
| Ppra k -> do { ps "<ppr gana="; pr_ext_gana k; ps "/>";
print_ext_voice Active }
| Pprm k -> do { ps "<ppr gana="; pr_ext_gana k; ps "/>";
print_ext_voice Middle }
| Pprp -> do { ps "<ppr/>"; print_ext_voice Passive }
| Ppfta -> do { ps "<ppf/>"; print_ext_voice Active }
| Ppftm -> do { ps "<ppf/>"; print_ext_voice Middle }
| Pfuta -> do { ps "<pfu/>"; print_ext_voice Active }
| Pfutm -> do { ps "<pfu/>"; print_ext_voice Middle }
| Pfutp k -> do { ps "<pfp/>"; pr_ext_gana k }
| Ppra k -> do { ps "<ppr gana="; pr_scl_gana k; ps "/>";
print_scl_voice Active }
| Pprm k -> do { ps "<ppr gana="; pr_scl_gana k; ps "/>";
print_scl_voice Middle }
| Pprp -> do { ps "<ppr/>"; print_scl_voice Passive }
| Ppfta -> do { ps "<ppf/>"; print_scl_voice Active }
| Ppftm -> do { ps "<ppf/>"; print_scl_voice Middle }
| Pfuta -> do { ps "<pfu/>"; print_scl_voice Active }
| Pfutm -> do { ps "<pfu/>"; print_scl_voice Middle }
| Pfutp k -> do { ps "<pfp/>"; pr_scl_gana k }
| _ -> ps "<act/>" (* action verbal nouns *)
]
and print_ext_invar = fun
and print_scl_invar = fun
[ Infi -> ps "<inf/>"
| Absoya -> ps "<abs/>"
| Perpft -> ps "<perpft/>"
]
and print_ext_kind = fun
and print_scl_kind = fun
[ Part -> ps "<part/>"
| Prep -> ps "<prep/>"
| Conj -> ps "<conj/>"
......@@ -117,43 +117,43 @@ and print_ext_kind = fun
| _ -> ps "<und/>"
]
;
value print_ext_finite (c,p) =
do { print_ext_conjugation c; print_ext_paradigm p }
and print_ext_verbal (c,n) =
do { print_ext_conjugation c; print_ext_nominal n }
and print_ext_modal (c,i) =
do { print_ext_conjugation c; print_ext_invar i }
value print_scl_finite (c,p) =
do { print_scl_conjugation c; print_scl_paradigm p }
and print_scl_verbal (c,n) =
do { print_scl_conjugation c; print_scl_nominal n }
and print_scl_modal (c,i) =
do { print_scl_conjugation c; print_scl_invar i }
;
value print_ext_morph = fun
value print_scl_morph = fun
[ Noun_form g n c
| Part_form _ g n c -> do
{ print_ext_case c
; print_ext_number n
; print_ext_gender g
{ print_scl_case c
; print_scl_number n
; print_scl_gender g
}
| Bare_stem | Avyayai_form -> ps "<iic/>"
| Verb_form f n p -> do
{ print_ext_finite f
; print_ext_number n
; print_ext_person p
{ print_scl_finite f
; print_scl_number n
; print_scl_person p
}
| Ind_form k -> print_ext_kind k
| Ind_form k -> print_scl_kind k
| Avyayaf_form -> ps "<avya/>"
| Abs_root c -> do { print_ext_conjugation c; ps "<abs/>" }
| Abs_root c -> do { print_scl_conjugation c; ps "<abs/>" }
| Auxi_form -> ps "<iiv/>"
| Ind_verb m -> print_ext_modal m
| Ind_verb m -> print_scl_modal m
| PV _ -> ps "<pv/>"
| Unanalysed -> ps "<unknown/>"
]
;
value print_ext_morphs =
value print_scl_morphs =
let choice () = ps "</choice><choice>" in
List2.process_list_sep print_ext_morph choice
List2.process_list_sep print_scl_morph choice
;
value print_inv_morpho_ext pe pne form generative (delta,morphs) =
value print_inv_morpho_scl pe form generative (delta,morphs) =
let stem = Word.patch delta form in do (* stem may have homo index *)
{ ps "<morpho_infl><choice>"
; print_ext_morphs morphs
; print_scl_morphs morphs
; ps "</choice></morpho_infl>"
; ps "<morpho_gen>"
; if generative then (* interpret stem as unique name *)
......@@ -161,31 +161,31 @@ value print_inv_morpho_ext pe pne form generative (delta,morphs) =
let krid_infos = Deco.assoc bare_stem unique_kridantas in
try let (verbal,root) = look_up_homo homo krid_infos in do
{ match Deco.assoc bare_stem lexical_kridantas with
[ [] (* not in lexicon *) -> pne bare_stem
[ [] (* not in lexicon *) -> pe bare_stem
| entries (* bare stem is lexicalized *) ->
if List.exists (fun (_,h) -> h=homo) entries
then pe stem (* stem with exact homo is lexical entry *)
else pne bare_stem
else pe bare_stem
]
; ps "<krid>"; print_ext_verbal verbal
; ps "<krid>"; print_scl_verbal verbal
; ps "</krid><root>"; pe root; ps "</root>"
} with [ _ -> pne bare_stem ]
} with [ _ -> pe bare_stem ]
else pe stem
; ps "</morpho_gen>"
}
;
value print_inv_morpho_link_ext pvs pe pne form =
value print_inv_morpho_scl pvs pe form =
let pv = if Phonetics.phantomatic form then [ 2 ] (* aa- *)
else pvs in
let encaps print e = if pv = [] then print e
else do { ps (Canon.decode_WX pvs ^ "-"); print e } in
print_inv_morpho_ext (encaps pe) (encaps pne) form
and print_ext_entry w = (* ps offline in WX notation for UoH interface *)
let encaps print e = if pv = [] then pe e
else do { ps (Canon.decode_WX pvs ^ "-"); pe e } in
print_inv_morpho_scl (encaps pe) form
and print_scl_entry w = (* ps offline in WX notation for UoH interface *)
ps ("<entry wx=\"" ^ Canon.decode_WX w ^ "\"/>")
;
(* Used in [Lexer.print_ext_morph] *)
value print_ext_inflected_link pvs =
print_inv_morpho_link_ext pvs print_ext_entry print_ext_entry
(* Used in [Lexer.print_scl_morph] *)
value print_scl_inflected pvs =
print_inv_morpho_scl pvs print_scl_entry
;
(*i end; i*)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment