Commit 47cd5e65 authored by Gérard Huet's avatar Gérard Huet

Tags printed after stem

parent 5c3299e8
......@@ -639,8 +639,10 @@ value look_up_and_display font gana entry =
; let infos = (* should be a call to a service that gives one [entry_infos] *)
(Gen.gobble public_roots_infos_file : Deco.deco root_infos) in
let entry_infos = Deco.assoc (Encode.code_string entry) infos in
if gana = 0 then secondary_conjugs entry_infos
else print_conjug Primary Parts.participles.val
if gana = 0 then secondary_conjugs entry_infos (* legacy *)
else do { print_conjug Primary Parts.participles.val
; secondary_conjugs entry_infos (* new *)
}
}
;
value in_lexicon entry = (* entry as a string in VH transliteration *)
......
......@@ -62,8 +62,8 @@ value transducer = fun
| Ifc -> transducers.ifc (* in fine composi forms *)
| Ifc2 -> transducers.ifc2 (* idem in mode non gen *)
| Pv -> transducers.prev (* preverbs *)
| Pvkc -> transducers.pvc (* preverbs starting with consonant *)
| Pvkv -> transducers.pvv (* preverbs starting with vowel *)
| Pvkc | Pvc -> transducers.pvc (* preverbs starting with consonant *)
| Pvkv | Pvv -> transducers.pvv (* preverbs starting with vowel *)
| A | Ai -> transducers.a (* privative a *)
| An | Ani -> transducers.an (* privative an *)
| Iicv -> transducers.iicv (* vowel-initial iic *)
......@@ -119,8 +119,8 @@ value cached = (* potentially cached lexicon acquisitions *)
value initial1 =
(* All phases but Ifc, Abso, Auxi, Auxik, Auxiick, Lopa, Lopak. *)
[ Inde; Iicv; Iicc; Nouv; Nouc; Pron; A; An; Root; Kriv; Kric; Iikv; Iikc
; Peri; Pv; Pvkv; Pvkc; Iiv; Iivv; Iivc; Iiy; Inv; Ai; Ani; Absv; Absc; Inftu
; Vocv; Vocc; Vokv; Vokc ] @ cached
; Peri; Pv; Pvc; Pvv; Pvkv; Pvkc; Iiv; Iivv; Iivc; Iiy; Inv; Ai; Ani
; Absv; Absc; Inftu; Vocv; Vocc; Vokv; Vokc ] @ cached
and initial2 = (* simplified segmenter with less phases, no generation *)
[ Inde; Iic2; Noun2; Pron; Root; Pv; Iiv; Absv; Absc ]
;
......@@ -137,8 +137,8 @@ value dispatch1 w = fun (* w is the current input word *)
| An -> if phantomatic w then []
else [ Iicv; Nouv; Iikv; Kriv; Pvkv; Iivv; Vocv; Vokv
; A (* eg anak.sara *) ; An (* attested ? *) ]
| Ai -> [ Absc ]
| Ani -> [ Absv ]
| Ai -> [ Absc; Pvc ]
| Ani -> [ Absv; Pvv ]
(* This assumes that privative prefixes cannot prefix Ifc forms
justified by \Pan{2,2,6} a-x only if x is a subanta. *)
| Iicv | Iicc | Iikv | Iikc | Iiif | Auxiick -> (* Compounding *)
......@@ -146,6 +146,7 @@ value dispatch1 w = fun (* w is the current input word *)
; Pvkv; Pvkc; Iiif; Iivv; Iivc; Vocv; Vocc; Vokv; Vokc ] @ cached
| Pv -> if phantomatic w then [] else
if amuitic w then [ Lopa ] else [ Root; Abso; Peri; Inftu ]
| Pvc | Pvv -> if phantomatic w then [] else [ Abso ]
| Pvkc | Pvkv -> if phantomatic w then [] else
if amuitic w then [ Lopak ] else [ Iikv; Iikc; Kriv; Kric; Vokv; Vokc ]
| Iiv -> [ Auxi ] (* as bhuu and k.r finite forms *)
......@@ -159,7 +160,7 @@ value dispatch1 w = fun (* w is the current input word *)
(* Privative prefixes A and An are not allowed to prefix Ifc like a-dhii *)
| Noun | Iic | Iik | Voca | Krid | Noun2 | Iic2 | Ifc2 | Pvk | Vok
| Unknown -> failwith "Dispatcher anomaly"
| _ -> failwith "Dispatcher fake phase"
| ph -> failwith ("Dispatcher fake phase: " ^ string_of_phase ph)
]
and dispatch2 w = fun (* simplified segmenter *)
[ Noun2 | Pron | Inde | Abso | Absv | Absc | Auxi | Ifc2 ->
......@@ -588,7 +589,9 @@ value validate out = match out with
[ (Comp (Pv,Peri) pv peri_form,cpd_form,s) :: r ]
else []
]
| [ (Abso,rev_abso_form,s) :: [ (Pv,prev,sv) :: r ] ] ->
| [ (Abso,rev_abso_form,s) :: [ (Pv,prev,sv) :: r ] ]
| [ (Abso,rev_abso_form,s) :: [ (Pvv,prev,sv) :: r ] ]
| [ (Abso,rev_abso_form,s) :: [ (Pvc,prev,sv) :: r ] ] ->
(* Takes care of absolutives in -ya *)
let pv = Word.mirror prev in
let pv_str = Canon.decode pv
......@@ -665,7 +668,7 @@ value rec color_of_phase = fun
| Ifc | Ifc2 -> Cyan
| Unknown -> Grey
| Comp (_,ph) _ _ -> color_of_phase ph
| Pv | Pvk | Pvkc | Pvkv -> failwith "Illegal preverb segment"
| Pv | Pvv | Pvc | Pvk | Pvkc | Pvkv -> failwith "Illegal preverb segment"
(*i NB: unused background colors: Pink Green Aquamarine Chamois i*)
]
;
......
......@@ -32,6 +32,7 @@ module Morphs
| Lopa (* e/o conjugated root forms with lopa *)
| Lopak (* e/o kridantas forms with lopa *)
| Pv (* Preverb optional before Root or Lopa or mandatory before Abso *)
| Pvc | Pvv (* privative Abso *)
| Pvk | Pvkc | Pvkv (* Preverb optional before Krid or Iik or Lopak *)
| A | An | Ai | Ani | Iicv | Iicc | Nouv | Nouc (* privative nan-compounds *)
| Krid (* K.ridaantaas - used to be called Parts *)
......
......@@ -4,7 +4,7 @@
(* *)
(* Gérard Huet *)
(* *)
(* ©2018 Institut National de Recherche en Informatique et en Automatique *)
(* ©2019 Institut National de Recherche en Informatique et en Automatique *)
(**************************************************************************)
(* Prints morphological information, including derivative morphology.
......@@ -65,9 +65,7 @@ value print_morphs (seg_num,sub) morphs = match seg_num with
[pu : word -> unit] prints un-analysed chunks. *)
value print_inv_morpho pe pne pu form (seg_num,sub) generative (delta,morphs) =
let stem = Word.patch delta form in do (* stem may have homo index *)
{ ps "{ "
; print_morphs (seg_num,sub) morphs
; ps " }["
{ ps "["
; if generative then (* interpret stem as unique name *)
let (homo,bare_stem) = homo_undo stem in
let krit_infos = Deco.assoc bare_stem unique_kridantas in
......@@ -87,7 +85,9 @@ value print_inv_morpho pe pne pu form (seg_num,sub) generative (delta,morphs) =
[ [ Unanalysed ] -> pu stem
| _ -> pe stem
]
; ps "]"
; ps "]{"
; print_morphs (seg_num,sub) morphs
; ps "}"
}
;
(* Decomposes a preverb sequence into the list of its components *)
......
......@@ -113,7 +113,7 @@ and string_modal (c,i) = (string_conjugation c) ^ (string_invar i)
;
value string_morph = fun
[ Noun_form g n c
| Part_form _ g n c -> (string_case c) ^ (string_number n) ^ (string_gender g)
| Part_form _ g n c -> (string_gender g) ^ (string_number n) ^ (string_case c)
| Bare_stem | Avyayai_form -> "iic."
| Avyayaf_form -> "ind."
| Verb_form f n p -> (string_finite f) ^ (string_number n) ^ (string_person p)
......
......@@ -28,7 +28,8 @@ type phase =
| Lopa (* e/o conjugated root forms with lopa *)
| Lopak (* e/o kridantas forms with lopa *)
| Pv (* Preverb optional before Root or Lopa or mandatory before Abso *)
| Pvk | Pvkc | Pvkv (* Preverb optional before Krid or Iik or Lopak *)
| Pvc | Pvv (* privative Abso *)
| Pvk | Pvkc | Pvkv (* Preverb optional before Krid or Iik or Lopak *)
| A | An (* privative nan-compounds formations in a- or -an *)
| Ai | Ani (* initial privative nan-compounds *)
| Iicv | Iicc (* split of Iic by first letter resp. vowel or consonant *)
......@@ -76,6 +77,8 @@ value rec string_of_phase = fun
| Lopa -> "Lopa"
| Lopak -> "Lopak"
| Pv -> "Pv"
| Pvc -> "Pvc"
| Pvv -> "Pvv"
| Pvk -> "Pvk"
| Pvkc -> "Pvkc"
| Pvkv -> "Pvkv"
......@@ -132,6 +135,8 @@ and phase_of_string = fun (* unsafe *)
| "Lopa" -> Lopa
| "Lopak" -> Lopak
| "Pv" -> Pv
| "Pvv" -> Pvv
| "Pvc" -> Pvc
| "Pvk" -> Pvk
| "Pvkc" -> Pvkc
| "Pvkv" -> Pvkv
......@@ -169,7 +174,7 @@ and aa_phase = fun (* phase of preverb "aa" according to following phase *)
and un_lopa = fun (* phase of origin of lopa *)
[ Lopa -> Root | Lopak -> Kriv | _ -> failwith "un_lopa" ]
and preverb_phase = fun
[ Pv | Pvk | Pvkc | Pvkv -> True | _ -> False ]
[ Pv | Pvv | Pvc | Pvk | Pvkc | Pvkv -> True | _ -> False ]
and krid_phase = fun [ Krid | Kric | Kriv -> True | _ -> False ]
and ikrid_phase = fun [ Iik | Iikc | Iikv -> True | _ -> False ]
and vkrid_phase = fun [ Vokc | Vokv -> True | _ -> False ]
......
......@@ -4,7 +4,7 @@
(* *)
(* Gérard Huet *)
(* *)
(* ©2018 Institut National de Recherche en Informatique et en Automatique *)
(* ©2019 Institut National de Recherche en Informatique et en Automatique *)
(**************************************************************************)
(*i module Transduction = struct i*)
......@@ -193,8 +193,11 @@ EXTEND Gram (* skt to url *)
| "@" {\R} "%40"
| ":" {\R} "%3A"
| ";" {\R} "%3B"
| "?" {\R} "%3F"
| "<" {\R} "%3C"
| "|" {\R} "%7C"
| "=" {\R} "%3D"
| ">" {\R} "%3E"
| "?" {\R} "%3F"
| "/" {\R} "%2F"
| "," {\R} "%2C" i*)
| i = LETTER -> i
......
......@@ -2329,8 +2329,8 @@ value compute_condm conj stem entry =
value compute_future stem entry =
match entry with
[ "as#1" -> () (* uses bhuu *)
| "iiz#1" | "lii" | "knuu" -> do (* Para allowed in future *)
{ compute_futurea Primary stem entry
| "iiz#1" | "lii" | "knuu" | "baadh" -> do (* Para allowed in future *)
{ compute_futurea Primary stem entry
; compute_futurem Primary stem entry
}
| _ -> match voices_of entry with
......@@ -5584,6 +5584,7 @@ value compute_conjugs_stems entry (vmorph,aa) = do (* main *)
no - may be obtained as opt[9] *)
| "daa#1" -> let wstem = revcode "de" (* Henry§298 aa {\R} e *) in
conjug_benedictivea Primary wstem entry (* puissé-je donner! *)
| "i" -> conjug_benedictivea Primary [ 4 ] entry (* iiyaat Ram. *)
| "m.r" -> let sibstem = revcode "m.r.s" in
conjug_benedictivem Primary sibstem entry (* m.r.sii.s.ta \Pan{1,3,61} *)
| "luu#1" -> let sibstem = revcode "lavi.s" in
......
......@@ -8,4 +8,4 @@
(**************************************************************************)
(* Generated by make version - see main Makefile *)
value version="3.14" and version_date="2019-04-11";
value version="3.15" and version_date="2019-04-24";
VERSION='3.14'
DATE='2019-04-11'
VERSION='3.15'
DATE='2019-04-24'
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