amalgame/commit

FIXED: broken sort/msort logic in statics

authorJacco van Ossenbruggen
Fri May 8 14:02:42 2015 +0200
committerJacco van Ossenbruggen
Fri May 8 14:02:42 2015 +0200
commitcb71d74e99614f1060db5f30346812116c97acc6
treede182425254228c443145f628c9e6c0a4747f698
parent5e34550c292e45c2737d04d140cc17c0b52a4ccf
Diff style: patch stat
diff --git a/lib/amalgame/ag_stats.pl b/lib/amalgame/ag_stats.pl
index 77eca49..f70e2de 100644
--- a/lib/amalgame/ag_stats.pl
+++ b/lib/amalgame/ag_stats.pl
@@ -122,8 +122,8 @@ mapping_stats(URL, Mapping, Strategy, Stats) :-
 	;   VocStats = [], CarthesianProductSize = 0
 	),
 
-	(   ground(StatsSin), Smap = StatsSin.get('@private').get(depthMap),
-	    ground(StatsTin), Tmap = StatsTin.get('@private').get(depthMap)
+	(   nonvar(StatsSin), Smap = StatsSin.get('@private').get(depthMap),
+	    nonvar(StatsTin), Tmap = StatsTin.get('@private').get(depthMap)
 	->  structure_stats(depth,    Ss, Smap, DSstats),
 	    structure_stats(children, Ss, Smap, BSstats),
 	    structure_stats(depth,    Ts, Tmap, DTstats),
@@ -170,7 +170,7 @@ structure_stats(_,[],_,[]).
 structure_stats(_,[_],_,[]).
 structure_stats(Type, Concepts, Map, Stats) :-
 	maplist(concept_depth(Type,Map), Concepts, Depths),
-	sort(Depths, DepthsSorted),
+	msort(Depths, DepthsSorted),
 	list_five_number_summary(DepthsSorted, OptionFormat),
 	dict_create(Stats, stats, OptionFormat).
 
diff --git a/lib/amalgame/scheme_stats.pl b/lib/amalgame/scheme_stats.pl
index a714a85..9e55025 100644
--- a/lib/amalgame/scheme_stats.pl
+++ b/lib/amalgame/scheme_stats.pl
@@ -224,8 +224,8 @@ compute_depth_stats(Voc, Assoc, Public, Private) :-
 	atomic_list_concat([depth_stats_, Voc], Mutex),
 	with_mutex(Mutex, compute_depths(Mutex,TopConcepts,Assoc,Depths)),
 	assoc_to_values(Depths, Pairs),
-	pairs_keys(Pairs,   DepthCounts0), sort(DepthCounts0, DepthCounts),
-	pairs_values(Pairs, ChildCounts0), sort(ChildCounts0, ChildCounts),
+	pairs_keys(Pairs,   DepthCounts0), msort(DepthCounts0, DepthCounts),
+	pairs_values(Pairs, ChildCounts0), msort(ChildCounts0, ChildCounts),
 	list_five_number_summary_dict(DepthCounts, DC5),
 	list_five_number_summary_dict(ChildCounts, CC5).