Skip to content
Snippets Groups Projects
Commit 1aba4d75 authored by IsolatedSushi's avatar IsolatedSushi
Browse files

Fixed chunked knn

parent e7eb657e
No related branches found
No related tags found
1 merge request!13Major update
...@@ -241,6 +241,20 @@ function sendRowToServer(allRows, lineIndex, connection) { ...@@ -241,6 +241,20 @@ function sendRowToServer(allRows, lineIndex, connection) {
connection.knnConn.calls[0].write(trainingChunk); connection.knnConn.calls[0].write(trainingChunk);
} }
function sendNeighbour(response,ws){
console.log(response);
if(!response || response["rows"].length == 0){
const errMSG = "The word (or one of the words) was not in the set (or hasnt been received yet)";
console.log(errMSG);
sendError(ws,errMSG)
return;
}
for(var i = 0; i < response["rows"].length; i++){
console.log(response["rows"][i]["id"] + " " + response["rows"][i]["distance"]);
ws.send(JSON.stringify({type: "neighbour", neighbour: response["rows"][i]["id"],distance: response["rows"][i]["distance"].toString()}));
}
}
//Send client to browser //Send client to browser
function sendDataStreamToClient(data, ws) { function sendDataStreamToClient(data, ws) {
var rows = data["points"] var rows = data["points"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment