debug.ml 3.99 KB
Newer Older
huet's avatar
huet committed
1 2 3 4 5 6 7 8 9 10 11
(**************************************************************************)
(*                                                                        *)
(*                     The Sanskrit Heritage Platform                     *)
(*                                                                        *)
(*                       Gérard Huet & Pawan Goyal                        *)
(*                                                                        *)
(* ©2017 Institut National de Recherche en Informatique et en Automatique *)
(**************************************************************************)

(****************************************************************)
(* Beware - remove foo.mli and make depend before debugging foo *)
12
(* Better yet - remove *.mli (saving them) to get transparency. *) 
huet's avatar
huet committed
13 14
(****************************************************************)

15
(* debugging context building - to adapt according to needs *)
huet's avatar
huet committed
16 17

#load "../ZEN/list2.cmo"; 
18 19
#load "../ZEN/gen.cmo";
open Gen;
huet's avatar
huet committed
20 21 22 23 24 25 26 27
#load "../ZEN/word.cmo"; open Word;
#load "../ZEN/share.cmo";    
#load "../ZEN/trie.cmo";    
#load "../ZEN/deco.cmo"; open Deco;   
#load "../ZEN/lexmap.cmo"; open Lexmap;   
#load "../ZEN/zen_lexer.cmo";  

#load "paths.cmo"; 
28 29
#load "version.cmo";
open Version;
huet's avatar
huet committed
30 31
#load "date.cmo"; 
#load "html.cmo"; 
Gérard Huet's avatar
Gérard Huet committed
32
(* #load "web.cmo";
33
open Web;
Gérard Huet's avatar
Gérard Huet committed
34
#load "cgi.cmo"; *)
35 36 37 38
#load "canon.cmo";
open Canon;
#load "phonetics.cmo";
open Phonetics;   
huet's avatar
huet committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

open List;
#load "transduction.cmo"; 
open Transduction;
#load "encode.cmo"; 
open Encode;

#load "sandhi.cmo"; 
open Sandhi;


#load "padapatha.cmo"; 
#load "skt_lexer.cmo";  
#load "sanskrit.cmo"; 
open Sanskrit;  

#load "int_sandhi.cmo"; 
open Int_sandhi; 
57 58 59 60 61
#load "order.cmo"; 
#load "sandhi.cmo"; 
#load "inflected.cmo"; 

#load "parts.cmo";  
huet's avatar
huet committed
62

63 64 65 66 67 68 69 70 71 72
#load "control.cmo";  

#load "pada.cmo";  

#load "verbs.cmo";  
open Verbs; 

(* 
#load "int_sandhi.cmo"; 
open Int_sandhi; 
huet's avatar
huet committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
#load "order.cmo"; 
#load "sandhi.cmo"; 
#load "inflected.cmo"; 
#load "make_preverbs.cmo"; 
open Make_preverbs;
all_preverbs_morph;
*)
(* 
#load "dispatch.cmo"; 
#load "bank_lexer.cmo"; 
#load "graph.cmo"; 
open Graph;
*)

(* OBS
#load "fr_lexer.cmo";  
#load "dico_lexer.cmo"; 
#load "french.cmo"; 
open French;  
#load "order.cmo";  
#load "naming.cmo"; 
open Naming;


#load "morpho_string.cmo"; 
#load "morpho.cmo"; 
open Morpho; 

 
#load "inflected.cmo"; 
open Inflected; 
#load "index.cmo";  
 
(* #load "subst.cmo"; open Subst; *)

#load "bank_lexer.cmo"; 
#load "nouns.cmo"; 
open Nouns; 

#load "parts.cmo";  
open Parts;  
#load "pada.cmo";  
open Pada; 

(* first remove verbs.mli in order to export all definitions *)
#load "verbs.cmo";  
open Verbs; 
*)
print_string "done"; 

(* Morpho debug 

(* #load "../ZEN/mini.cmo"; *)
(* #load "make_inflected.cmo"; open Make_inflected; -- costly *)
(* #load "morpho_debug.cmo"; open Morpho_debug; *)

(* Debug de Roots
value vl = (Gen.gobble Install.verblinks_file : list Roots.preverbs_tree);
List.assoc (string_to_skt "h.r#1") vl;
List.assoc "vih.r" vl;
List.assoc "pravih.r" vl;
List.assoc "sa.mpravih.r" vl;
*)

(* Test de déclinaisons 
value test_decls () = (Gen.gobble Install.nouns_file : inflected_map);

value d = test_decls (); 
(* value c = contents_map d; (* Stack overflow *) *)
value (i,m) = match d with [ Map (i,m) -> (i,m) ]; 
value (n,da) = hd m; 
value ca = contents_map da; 
value (w1,im1) = hd ca;
print_inverse_map [ 1 :: w1 ] im1; 
(* a"m"sa <= { iic. | voc. sg. m. }[a"m"sa] *)

*)

(*
#load "constraints.cmo"; 
open Constraints;
*)

(* Testing Parse_tree etc *)

#load "dispatch11.cmo"; 
#load "stemmer.cmo"; 
open Stemmer;

#load "bank_lexer.cmo";
#load "parse_tree.cmo"; 
open Parse_tree;

value parse = parse_tree;

(* Example where a unit solution is not found first (for word vadanti)
parse "[S [ADV tat ] [ADV kim ] 
       [NP6 asya ] 
       [NP1s manu.syaa.h ] 
       [VP [NP2 __ [AP2 raak.sasiim ] vaacam ] vadanti ] ]";
*)

parse "[S [INJ haa ] [ADV katham ] [NP1s [NP6 vi.s.no.h ] 
       (dharma<daaraa.h) ] [VP 0 [NP1 (priya<sakhii) [NP6 me ] 
       lalitaa ] ] ]";
*)