virgil/commit

Do not normalize in mentions API

authorMichiel Hildebrand
Tue Jul 16 00:17:09 2013 +0200
committerMichiel Hildebrand
Tue Jul 16 00:17:09 2013 +0200
commit6badbab93887d1230e3e76c11397a8633c1d3890
tree2ce2cd417fc432491536bb430e873d4e4d07724e
parentd36f94660152bf040db72128bd274caf813fdc4c
Diff style: patch stat
diff --git a/api/drugs.pl b/api/drugs.pl
index 616c1b8..a1fe70e 100644
--- a/api/drugs.pl
+++ b/api/drugs.pl
@@ -33,10 +33,7 @@ http_drug_mentions(Request) :-
 
 drug_mentions(Q, Method, Mentions) :-
 	findall(Count-M,
-		(   setof(R, ( drug_mention(Method, Q, Lit, Use),
-			       rdf(R, aers:drug, Use),
-			       drug_normalise(Lit, M)
-			     ),
+		(   setof(R, drug_mention(Method, Q, M, _, R),
 			  Rs),
 		    length(Rs, Count)
 		),
@@ -44,6 +41,10 @@ drug_mentions(Q, Method, Mentions) :-
 	keysort(Mentions0, Mentions1),
 	reverse(Mentions1, Mentions).
 
+drug_mention(Method, Q, Lit, DrugUse, Report) :-
+	drug_mention(Method, Q, Lit, DrugUse),
+	rdf(Report, aers:drug, DrugUse).
+
 drug_mention(exact, Q,  Lit, DrugUse) :-
 	!,
 	rdf(DrugUse, aers:drugname, literal(exact(Q), Lit)).