From: Alexandre Terrasa Date: Thu, 12 Oct 2017 00:48:27 +0000 (-0400) Subject: lib/vsm: actually use tf.idf when matching documents X-Git-Url: http://nitlanguage.org lib/vsm: actually use tf.idf when matching documents Signed-off-by: Alexandre Terrasa --- diff --git a/lib/vsm/vsm.nit b/lib/vsm/vsm.nit index 8eaeca8..4a64f99 100644 --- a/lib/vsm/vsm.nit +++ b/lib/vsm/vsm.nit @@ -208,7 +208,8 @@ class StringIndex # See `match_vector`. fun match_string(query: String): Array[IndexMatch] do var vector = parse_string(query) - return match_vector(vector) + var doc = new Document("", "", vector) + return match_vector(doc.terms_frequency) end # Parse the `string` as a Vector