amalgame/commit

IMPROVED: added ambiguous label and concept lists in stats

authorJacco van Ossenbruggen
Thu Apr 30 18:08:45 2015 +0200
committerJacco van Ossenbruggen
Thu Apr 30 18:08:45 2015 +0200
commit570711c297c490df6c15ac870f201839f143416b
tree125c76bdf8d8514efae93ed78ed5efc7bccfa869
parent640d6968b380844cbf2890eea86d96e348a62c5d
Diff style: patch stat
diff --git a/lib/amalgame/scheme_stats.pl b/lib/amalgame/scheme_stats.pl
index e8e6c44..a714a85 100644
--- a/lib/amalgame/scheme_stats.pl
+++ b/lib/amalgame/scheme_stats.pl
@@ -43,7 +43,11 @@ scheme_stats(Strategy, Scheme, ConceptAssoc, Stats) :-
 	assoc_to_keys(ConceptAssoc, Concepts),
 	length(Concepts, TotalCount).
 
-scheme_stats_deep(_Strategy, Scheme, ConceptAssoc, Stats) :-
+scheme_stats_deep(Strategy, Scheme, ConceptAssoc, Stats) :-
+	atomic_list_concat([scheme_stats_deep_,Scheme], Mutex),
+	with_mutex(Mutex, scheme_stats_deep_(Strategy, Scheme, ConceptAssoc, Stats)).
+
+scheme_stats_deep_(_Strategy, Scheme, ConceptAssoc, Stats) :-
 	Stats = scheme_stats_dict{
 		    '@private': Private,
 		    formats: Formats,
@@ -109,8 +113,10 @@ group_lengths([K-SortedPairs|T], [K-LDict|TLength]) :-
 	length(UniqDubConcepts, UniqDubConceptsCount),
 	LDict=label{
 		  totalConceptCount:     UniqConceptsCount,
-		  ambiguousConceptCount: UniqDubConceptsCount,
 		  totalLabelCount:       TotalLabelCount,
+		  ambiguousConcepts:	 UniqDubConcepts,
+		  ambiguousConceptCount: UniqDubConceptsCount,
+		  ambiguousLabels:       UniqDubLabels,
 		  ambiguousLabelCount:   UniqDubLabelsCount
 	      },
 	group_lengths(T, TLength).