Commit c9aff367 authored by Gérard Huet's avatar Gérard Huet

Version 3.09 adapted to OCaml version 4.07.0 - ocaml upgrade needed -

parent 72b89b4c
This diff is collapsed.
......@@ -11,7 +11,7 @@
This is just a reminder for quick installation.
A more complete installation procedure is described in file SETUP/INSTALL.
0) Install OCaml (>= 4.02). See http://ocaml.org for installation
0) Install OCaml (>= 4.07). See http://ocaml.org for installation
instructions.
Then install the Camplp4 processor in the corresponding distribution.
......@@ -20,7 +20,8 @@ If OCaml has been installed through the OPAM package manager, then:
opam install camlp4
should do the job. Alternatively, see https://github.com/ocaml/camlp4
for download and installation instructions.
for download and installation instructions. You may have to install
the auxiliary package ocamlbuild.
Beware: camlp4 is not updated at every Ocaml distribution, so you may have
to settle for a somewhat ancient version of Ocaml, such as 4.02.2, which is
......
......@@ -40,13 +40,13 @@ order.cmo :
order.cmx :
padapatha.cmo : ../ZEN/word.cmo phonetics.cmo encode.cmo
padapatha.cmx : ../ZEN/word.cmx phonetics.cmx encode.cmx
skt_lexer.cmo : encode.cmo
skt_lexer.cmx : encode.cmx
sanskrit.cmi : ../ZEN/word.cmo
sanskrit.cmo : transduction.cmo skt_lexer.cmo padapatha.cmo encode.cmo \
canon.cmo sanskrit.cmi
sanskrit.cmx : transduction.cmx skt_lexer.cmx padapatha.cmx encode.cmx \
canon.cmx sanskrit.cmi
skt_lexer.cmo : encode.cmo
skt_lexer.cmx : encode.cmx
test_stamp.cmo : version.cmo paths.cmo ../ZEN/gen.cmo control.cmo
test_stamp.cmx : version.cmx paths.cmx ../ZEN/gen.cmx control.cmx
dir.cmi :
......@@ -152,12 +152,12 @@ dispatcher.cmi : ../ZEN/word.cmo phases.cmo morphology.cmi \
load_transducers.cmo html.cmo ../ZEN/deco.cmo auto.cmi
dispatcher.cmo : ../ZEN/word.cmo web.cmo skt_morph.cmi phonetics.cmo \
phases.cmo pada.cmo naming.cmo morphology.cmi load_transducers.cmo \
../ZEN/list2.cmo html.cmo ../ZEN/gen.cmo encode.cmo ../ZEN/deco.cmo \
control.cmo canon.cmo auto.cmi dispatcher.cmi
../ZEN/list2.cmo html.cmo encode.cmo ../ZEN/deco.cmo control.cmo \
canon.cmo auto.cmi dispatcher.cmi
dispatcher.cmx : ../ZEN/word.cmx web.cmx skt_morph.cmi phonetics.cmx \
phases.cmx pada.cmx naming.cmx morphology.cmi load_transducers.cmx \
../ZEN/list2.cmx html.cmx ../ZEN/gen.cmx encode.cmx ../ZEN/deco.cmx \
control.cmx canon.cmx auto.cmi dispatcher.cmi
../ZEN/list2.cmx html.cmx encode.cmx ../ZEN/deco.cmx control.cmx \
canon.cmx auto.cmi dispatcher.cmi
segmenter.cmo : ../ZEN/word.cmo web.cmo phonetics.cmo ../ZEN/list2.cmo \
../ZEN/gen.cmo encode.cmo ../ZEN/deco.cmo auto.cmi
segmenter.cmx : ../ZEN/word.cmx web.cmx phonetics.cmx ../ZEN/list2.cmx \
......@@ -167,7 +167,7 @@ load_morphs.cmo : ../ZEN/word.cmo web.cmo morphology.cmi html.cmo \
load_morphs.cmx : ../ZEN/word.cmx web.cmx morphology.cmi html.cmx \
../ZEN/gen.cmx ../ZEN/deco.cmx control.cmx
lexer.cmi : ../ZEN/word.cmo phases.cmo morphology.cmi load_transducers.cmo \
html.cmo dispatcher.cmi
load_morphs.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_scl.cmo morpho_html.cmo morpho.cmo load_transducers.cmo \
......@@ -193,13 +193,15 @@ 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 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
sanskrit.cmi SCLpaths.cmo phases.cmo paths.cmo paraphrase.cmi \
morpho_html.cmo ../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 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
sanskrit.cmx SCLpaths.cmx phases.cmx paths.cmx paraphrase.cmx \
morpho_html.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
constraints.cmi : skt_morph.cmi morphology.cmi
constraints.cmo : ../ZEN/word.cmo skt_morph.cmi morphology.cmi \
../ZEN/list2.cmo html.cmo canon.cmo constraints.cmi
......@@ -214,10 +216,6 @@ paraphrase.cmx : web.cmx skt_morph.cmi morphology.cmi html.cmx \
constraints.cmx paraphrase.cmi
bank_lexer.cmo :
bank_lexer.cmx :
regression.cmo : web.cmo version.cmo sanskrit.cmi rank.cmo encode.cmo \
date.cmo constraints.cmi bank_lexer.cmo
regression.cmx : web.cmx version.cmx sanskrit.cmx rank.cmx encode.cmx \
date.cmx constraints.cmx bank_lexer.cmx
checkpoints.cmo : phases.cmo encode.cmo control.cmo canon.cmo bank_lexer.cmo
checkpoints.cmx : phases.cmx encode.cmx control.cmx canon.cmx bank_lexer.cmx
graph_segmenter.cmo : ../ZEN/word.cmo web.cmo phonetics.cmo ../ZEN/list2.cmo \
......
#load "dynlink.cma";;
#load "camlp4r.cma";;
#load "camlp4/camlp4r.cma";;
......@@ -5,9 +5,9 @@
# Gérard Huet & Pawan Goyal #
# #
############################################################################
# Makefile of Sanskrit Heritage Software 21-01-2018 Copyright INRIA 2018 #
# Makefile of Sanskrit Heritage Software 09-09-2018 Copyright INRIA 2018 #
############################################################################
# Prerequisites: Ocaml and Camlp4 preprocessor
# Prerequisites: Ocaml 4.07 and Camlp4 preprocessor
# For change of make in all recursive Makefiles
MAKE=make
......@@ -33,9 +33,9 @@ VPATH=$(ZEN)
# CORE package - utilities, transducers, sanskrit and french lexers, dico spec
CORE=$(DISTR_CORE) paths.ml
DISTR_CORE = control.ml version.ml date.ml canon.ml transduction.ml \
encode.ml order.ml padapatha.ml sanskrit.mli \
sanskrit.ml skt_lexer.ml test_stamp.ml dir.mli dir.ml
DISTR_CORE = control.ml version.ml date.ml canon.ml transduction.ml encode.ml \
order.ml padapatha.ml skt_lexer.ml sanskrit.mli sanskrit.ml \
test_stamp.ml dir.mli dir.ml
# GRAM package - phonetics, morphology, segmentation and tagging engines
GRAM = index.ml phonetics.ml int_sandhi.ml skt_morph.mli morphology.mli \
......@@ -86,7 +86,7 @@ COMPILE=ocamlopt -pp "camlp4r pa_extend.cmo" -I $(ZEN) -I +camlp4 -c \
COMPILEI=ocamlc -pp "camlp4r pa_extend.cmo" -I $(ZEN) -I +camlp4 -c \
$(ANNOTFLAGS)
LINK=ocamlopt -I $(ZEN) -I +camlp4 dynlink.cmxa camlp4lib.cmxa
LINK=ocamlopt -I $(ZEN) -I +camlp4 dynlink.cmxa camlp4lib.cmxa
# standard installation of Sanskrit Heritage platform - assumes ZEN library
......@@ -172,7 +172,7 @@ word.cmx deco.cmx zen_lexer.cmx canon.cmx phonetics.cmx transduction.cmx \
encode.cmx html.cmx SCLpaths.cmx web.cmx cgi.cmx naming.cmx morpho_string.cmx \
morpho.cmx order.cmx chapters.cmx morpho_html.cmx lemmatizer.cmx -o lemmatizer
declension: declension.cmx
declension: declension.cmx share.cmx
$(LINK) str.cmxa list2.cmx gen.cmx paths.cmx version.cmx date.cmx control.cmx \
word.cmx canon.cmx zen_lexer.cmx phonetics.cmx transduction.cmx encode.cmx \
deco.cmx int_sandhi.cmx lexmap.cmx inflected.cmx bank_lexer.cmx html.cmx \
......@@ -204,14 +204,17 @@ 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
interface: interface.cmx
LEGACY=
# LEGACY= nums.cmxa
interface: interface.cmx minimap.cmx
$(LINK) str.cmxa unix.cmxa list2.cmx gen.cmx paths.cmx version.cmx date.cmx \
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 bank_lexer.cmx cgi.cmx load_morphs.cmx \
int_sandhi.cmx nouns.cmx share.cmx minimap.cmx mini.cmx nums.cmxa \
int_sandhi.cmx nouns.cmx share.cmx minimap.cmx mini.cmx $(LEGACY) \
graph_segmenter.cmx checkpoints.cmx automaton.cmx params.cmx \
save_corpus_params.cmx dir.cmx corpus.cmx web_corpus.cmx interface.cmx -o interface
......@@ -244,7 +247,7 @@ corpus_manager: corpus_manager_cgi.cmx
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx \
order.cmx chapters.cmx morpho_html.cmx bank_lexer.cmx \
cgi.cmx load_morphs.cmx int_sandhi.cmx nouns.cmx \
share.cmx minimap.cmx mini.cmx nums.cmxa \
share.cmx minimap.cmx mini.cmx $(LEGACY) \
graph_segmenter.cmx checkpoints.cmx automaton.cmx \
params.cmx save_corpus_params.cmx dir.cmx corpus.cmx \
web_corpus.cmx multilingual.cmx \
......@@ -260,7 +263,7 @@ save_corpus: save_corpus_cgi.cmx
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx \
order.cmx chapters.cmx morpho_html.cmx bank_lexer.cmx \
cgi.cmx load_morphs.cmx int_sandhi.cmx nouns.cmx \
share.cmx minimap.cmx mini.cmx nums.cmxa \
share.cmx minimap.cmx mini.cmx $(LEGACY) \
graph_segmenter.cmx checkpoints.cmx automaton.cmx \
params.cmx save_corpus_params.cmx dir.cmx corpus.cmx \
web_corpus.cmx multilingual.cmx \
......@@ -276,7 +279,7 @@ mkdir_corpus: mkdir_corpus_cgi.cmx
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx \
order.cmx chapters.cmx morpho_html.cmx bank_lexer.cmx \
cgi.cmx load_morphs.cmx int_sandhi.cmx nouns.cmx \
share.cmx minimap.cmx mini.cmx nums.cmxa \
share.cmx minimap.cmx mini.cmx $(LEGACY) \
graph_segmenter.cmx checkpoints.cmx automaton.cmx \
params.cmx save_corpus_params.cmx dir.cmx corpus.cmx \
web_corpus.cmx multilingual.cmx \
......@@ -292,7 +295,7 @@ mk_corpus: mk_corpus.cmx
load_transducers.cmx pada.cmx phases.cmx dispatcher.cmx \
order.cmx chapters.cmx morpho_html.cmx bank_lexer.cmx \
cgi.cmx load_morphs.cmx int_sandhi.cmx nouns.cmx \
share.cmx minimap.cmx mini.cmx nums.cmxa \
share.cmx minimap.cmx mini.cmx $(LEGACY) \
graph_segmenter.cmx checkpoints.cmx automaton.cmx \
params.cmx save_corpus_params.cmx dir.cmx corpus.cmx \
web_corpus.cmx multilingual.cmx \
......
......@@ -24,63 +24,63 @@ value hexa_val conf =
;
value decode_url s =
let rec need_decode i =
if i < Bytes.length s then
if i < String.length s then
match s.[i] with
[ '%' | '+' -> True
| _ -> need_decode (succ i)
]
else False in
let rec compute_len i i1 =
if i < Bytes.length s then
if i < String.length s then
let i =
match s.[i] with
[ '%' when i + 2 < Bytes.length s -> i + 3
[ '%' when i + 2 < String.length s -> i + 3
| _ -> succ i
]
in
compute_len i (succ i1)
else i1 in
let rec copy_decode_in s1 i i1 =
if i < Bytes.length s then
if i < String.length s then
let i =
match s.[i] with
[ '%' when i + 2 < Bytes.length s ->
let v = hexa_val s.[i + 1] * 16 + hexa_val s.[i + 2]
in do {Bytes.set s1 i1 (Char.chr v); i + 3}
[ '%' when i + 2 < String.length s ->
let v = hexa_val s.[i+1] * 16 + hexa_val s.[i+2] in
do {Bytes.set s1 i1 (Char.chr v); i + 3}
| '+' -> do {Bytes.set s1 i1 ' '; succ i}
| x -> do {Bytes.set s1 i1 x; succ i}
] in
copy_decode_in s1 i (succ i1)
else s1 in
let rec strip_heading_and_trailing_spaces s =
if Bytes.length s > 0 then
if String.length s > 0 then
if s.[0] == ' ' then
strip_heading_and_trailing_spaces (Bytes.sub s 1 (Bytes.length s - 1))
else if s.[Bytes.length s - 1] == ' ' then
strip_heading_and_trailing_spaces (Bytes.sub s 0 (Bytes.length s - 1))
strip_heading_and_trailing_spaces (String.sub s 1 (String.length s - 1))
else if s.[String.length s - 1] == ' ' then
strip_heading_and_trailing_spaces (String.sub s 0 (String.length s - 1))
else s
else s in
if need_decode 0 then
let len = compute_len 0 0 in
let s1 = Bytes.create len in
strip_heading_and_trailing_spaces (copy_decode_in s1 0 0)
else s;
strip_heading_and_trailing_spaces (Bytes.to_string (copy_decode_in s1 0 0))
else s
;
(* converts a string coming from the URL into an a-list; the string is
a sequence of pairs key=vallue separated by ; or \& *)
a sequence of pairs key=value separated by ; or \& *)
value create_env s =
let rec get_assoc beg i =
if i == Bytes.length s then
if i == beg then [] else [ Bytes.sub s beg (i - beg) ]
if i == String.length s then
if i == beg then [] else [String.sub s beg (i - beg)]
else if s.[i] == ';' || s.[i] == '&' then
let next_i = succ i in
[ Bytes.sub s beg (i - beg) :: get_assoc next_i next_i ]
let next_i = succ i in
[String.sub s beg (i - beg) :: get_assoc next_i next_i]
else get_assoc beg (succ i) in
let rec separate i s =
if i = Bytes.length s then (s, "")
if i = String.length s then (s, "")
else if s.[i] == '=' then
(Bytes.sub s 0 i, Bytes.sub s (succ i) (Bytes.length s - succ i))
(String.sub s 0 i, String.sub s (succ i) (String.length s - succ i))
else separate (succ i) s in
List.map (separate 0) (get_assoc 0 0)
;
......
......@@ -46,7 +46,7 @@ module Analysis : sig
type t
;
value make :
Analyzer.t -> Html.language -> string -> Num.num -> t
Analyzer.t -> Html.language -> string -> int (* Num.num *) -> t
;
value analyzer : t -> Analyzer.t
;
......@@ -54,14 +54,14 @@ module Analysis : sig
;
value checkpoints : t -> string
;
value nb_sols : t -> Num.num
value nb_sols : t -> int (* Num.num *)
;
end = struct
type t =
{ analyzer : Analyzer.t
; lang : Html.language
; checkpoints : string
; nb_sols : Num.num
; nb_sols : int (* Num.num *)
}
;
value make analyzer lang checkpoints nb_sols =
......
......@@ -28,7 +28,7 @@ end
module Analysis : sig
type t
;
value make : Analyzer.t -> Html.language -> string -> Num.num -> t
value make : Analyzer.t -> Html.language -> string -> int (* Num.num *) -> t
;
value analyzer : t -> Analyzer.t
;
......@@ -36,7 +36,7 @@ module Analysis : sig
;
value checkpoints : t -> string
;
value nb_sols : t -> Num.num
value nb_sols : t -> int (* Num.num *)
;
end
;
......
......@@ -528,7 +528,7 @@ value segment_chunk (full,count) chunk last =
; set_offset (succ extremity,future)
; if segmentable then do
{ reset_counter ()
; (full,Num.mult_num count (Num.Int local_count))
; (full,count*local_count) (* overflow may compute modulo *)
(* we have [local_count] segmentations of the local [chunk], and,
chunks being independent, the total number of solutions multiply *)
}
......@@ -536,8 +536,8 @@ value segment_chunk (full,count) chunk last =
}
}
;
value segment_iter chunks = segment_chunks (True,Num.Int 1) chunks
where rec segment_chunks acc = fun (* terminal recursion *)
value segment_iter chunks = segment_chunks (True,1) chunks
where rec segment_chunks acc = fun (* terminal recursion *)
[ [ (* last *) chunk ] -> segment_chunk acc chunk True
| [ chunk :: rest ] -> segment_chunks (segment_chunk acc chunk False) rest
| [] -> acc
......
......@@ -392,10 +392,7 @@ value invoke_SL text cpts corpus_id count sent_id link_num =
ps (td_wrap (call_SL text cpts "t" corpus_id count sent_id link_num
^ "Sanskrit Library Interface"))
;
value update_text_with_sol text count = text ^ ";allSol=" ^ match count with
[ Num.Int n -> string_of_int n
| _ -> "2147483648" (* [2^31] *)
]
value update_text_with_sol text count = text ^ ";allSol=" ^ string_of_int count
;
value call_undo text cpts =
let string_pts = match cpts with
......@@ -435,22 +432,19 @@ value check_sentence translit us text_orig checkpoints sentence
if scl_toggle then
td_wrap (call_reader text cpts "o" ^ "UoH Analysis Mode") |> ps
else () (* [scl_parser] is not visible unless toggle is set *) in
match count with
[ Num.Int n -> if n > max_count then
(* too many solutions would choke the parsers *)
td_wrap ("(" ^ string_of_int n ^ " Solutions)") |> ps
else if n=1 (* Unique remaining solution *) then do
{ td_wrap (call_parser text cpts ^ "Unique Solution") |> ps
; call_scl_parser 1
}
else do
if count > max_count then
(* too many solutions would choke the parsers *)
td_wrap ("(" ^ string_of_int count ^ " Solutions)") |> ps
else if count=1 (* Unique remaining solution *) then do
{ td_wrap (call_parser text cpts ^ "Unique Solution") |> ps
; call_scl_parser 1
}
else do
{ td_wrap (call_reader text cpts "p" ^ "Filtered Solutions") |> ps
; let info = string_of_int n ^ if full then "" else " Partial" in
; let info = string_of_int count ^ if full then "" else " Partial" in
td_wrap (call_reader text cpts "t" ^ "All " ^ info ^ " Solutions") |> ps
; call_scl_parser n
; call_scl_parser count
}
| _ -> td_wrap "(More than 2^32 Solutions!)" |> ps
]
; tr_end |> pl (* tr end *)
; table_end |> pl
; div_end |> ps (* Latin16 *)
......@@ -510,8 +504,8 @@ value save_button query nb_sols =
center_begin ^
cgi_begin save_corpus_cgi "" ^
hidden_input Save_corpus_params.state (escape query) ^
hidden_input Save_corpus_params.nb_sols (nb_sols |> Num.string_of_num |> escape) ^
submit_input "Save" ^
hidden_input Save_corpus_params.nb_sols (nb_sols |> string_of_int |> escape) ^
submit_input "Save" ^
cgi_end ^
center_end
;
......@@ -637,8 +631,8 @@ value graph_engine () = do
; if corpus_permission = Web_corpus.Annotator then
(* TODO: use [segment_iter] to compute the nb of sols instead of
passing 0 to [nb_sols]. *)
save_button query (Num.num_of_int 0) |> pl
else ()
save_button query 0 |> pl
else ()
; html_break |> pl
(* Quit button: continue reading (reader mode)
or quit without saving (annotator mode) *)
......
......@@ -103,8 +103,8 @@ value insert ((pen,min),sol) ((min_pen,sols,saved) as current) =
let rescue = List.fold_right save sols [] in
if rescue=[] then saved else [ (min_pen,rescue) :: saved ]
;
(* Forget absolute penalties of solutions with minimal length penalty *)
(* also used to erase constraints - thus do not eta-reduce !!! *)
(* Forget absolute penalties of solutions with minimal length penalty. *)
(* Also used to erase constraints - thus do not eta-reduce !!! *)
value trim x = List.map snd x
;
(* overflow is None or (Some n) when n solutions with n<Web.truncation *)
......
......@@ -62,7 +62,7 @@ value analysis_of_env env =
let nb_sols =
env
|> Cgi.decoded_get Save_corpus_params.nb_sols "0"
|> Num.num_of_string
|> int_of_string
in
Corpus.Analysis.make Corpus.Analyzer.Graph lang cpts nb_sols
;
......
......@@ -8,4 +8,4 @@
(**************************************************************************)
(* Generated by make version - see main Makefile *)
value version="3.08" and version_date="2018-08-29";
value version="3.09" and version_date="2018-09-09";
......@@ -16,16 +16,21 @@ install the site.
Installation assumes prior installation of Objective Caml available
from site http://ocaml.org. The distribution version
4.02 ought to be used, available at"http://ocaml.org/releases/4.02.html".
More recent distributions may work too, but this has not been tested.
4.07 ought to be used, available at "http://ocaml.org/releases/".
The proper sequence of commands is:
./configure
make world.opt
sudo make install
Then install Camlp4 from GitHub, in the 4.02 branch, available from
https://github.com/ocaml/camlp4/releases; take for instance 4.02+6.
Then install package Ocamlbuild from https://github.com/ocaml/ocamlbuild/releases
for instance OCamlbuild 0.12.0:
make configure
make
make install
Then install Camlp4 from GitHub, in the 4.07 branch, available from
https://github.com/ocaml/camlp4/releases; take for instance 4.07+1.
This should be installed by:
./configure
make all
......
VERSION='3.08'
DATE='2018-08-29'
VERSION='3.09'
DATE='2018-09-09'
......@@ -50,7 +50,7 @@ published recently as
<a href="http://jlm.ipipan.waw.pl/index.php/JLM/article/view/108/140">Design and
analysis of a lean interface for Sanskrit corpus annotation</a>.
<p>
Written on July 22nd 2018, for Sanskrit Engine Version 3.08.
Written on September 9th 2018, for Sanskrit Engine Version 3.09.
<h2 class="b2" id="tour">First approach to using the Sanskrit Heritage engine</h2>
......@@ -264,7 +264,7 @@ The Sanskrit Heritage Dictionary is the latest edition of a Sanskrit
to French Dictionary
"Dictionnaire Français de l'H&eacute;ritage Sanskrit" compiled by
G&eacute;rard Huet since 1994. This dictionary is freely available
as a 936 pages <a href="Heritage.pdf">book</a> under the pdf format,
as a 945 pages <a href="Heritage.pdf">book</a> under the pdf format,
easily readable with Acrobat Reader, a free Adobe product.
This dictionary is still under development, and is
automatically updated along with the site,
......@@ -489,7 +489,7 @@ Thus at best this representation is some approximation of syntax.
Below the three columns you find a button labeled Submit. You may press it
to validate the morphological choices, and the resulting page gives you
a unique parse as a hypertext <i>padapāṭha</i> which you may save in user space.
<!--
<!-- Deprecated
Actually, if you install the software on your own workstation, by configuring it
in mode Station you will have in the page a Validate button
usable to record this solution in a non-regression suite. -->
......@@ -867,7 +867,7 @@ first verse should not be glued by sandhi to the second one.
preserving the current mode, you can click on the title of any page of
the corpus browser.
<!-- Undocumented
<!-- Deprecated
<h2 class="b2" id="regression">Regression analysis</h2>
If you install
......
......@@ -227,7 +227,9 @@ Metrically Restored Text by Karen Thomson and Jonathan Slocum</a><br>
<a href="http://www.unipune.ac.in/dept/fine_arts/centre_for_advanced_study_in_sanskrit/default.htm">Centre of Advanced Study of Sanskrit, Pune University</a><br>
<!-- OBS <a href="http://www.unipune.ernet.in/dept/sanskrit/welcome.html">Department of Sanskrit and Prakrit Languages, Pune University</a><br> -->
<a href="http://www.unipune.ac.in/dept/fine_arts/sanskrit_and_pakrit/default.htm">Department of Sanskrit and Prakrit Languages, Pune University</a><br>
<a href="http://sanskrit.uohyd.ernet.in/">Department of Sanskrit Studies, University of Hyderabad</a><br>
<!-- ernet obsolete
<a href="http://sanskrit.uohyd.ernet.in/">Department of Sanskrit Studies, University of Hyderabad</a><br>-->
<a href="http://sanskrit.uohyd.ac.in/">Department of Sanskrit Studies, University of Hyderabad</a><br>
<a href="http://www.bhu.ac.in/Sanskrit/">Department of Sanskrit, Faculty of
Arts, Banaras Hindu University, Varanasi</a><br>
<a href="http://ignca.nic.in/welcome.html">Kalakosa, Indira Gandhi National Center for the Arts</a><br>
......@@ -240,9 +242,11 @@ Arts, Banaras Hindu University, Varanasi</a><br>
<!-- obsolete <a href="http://www.jnu.ac.in/Academics/SpecialCentres/Sanskrit/index.html">Center for Sanskrit Studies, J.N.U., New Delhi</a><br> -->
<a href="http://sanskrit.jnu.ac.in/index.jsp">Special Center for Sanskrit Studies, Jawaharal Nehru University, New Delhi</a><br>
<a href="http://www.cfilt.iitb.ac.in/">Center for Indian Language
Technology, Indian Institute of Technology, Bombay</a><br>
<a href="http://www.indiaeducation.ernet.in/insitutions/PROFILENEW.ASP?no=U01763">Lal Bahadur Shastri Rashtriya Sanskrit Vidyapeetha, Delhi</a><br>
<a href="http://www.sanskrituni.net/">Kavikulguru Kalidas Sanskrit University, Ramtek, Maharashtra</a><br>
Technology, Indian Institute of Technology, Bombay</a><br>-->
<!-- obsolete<a href="http://www.indiaeducation.ernet.in/insitutions/PROFILENEW.ASP?no=U01763">Lal Bahadur Shastri Rashtriya Sanskrit Vidyapeetha, Delhi</a><br>-->
<a href="http://www.slbsrsv.ac.in/home.asp">Lal Bahadur Shastri Rashtriya Sanskrit Vidyapeetha, Delhi</a><br>-->
<!-- obsolete <a href="http://www.sanskrituni.net/">Kavikulguru Kalidas Sanskrit University, Ramtek, Maharashtra</a><br>-->
<a href="http://kksanskrituni.digitaluniversity.ac">Kavikulguru Kalidas Sanskrit University, Ramtek, Maharashtra</a>
<a href="http://mpsvvujjain.org/">Panini Sanskrit University, Ujjain</a><br>
<a href="http://www.shadvala.de/en/center/">Shadvala Center for Sanskrit Studies, Goa</a><br>
<!-- obsolete <a href="http://www.education.nic.in/htmlweb/prolan.htm">Indian Government Policy on Languages Development</a><br> -->
......@@ -585,7 +589,8 @@ at Maharishi University of Management</a><br>
<a href="http://www.mpg.de/english/aboutTheSociety/aboutUs/scientificAwards/awardsOfMPS/MPResearchAward/mpfp2000/wezler_albrecht/index.html">Albrecht Wezler's citation for Max Planck Research Award for Humanities</a><br>
<a href="http://www.aai.uni-hamburg.de/IndTib/Personal/Vita-Isaacson.pdf">Harunaga Isaacson's home page at Universit&auml;t Hamburg</a><br>
<a href="http://www.jambudvipa.net/jambu.htm">Jambudvipa site of Paolo Magnone</a><br>
<a href="http://www.fh-furtwangen.de/fachbereiche/in/deutsch/ueberuns/mitglieder/GerdUnruh.html">Gerd Unruh's home page</a><br>
<!-- Stale 2018
<a href="http://www.fh-furtwangen.de/fachbereiche/in/deutsch/ueberuns/mitglieder/GerdUnruh.html">Gerd Unruh's home page</a><br>-->
<a href="http://www.iran-inde.cnrs.fr/spip.php?article210">Sylvain Brocquet's
home page</a><br>
<!-- next was in "http://mkmartand.blogspot.com/" -->
......
......@@ -84,17 +84,19 @@ COMPILE=ocamlopt -pp "camlp4rf" -I +camlp4 -c $(ANNOTFLAGS)
COMPILEI=ocamlc -pp "camlp4rf" -I +camlp4 -c $(ANNOTFLAGS)
LINK=ocamlopt -I +camlp4
LINK=ocamlopt -I +camlp4 dynlink.cmxa camlp4lib.cmxa
LINKG=ocamlopt -I +camlp4 dynlink.cmxa camlp4lib.cmxa
LINK_BYTE=ocamlc -I +camlp4
LINK_BYTEG=ocamlc -I +camlp4 dynlink.cma camlp4lib.cma
# NB regular.ml compiled as regular.cmo for meta-programming - regular.cmx unused
all: timeshare unshare make_english_lexicon make_french_lexicon dagify \
terdagify list_iso test unglue_test.cmx minimap.cmx lexmap.cmx bintree.cmx \
deco.cmx zen_lexer.cmx transducer.cmx sharemod.cmx react0.cmx reactt.cmx reacte.cmx \
regular.cmo #specific_cmx
all: timeshare unshare make_english_lexicon dagify \
terdagify test minimap.cmx lexmap.cmx bintree.cmx \
deco.cmx zen_lexer.cmx transducer.cmx sharemod.cmx react0.cmx reactt.cmx \
reacte.cmx regular.cmo #specific_cmx
problematic: make_french_lexicon list_iso unglue_test.cmx
# specific dispatch and engine modules
specific_cmx: example_dispatch.cmx sanskrit_dispatch.cmx example_engine.cmx \
......
......@@ -58,7 +58,7 @@ value union2 e l =
if List.mem e l then (raise Twice_the_same_value) else [ e :: l ]
;
(* Terminal recursive union of finite sets represented as as lists - does not
(* Terminal recursive union of finite sets represented as lists - does not
respect the order of elements in [l1]: [union_f [ 1; 2 ] [] = [ 2; 1 ]] *)
value rec union_f l1 l2 =
match l1 with
......@@ -67,10 +67,10 @@ value rec union_f l1 l2 =
]
;
(* Same, respecting the order: *)
(* Same, respecting the order, but not tail-recursive: *)
value union l1 l2 = List.fold_right union1 l1 l2
;
value set_of l = (*i eta expansion for polymorphism i*)
value set_of l = (*i Caution: eta expansion needed for polymorphism i*)
let add acc x = if List.mem x acc then acc else [ x :: acc ] in
List.fold_left add [] l
;
......@@ -84,8 +84,8 @@ value rec last = fun
;
(* [split n l] returns a pair of lists [(prefix, suffix)] such that
[prefix @ suffix = l] and [List.length prefix = n]. Raise [Failure
"split"] if [n < 0] or [n > List.length l]. *)
[prefix @ suffix = l] and [List.length prefix = n].
Raises [Failure "split"] if [n < 0] or [n > List.length l]. *)
value split n l = aux n l []
where rec aux n l acc =
if n = 0 then (List.rev acc, l) else
......@@ -95,15 +95,14 @@ value split n l = aux n l []
]
;
(* [truncate n l] removes from [l] its initial sublist of length [n]. *)
(* *)
(* [truncate : int -> list 'a -> list 'a] *)
value truncate n l =
try snd (split n l) with [ Failure _ -> failwith "truncate" ]
;
(* [take_prefix n l] returns the first [n] elements of [l] (in the same
order of appearance in [l]). If [n > List.length l], then it returns
the whole list [l]. Raise [Failure "take_prefix"] if [n < 0] or [n >
List.length l]. *)
order of occurrence as in [l]). If [n > List.length l], then it returns
the whole list [l].
Raises [Failure "take_prefix"] if [n < 0] or [n > List.length l]. *)
value take_prefix n l =
try fst (split n l) with [ Failure _ -> failwith "take_prefix" ]
;
......@@ -135,13 +134,11 @@ value explode s =
;
(* [implode: list char -> string] *)
value implode l =
let result = Bytes.create (List.length l) in
let rec loop i = fun
[ [] -> result
| [ c :: cs ] -> do { Bytes.set result i c; loop (i + 1) cs }
] in
loop 0 l
value implode chars =
let buf = Buffer.create 16 in do
{ List.iter (Buffer.add_char buf) chars
; Buffer.contents buf
}
;
(* Process a list with using [pr] for elements and [sep] for separator *)
......
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