From 2c06b5672d95fa584ea8c268ce062bfbcd098edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20S=C3=B6dergren?= Date: Wed, 21 Dec 2016 11:08:43 +0100 Subject: [PATCH] Attempted to fix the code in the README. require('annoy-node') -> require('annoy') // I get 'Error: Cannot find module 'annoy-node'' obj2 -> annoyIndex2 // a guess of a mismatched variable name --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5f174b..5c1957d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Then: Usage ----- - var Annoy = require('annoy-node'); + var Annoy = require('annoy'); var annoyIndex1 = new Annoy(10, 'Angular'); annoyIndex1.addItem(0, [-5.0, -4.5, -3.2, -2.8, -2.1, -1.5, -0.34, 0, 3.7, 6]); @@ -70,10 +70,10 @@ Usage sum.push(v1[i] + v2[i]); } - var neighbors = obj2.getNNsByVector(sum, 10, -1, false); + var neighbors = annoyIndex2.getNNsByVector(sum, 10, -1, false); console.log('Nearest neighbors to sum', neighbors); - var neighborsAndDistances = obj2.getNNsByVector(sum, 10, -1, true); + var neighborsAndDistances = annoyIndex2.getNNsByVector(sum, 10, -1, true); console.log('Nearest neighbors to sum with distances', neighborsAndDistances); } }