Commit 31974f95 authored by Idir Lankri's avatar Idir Lankri

Add skeleton for CGI add_corpus

parent afc55084
......@@ -5,6 +5,7 @@
*.o
# Executables
ML/add_corpus
ML/conjugation
ML/css
ML/declension
......
......@@ -279,3 +279,5 @@ mk_sandhi_page.cmo : web.cmo html.cmo
mk_sandhi_page.cmx : web.cmx html.cmx
manager.cmo : web.cmo html.cmo dir.cmi cgi.cmo
manager.cmx : web.cmx html.cmx dir.cmx cgi.cmx
add_corpus.cmo : web.cmo html.cmo
add_corpus.cmx : web.cmx html.cmx
......@@ -52,7 +52,7 @@ 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 morpho_scl.ml \
mk_index_page.ml mk_grammar_page.ml mk_reader_page.ml mk_sandhi_page.ml \
manager.ml
manager.ml add_corpus.ml
# extra file SCLpaths.ml for SCL interfacing - not distributed.
# TREE package - tree bank manager and syntax analyser - legacy
......@@ -136,7 +136,7 @@ bank_lexer.cmo tag_tree.cmo tag_apte.cmo
(cat debug_apte.ml ; cat -) | ocaml -I +camlp4 -I . -I $(ZEN)
cgis: skt_morph.cmi auto.cmi indexer indexerd declension conjugation \
lemmatizer reader parser sandhier reader interface user_aid manager
lemmatizer reader parser sandhier reader interface user_aid manager add_corpus
indexer: indexer.cmx
$(LINK) list2.cmx gen.cmx paths.cmx version.cmx date.cmx \
......@@ -221,6 +221,10 @@ manager: manager.cmx
$(LINK) paths.cmx version.cmx date.cmx html.cmx SCLpaths.cmx \
web.cmx cgi.cmx dir.cmx $< -o $@
add_corpus: add_corpus.cmx
$(LINK) paths.cmx version.cmx date.cmx html.cmx SCLpaths.cmx \
web.cmx cgi.cmx $< -o $@
css: css.cmx
$(LINK) gen.cmx paths.cmx version.cmx date.cmx html.cmx \
SCLpaths.cmx web.cmx css.cmx -o css
......@@ -314,7 +318,7 @@ clean:
rm -f *.cmo *.cmi *.cmx *.ppi *.ppo *.o
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 manager \
mk_sandhi_page sandhi_test reset_caches interface user_aid manager add_corpus \
parse_apte tag_apte
# make dico.cmi auto.cmi conj_infos.cmi # needed to get dependencies right
......
(* CGI script [add_corpus] for adding a sentence to the corpus. *)
(*i module Add_corpus = struct i*)
value make () =
let title = "TODO" in
let meta_title = Html.title title in
let style = Html.background Html.Chamois in
do
{ Web.http_header |> Web.pl
; Web.page_begin meta_title
; Html.body_begin style |> Web.pl
; Html.h1_title title |> Web.pl
; Web.page_end Html.default_language True }
;
(***************)
(* Entry point *)
(***************)
value main = make ()
;
(*i end; i*)
(* CGI script [manager] for corpus management, i.e. for listing and
adding sentences to the corpus. *)
(* CGI script [manager] for corpus management, i.e. for listing
sentences of the corpus and calling [add_corpus] to add a sentence to
the corpus. *)
(*i module Manager = struct i*)
......@@ -16,7 +17,12 @@ value subdir_selection dir subdirs =
;
value body dir subdirs =
match subdirs with
[ [] -> sentence_links dir |> List.iter Web.pl
[ [] ->
do
{ sentence_links dir |> List.iter Web.pl
; Web.cgi_begin Web.add_corpus_cgi "" |> Web.pl
; Html.submit_input "Add" |> Web.pl
; Web.cgi_end |> Web.pl }
| _ ->
do
{ Web.cgi_begin Web.manager_cgi "" |> Web.pl
......
......@@ -52,6 +52,7 @@ and graph_cgi = cgi_bin Paths.cgi_graph (* summarizer graphical interf
and user_aid_cgi = cgi_bin Paths.cgi_user_aid (* unknown chunks processing *)
and sandhier_cgi = cgi_bin Paths.cgi_sandhier (* sandhier *)
and manager_cgi = cgi_bin Paths.cgi_manager (* Corpus manager *)
and add_corpus_cgi = cgi_bin Paths.cgi_add_corpus
;
(* Absolute paths on development site *)
value resources name = Paths.skt_resources_dir ^ name ^ "/"
......
......@@ -182,6 +182,9 @@ CGIGRAPH=sktgraph$(CGIEXT)
CGIUSER=sktuser$(CGIEXT)
# CGI name under which the corpus manager is installed on the server.
CGIMANAGER = manager$(CGIEXT)
# CGI name under which the program that enriches the corpus is installed
# on the server.
CGIADDCORPUS = addcorpus$(CGIEXT)
# what mouse action to use for viewing lemmatization
MOUSEACTION=#MOUSEACTION
......@@ -240,7 +243,8 @@ 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_scl.ml ML/compute_mw_links.ml ML/manager.ml
ML/mk_sandhi_page.ml ML/morpho_scl.ml ML/compute_mw_links.ml ML/manager.ml \
ML/add_corpus.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 \
......@@ -411,6 +415,7 @@ echo 'and cgi_sandhier = "$(CGISANDHI)"'; \
echo 'and cgi_graph = "$(CGIGRAPH)"'; \
echo 'and cgi_user_aid = "$(CGIUSER)"'; \
echo 'and cgi_manager = "$(CGIMANAGER)"'; \
echo 'and cgi_add_corpus = "$(CGIADDCORPUS)"'; \
echo 'and mouse_action = "$(MOUSEACTION)";') > ML/paths.ml
$(MAKE) version
......@@ -475,6 +480,7 @@ releasecgi:
$(MAKE) analyser
$(MAKE) sandhi
$(MAKE) manager
$(MAKE) addcorpus
abrevs:
cp $(BOOK)/abrevs.pdf SITE # for documenting the Website with abbreviations
......@@ -560,6 +566,10 @@ indexers: ML/indexer ML/indexerd
manager: ML/manager
cp $< $(CGIDIR)$(CGIMANAGER)
.PHONY: addcorpus
addcorpus: ML/add_corpus
cp $< $(CGIDIR)$(CGIADDCORPUS)
#### Version Management and Distribution are now managed by Git ####
##############################
......
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