-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client tests, client publish scripts
- Loading branch information
Showing
7 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 23 additions & 1 deletion
24
clients/java/client/src/main/java/org/relevanced/client/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
package org.relevanced.client; | ||
|
||
import java.lang.System; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Random; | ||
import org.apache.thrift.TException; | ||
|
||
public class Main { | ||
public static void main(String [] args) { | ||
System.out.println("start"); | ||
RelevancedBlockingClient client = new RelevancedBlockingClient("localhost", 8097); | ||
try { | ||
RelevancedBlockingClient client = new RelevancedBlockingClient("localhost", 8097); | ||
client.connect(); | ||
List<String> centroids = client.listAllCentroids(); | ||
System.out.println("number of centroids: " + centroids.size()); | ||
System.out.println(centroids); | ||
List<String> documents = client.listAllDocuments(); | ||
System.out.println("number of documents: " + documents.size()); | ||
int docIndex = new Random().nextInt(documents.size()); | ||
String docId = documents.get(docIndex); | ||
String centroidId = centroids.get(0); | ||
System.out.println("comparing " + docId + " against " + centroidId + "..."); | ||
double similarity = client.getDocumentSimilarity(centroidId, docId); | ||
System.out.println("result: " + similarity); | ||
|
||
} catch (TException err) { | ||
err.printStackTrace(); | ||
} | ||
System.out.println("end"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = '0.8.0a3' | ||
VERSION = '0.9.0rc1' |