equal
deleted
inserted
replaced
214 encode_str name ^ |
214 encode_str name ^ |
215 (if Real.== (weight, 1.0) then "" else "=" ^ Markup.print_real weight) |
215 (if Real.== (weight, 1.0) then "" else "=" ^ Markup.print_real weight) |
216 |
216 |
217 val encode_features = map encode_feature #> space_implode " " |
217 val encode_features = map encode_feature #> space_implode " " |
218 |
218 |
|
219 val str_of_saveless_shutdown = "S\n" |
|
220 |
219 fun str_of_learn (name, parents, feats, deps) = |
221 fun str_of_learn (name, parents, feats, deps) = |
220 "! " ^ encode_str name ^ ": " ^ encode_strs parents ^ "; " ^ |
222 "! " ^ encode_str name ^ ": " ^ encode_strs parents ^ "; " ^ |
221 encode_features feats ^ "; " ^ encode_strs deps ^ "\n" |
223 encode_features feats ^ "; " ^ encode_strs deps ^ "\n" |
222 |
224 |
223 fun str_of_relearn (name, deps) = |
225 fun str_of_relearn (name, deps) = |
247 struct |
249 struct |
248 |
250 |
249 fun unlearn ctxt = |
251 fun unlearn ctxt = |
250 let val path = mash_model_dir () in |
252 let val path = mash_model_dir () in |
251 trace_msg ctxt (K "MaSh unlearn"); |
253 trace_msg ctxt (K "MaSh unlearn"); |
|
254 run_mash_tool ctxt false ([()], K str_of_saveless_shutdown); |
252 try (File.fold_dir (fn file => fn _ => |
255 try (File.fold_dir (fn file => fn _ => |
253 try File.rm (Path.append path (Path.basic file))) |
256 try File.rm (Path.append path (Path.basic file))) |
254 path) NONE; |
257 path) NONE; |
255 () |
258 () |
256 end |
259 end |