fix use of rm * when we have lots of examples.
This commit is contained in:
parent
a3ac75edcc
commit
0d23db6b6d
@ -648,12 +648,18 @@ init_learning :-
|
|||||||
|
|
||||||
|
|
||||||
delete_all_queries :-
|
delete_all_queries :-
|
||||||
learning_flag(query_directory,Directory),
|
remove_queries,
|
||||||
atomic_concat(['rm -f ',Directory,'query_*'],Command),
|
|
||||||
(shell(Command) -> true; true),
|
|
||||||
retractall(query_is_similar(_,_)),
|
retractall(query_is_similar(_,_)),
|
||||||
retractall(query_md5(_,_,_)).
|
retractall(query_md5(_,_,_)).
|
||||||
|
|
||||||
|
remove_queries :-
|
||||||
|
learning_flag(query_directory,Directory),
|
||||||
|
user:example(ID,_,_),
|
||||||
|
atomic_concat([Directory,'query_',ID],File),
|
||||||
|
delete_file(File),
|
||||||
|
fail.
|
||||||
|
remove_queries.
|
||||||
|
|
||||||
empty_output_directory :-
|
empty_output_directory :-
|
||||||
learning_flag(output_directory,Directory),
|
learning_flag(output_directory,Directory),
|
||||||
atomic_concat(['rm -f ',Directory,'log.dat ',
|
atomic_concat(['rm -f ',Directory,'log.dat ',
|
||||||
@ -683,9 +689,9 @@ init_queries :-
|
|||||||
( % go over all training examples
|
( % go over all training examples
|
||||||
current_predicate(user:example/3),
|
current_predicate(user:example/3),
|
||||||
user:example(ID,Query,Prob),
|
user:example(ID,Query,Prob),
|
||||||
% statistics(runtime,[_,T]),
|
statistics(runtime,[_,T]),
|
||||||
% my_format(3,' training example ~q: ~q ~q~n',[ID,Query,T]),
|
my_format(3,' training example ~q: ~q after ~q msec~n',[ID,Query,T]),
|
||||||
my_format(3,' training example ~q: ~q~n',[ID,Query]),
|
% my_format(3,' training example ~q: ~q~n',[ID,Query]),
|
||||||
flush_output(user),
|
flush_output(user),
|
||||||
init_one_query(ID,Query,training),
|
init_one_query(ID,Query,training),
|
||||||
fail; %go to next training example
|
fail; %go to next training example
|
||||||
|
Reference in New Issue
Block a user