Commit 7d0951b7 authored by Gérard Huet's avatar Gérard Huet

Morpho_ext becomes Morpho_scl

parent 36d69f4e
This diff is collapsed.
......@@ -49,9 +49,8 @@ checkpoints.ml graph_segmenter.ml automaton.ml interface.mli interface.ml \
user_aid.ml reset_caches.ml
# WEB package - HTML, HTTP, CGI utilities for Web interface
WEB=html.ml web.ml css.ml cgi.ml morpho_html.ml chapters.ml \
mk_index_page.ml mk_grammar_page.ml mk_reader_page.ml mk_sandhi_page.ml \
morpho_ext.ml
WEB=html.ml web.ml css.ml cgi.ml morpho_html.ml chapters.ml morpho_scl.ml \
mk_index_page.ml mk_grammar_page.ml mk_reader_page.ml mk_sandhi_page.ml
# extra file SCLpaths.ml for SCL interfacing - not distributed.
# TREE package - tree bank manager and syntax analyser - legacy
......@@ -91,10 +90,11 @@ all: engine static_pages reset_caches sandhi_test
# legacy in need of re-design
regression: rank.cmx regression.cmx
$(LINK) $(CORENATIVES) unix.cmxa date.cmx control.cmx deco.cmx \
lexmap.cmx inflected.cmx html.cmx SCLpaths.cmx web.cmx naming.cmx morpho_string.cmx \
morpho.cmx load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx chapters.cmx \
morpho_html.cmx bank_lexer.cmx cgi.cmx segmenter.cmx morpho_ext.cmx \
load_morphs.cmx lexer.cmx constraints.cmx rank.cmx regression.cmx -o regression
lexmap.cmx inflected.cmx html.cmx SCLpaths.cmx web.cmx naming.cmx \
morpho_string.cmx morpho.cmx load_transducers.cmx pada.cmx phases.cmx \
dispatcher.cmx chapters.cmx morpho_html.cmx bank_lexer.cmx cgi.cmx \
segmenter.cmx morpho_scl.cmx load_morphs.cmx lexer.cmx constraints.cmx \
rank.cmx regression.cmx -o regression
obsolete: tagger panini
......@@ -183,7 +183,7 @@ control.cmx word.cmx canon.cmx zen_lexer.cmx phonetics.cmx transduction.cmx \
encode.cmx skt_lexer.cmx padapatha.cmx sanskrit.cmx deco.cmx lexmap.cmx \
inflected.cmx html.cmx SCLpaths.cmx web.cmx naming.cmx morpho_string.cmx morpho.cmx \
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx order.cmx \
chapters.cmx morpho_html.cmx cgi.cmx segmenter.cmx morpho_ext.cmx \
chapters.cmx morpho_html.cmx cgi.cmx segmenter.cmx morpho_scl.cmx \
load_morphs.cmx lexer.cmx constraints.cmx rank.cmx bank_lexer.cmx \
scl_parser.cmx checkpoints.cmx reader.cmx -o reader
......@@ -212,17 +212,9 @@ encode.cmx skt_lexer.cmx padapatha.cmx sanskrit.cmx deco.cmx lexmap.cmx \
inflected.cmx html.cmx SCLpaths.cmx web.cmx naming.cmx morpho_string.cmx morpho.cmx \
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx order.cmx \
chapters.cmx morpho_html.cmx bank_lexer.cmx cgi.cmx segmenter.cmx \
morpho_ext.cmx load_morphs.cmx lexer.cmx constraints.cmx checkpoints.cmx \
morpho_scl.cmx load_morphs.cmx lexer.cmx constraints.cmx checkpoints.cmx \
paraphrase.cmx scl_parser.cmx parser.cmx -o parser
tagger: tagger.cmx
$(LINK) list2.cmx gen.cmx paths.cmx version.cmx date.cmx install.cmx \
word.cmx canon.cmx zen_lexer.cmx phonetics.cmx transduction.cmx encode.cmx \
skt_lexer.cmx padapatha.cmx sanskrit.cmx deco.cmx lexmap.cmx inflected.cmx \
html.cmx SCLpaths.cmx web.cmx naming.cmx morpho_string.cmx morpho.cmx pada.cmx \
dispatcher.cmx order.cmx chapters.cmx morpho_html.cmx cgi.cmx \
segmenter.cmx morpho_ext.cmx lexer.cmx constraints.cmx tagger.cmx -o tagger
css: css.cmx
$(LINK) gen.cmx paths.cmx version.cmx date.cmx html.cmx \
SCLpaths.cmx web.cmx css.cmx -o css
......@@ -314,7 +306,7 @@ Heritage_Platform.pdf: $(ENGINE)
clean:
rm -f *.cmo *.cmi *.cmx *.ppi *.ppo *.o
rm -f css indexer indexerd sandhier reader parser tagger lemmatizer \
rm -f css indexer indexerd sandhier reader parser lemmatizer \
declension conjugation mk_index_page mk_grammar_page mk_reader_page regression \
mk_sandhi_page sandhi_test reset_caches interface user_aid \
parse_apte tag_apte
......
......@@ -48,6 +48,7 @@ and td_end = xml_end "td"
and td = xml_empty_with_att "td"
;
value td_wrap text = td_begin ^ text ^ td_end
and cell item = tr_begin ^ th_begin ^ item ^ th_end ^ tr_end
;
(* Dynamic colors depending on mouse position *)
value tr_mouse_begin color_over color_out =
......
......@@ -36,7 +36,7 @@ open Web; (* ps pl abort etc. *)
open Cgi;
open Phases; (* Phases *)
open Phases; (* [phase] *)
open Phases; (* phase *)
module Lemmas = Load_morphs.Morphs Prel Phases
;
......@@ -129,21 +129,21 @@ value rec str_phase = fun
| Tad (ph,_) _ _ -> "taddhita " ^ str_phase ph
]
;
value print_ext_morph pvs gen form tag = do
value print_scl_morph pvs gen form tag = do
{ ps (xml_begin "tag")
; Morpho_ext.print_ext_inflected_link pvs form gen tag
; Morpho_scl.print_ext_inflected_link pvs form gen tag
; ps (xml_end "tag")
}
;
value print_ext_tags pvs phase form tags =
value print_scl_tags pvs phase form tags =
let table_ext phase =
xml_begin_with_att "tags" [ ("phase",str_phase phase) ] in do
{ ps (table_ext phase)
; List.iter (print_ext_morph pvs (generative phase) form) tags
; List.iter (print_scl_morph pvs (generative phase) form) tags
; ps (xml_end "tags")
}
;
(* used in Parser *)
(* Used in Parser *)
value extract_lemma phase word =
match tags_of phase word with
[ Atomic tags -> tags
......@@ -153,7 +153,7 @@ value extract_lemma phase word =
| Taddhita _ _ _ tags -> tags
]
;
(* returns the offset correction (used by SL interface) *)
(* Returns the offset correction (used by SL interface) *)
value process_transition = fun
[ Euphony (w,u,v) ->
let off = if w=[] then 1 (* amui/lopa from Lopa/Lopak *)
......@@ -239,8 +239,8 @@ value print_segment offset (phase,rword,transition) = do
}
}
;
(* Similarly for [Reader_plugin] mode (without offset) *)
value print_ext_segment counter (phase,rword) =
(* Similarly for [Reader_plugin] mode (without offset and transitions) *)
value print_scl_segment counter (phase,rword) =
let print_pada rword =
let word = Morpho_html.visargify rword in
let ic = string_of_int counter in
......@@ -252,19 +252,19 @@ value print_ext_segment counter (phase,rword) =
; let word = mirror rword in
match tags_of phase word with
[ Atomic tags ->
print_ext_tags [] phase word tags
print_scl_tags [] phase word tags
| Preverbed (_,phase) pvs form tags ->
let ok_tags =
if pvs = [] then tags
else trim_tags (generative phase) form (Canon.decode pvs) tags in
print_ext_tags pvs phase form ok_tags
print_scl_tags pvs phase form ok_tags
| Taddhita _ _ sfx_phase sfx_tags ->
let taddhita_phase = match sfx_phase with
[ Sfx -> Noun
| Isfx -> Iic
| _ -> failwith "Wrong taddhita structure"
] in
print_ext_tags [] taddhita_phase word sfx_tags
print_scl_tags [] taddhita_phase word sfx_tags
]
; ps "'>" (* closes <input *)
; let word = Morpho_html.visargify rword in
......@@ -274,19 +274,11 @@ value print_ext_segment counter (phase,rword) =
; counter+1
}
;
value cell item = do (* residual of Html *)
{ ps tr_begin
; ps th_begin
; ps item
; ps th_end
; pl tr_end
}
;
value print_labels tags seg_num = do
{ ps th_begin (* begin labels *)
; pl table_labels
; let print_label n _ = do
{ cell (html_red (string_of_int seg_num ^ "." ^ string_of_int n))
{ ps (cell (html_red (string_of_int seg_num ^ "." ^ string_of_int n)))
; n+1
} in
let _ = List.fold_left print_label 1 tags in ()
......
......@@ -52,7 +52,7 @@ module Lexer : functor (* takes its prelude and iterator control as parameters *
value all_checks : ref (list Viccheda.check);
value un_analyzable : Word.word -> (list Disp.segment * Viccheda.resumption);
value set_offset : (int * list Viccheda.check) -> unit;
value print_ext_segment : int -> (Phases.phase * Word.word) -> int;
value print_scl_segment : int -> (Phases.phase * Word.word) -> int;
value record_tagging : bool -> bool -> string -> int -> string ->
list (Phases.phase * Word.word * 'a) -> list (int * int) -> unit;
value return_tagging :
......
......@@ -7,7 +7,7 @@
(* ©2017 Institut National de Recherche en Informatique et en Automatique *)
(**************************************************************************)
(*i module Morpho_ext = struct i*)
(*i module Morpho_scl = struct i*)
(* Prints lists of inflected forms in XML for use by external Web services. *)
(* Adapted from [Morpho_xml] *)
......
......@@ -274,11 +274,7 @@ value process_until sol_index query topic mode_sent translit sentence
| Some p -> ()
]
}
with [ Truncation -> do
{ pl (html_red "Solution not found")
; pl html_break
}
]
with [ Truncation -> pl (html_red "Solution not found" ^ html_break) ]
}
;
......@@ -322,12 +318,13 @@ value parser_engine () = do
| "f" -> Some "saa"
| "n" -> Some "tat"
| _ -> None
]
] in
(* Corpus interaction disabled
(* File where to store locally the taggings - only for [Station] platform *)
and corpus_file = (* optionally transmitted by argument "out_file" *)
[let corpus_file = (* optionally transmitted by argument "out_file" *)
try let file_name = List.assoc "out_file" alist (* do not use get *) in
Some file_name
with [ Not_found -> Some regression_file_name ] in
with [ Not_found -> Some regression_file_name ] in] *)
(* Regression disabled
[let () = if Paths.platform = "Station" then match corpus_file with
[ Some file_name ->
......
......@@ -133,7 +133,7 @@ value display limit mode text saved = fun
] in
let forget_transitions (phase,word,_) = (phase,word) in
let forget_index (_,segments) = List.map forget_transitions segments in
let segmentations = List.map forget_index best_sols in
let segmentations = List.map forget_index solutions in
Scl_parser.print_scl segmentations
| _ -> ()
]
......
......@@ -34,12 +34,10 @@ module Lexer_control = struct
end (* [Lexer_control] *)
;
(* Multi-phase lexer *)
module Lex = Lexer.Lexer Prel Lexer_control (* [print_ext] *)
;
value print_scl_segment = Lex.print_ext_segment
module Lex = Lexer.Lexer Prel Lexer_control (* [print_scl_segment] *)
;
value print_scl_output output =
List.fold_left print_scl_segment 1 (List.rev output)
List.fold_left Lex.print_scl_segment 1 (List.rev output)
;
value print_scl_solutions s =
let _ = print_scl_output s in ()
......@@ -53,6 +51,7 @@ value print_scl1 (solutions : list (Phases.phase * Word.word)) =
; ps ("<table class=\"draggable\">")
; ps tr_begin
; print_scl_solutions solutions
; ps ("<td><input type=\"hidden\" name=\"DISPLAY\" value=\"" ^ default_output_font ^"\"/></td>")
; ps tr_end
; ps table_end
; ps (submit_input "Submit")
......
......@@ -307,24 +307,8 @@ value image name = web_images_url ^ name
;
value ocaml_logo = image "icon_ocaml.png"
and inria_logo = image "logo_inria.png"
;
(* miscellaneous graphics - check rights before distributing *)
value sanskrit_gif = image "sanskrit.gif"
and ganesh_gif = image "ganesh.gif"
and jagannath_jpg = image "jagannath.jpg"
and ganeshgannath_jpg = image "ganeshgannath.jpg"
and krishnagannath_jpg = image "krishnagannath.jpg"
and sarasvati_jpg = image "sarasvati.jpg"
and kadambari_png = image "kaadambarii.png"
and om_jpg = image "om.jpg"
and om2_jpg = image "om2.jpg"
and om3_jpg = image "om3.jpg"
and om4_jpg = image "om4.jpg"
and favicon = image "favicon.ico"
and hare_jpg = image "hare.jpg" (* http://www.bvml.org/grfx/chadar.jpg *)
and geo_gif = image "geopattern.gif" (* http://www.unc.edu/%7Ecernst/geopattern1.gif *)
;
(* was in html *)
value reader_meta_title = title "Sanskrit Reader Companion"
and parser_meta_title = title "Sanskrit Reader Assistant"
and dico_title_fr = h1_title "Dictionnaire H&eacute;ritage du Sanscrit"
......@@ -632,7 +616,7 @@ value javascript_tooltip ="wz_tooltip.js"
value remote_server_host = "http://sanskrit.inria.fr/"
;
(* This toogle controls accessibility of University of Hyderabad tools *)
value scl_toggle = (* should be [exists scl_profile] *)
value scl_toggle =
not (SCLpaths.scl_url="") (* True if SCL tools are installed *)
;
value interaction_modes_default mode =
......
......@@ -236,7 +236,7 @@ ML/reset_caches.ml
# WEB package - HTML, HTTP, CGI ad-hoc utilities for Web interface
WEB=ML/html.ml ML/web.ml ML/css.ml ML/cgi.ml ML/morpho_html.ml ML/chapters.ml \
ML/mk_index_page.ml ML/mk_grammar_page.ml ML/mk_reader_page.ml \
ML/mk_sandhi_page.ml ML/morpho_ext.ml ML/compute_mw_links.ml
ML/mk_sandhi_page.ml ML/morpho_scl.ml ML/compute_mw_links.ml
# TREE package - tree bank manager and syntax analyser - deprecated
TREE=ML/stemmer.ml ML/parse_tree.ml ML/parse_apte.ml ML/tag_tree.ml \
......
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