amalgame/commit

FIXED: missing evidence tracking on undecided

authorJacco van Ossenbruggen
Tue Aug 26 13:27:22 2014 +0200
committerJacco van Ossenbruggen
Tue Aug 26 13:27:22 2014 +0200
commit908cd7bea304254efbf4574f5e7f4128d62d83ff
tree4f595eb0a3b33e45895b1662d25db7da453586d7
parentb79623e2f062c71efbfa98c13921c289c55a1d2d
Diff style: patch stat
diff --git a/lib/ag_modules/most_labels.pl b/lib/ag_modules/most_labels.pl
index ba2de22..35d0bf4 100644
--- a/lib/ag_modules/most_labels.pl
+++ b/lib/ag_modules/most_labels.pl
@@ -46,7 +46,9 @@ partition_(source, [align(S,T,P)|At], Sel, Dis, Und) :-
 	->  Sel = [Selected|SelRest],
 	    append(Discarded, DisRest, Dis),
 	    Und = UndRest
-	;   append([align(S,T,P)|Same], UndRest, Und),
+	;   Undecided = [align(S,T,P)|Same],
+	    maplist(ap(source, undecided), Undecided, UndecidedP),
+	    append(UndecidedP, UndRest, Und),
 	    Sel = SelRest,
 	    Dis = DisRest
 	),
@@ -58,17 +60,25 @@ partition_(target, [align(S,T,P)|As], Sel, Dis, Und) :-
 	->  Sel = [Selected|SelRest],
 	    append(Discarded, DisRest, Dis),
 	    Und = UndRest
-	;   append([align(S,T,P)|Same], UndRest, Und),
+	;   Undecided = [align(S,T,P)|Same],
+	    maplist(ap(target, undecided), Undecided, UndecidedP),
+	    append(UndecidedP, UndRest, Und),
 	    Sel = SelRest,
 	    Dis = DisRest
 	),
 	partition_(target, Rest, SelRest, DisRest, UndRest).
 
+ap(Type, Result, align(S,T,P), align(S,T,Pnew)) :-
+	append([[method(most_labels),
+		    score([result(Result), type(Type)])
+		]], P, Pnew).
+
 ap(Type, Result, Most, SecondMost, align(S,T,P), align(S,T,Pnew)) :-
-	append(P, [[method(most_labels),
-		    score([result(Result), type(Type),
-			   most(Most),
-			   second(SecondMost)])]], Pnew).
+	append([[method(most_labels),
+		 score([result(Result), type(Type),
+			most(Most),
+			second(SecondMost)])
+		]], P, Pnew).
 
 most_labels(Type, As, Selected, Discarded) :-
 	group_label_count(As, Counts),
diff --git a/lib/ag_modules/most_methods.pl b/lib/ag_modules/most_methods.pl
index 1b3c354..3c82e6a 100644
--- a/lib/ag_modules/most_methods.pl
+++ b/lib/ag_modules/most_methods.pl
@@ -34,15 +34,24 @@ selecter(AlignmentGraph, S, D, U, Options) :-
 	predsort(ag_map:compare_align(source), Disc0, D),
 	predsort(ag_map:compare_align(source), Und0,  U).
 
+ap(Type, Result, align(S,T,P), align(S,T,Pnew)) :-
+	append([[method(most_methods),
+		 score([ result(Result),
+			 type(Type)
+		       ])
+		]],
+	       P,
+	       Pnew).
 ap(Type, Result, Most, SecondMost, align(S,T,P), align(S,T,Pnew)) :-
-	append(P, [[method(most_methods),
-		    score([ result(Result),
-			    most(Most),
-			    type(Type),
-			    second(SecondMost)])]],
+	append([[method(most_methods),
+		 score([ result(Result),
+			 type(Type),
+			 most(Most),
+			 second(SecondMost)])
+		]],
+	       P,
 	       Pnew).
 
-
 partition_(_, [], [], [], []).
 partition_(source, [align(S,T,P)|As], Sel, Dis, Und) :-
 	same_target(As, T, Same, Rest),
@@ -50,8 +59,9 @@ partition_(source, [align(S,T,P)|As], Sel, Dis, Und) :-
 	->  Sel = [Selected|SelRest],
 	    append(Discarded, DisRest, Dis),
 	    Und = UndRest
-	;   Pu = [[method(most_methods), score([result(undecided), type(source)])]|P],
-	    append([align(S,T,Pu)|Same], UndRest, Und),
+	;   Undecided = [align(S,T,P)|Same],
+	    maplist(ap(source, undecided), Undecided, UndecidedP),
+	    append(UndecidedP, UndRest, Und),
 	    Sel = SelRest,
 	    Dis = DisRest
 	),
@@ -63,8 +73,9 @@ partition_(target, [align(S,T,P)|As], Sel, Dis, Und) :-
 	->  Sel = [Selected|SelRest],
 	    append(Discarded, DisRest, Dis),
 	    Und = UndRest
-	;   Pu = [[method(most_methods), score([result(undecided), type(target)])]|P],
-	    append([align(S,T,Pu)|Same], UndRest, Und),
+	;   Undecided = [align(S,T,P)|Same],
+	    maplist(ap(target, undecided), Undecided, UndecidedP),
+	    append(UndecidedP, UndRest, Und),
 	    Sel = SelRest,
 	    Dis = DisRest
 	),