Here is a simple Java program that uses ThoughtTreasure:
/* Tell Java to use the ThoughtTreasure Java-based client API. */ import com.signiform.tt.*; public class Example { public static void main(String args[]) { try { /* Create a connection to the ThoughtTreasure server running * on the machine "somehost" and listening on the TTSP * port number 1832. */ TTConnection tt = new TTConnection("somehost"); /* Ask ThoughtTreasure whether Evian is a beverage and print * the response. */ System.out.println(tt.ISA("beverage", "Evian")); /* Close the connection. */ tt.close(); } catch (Exception e) { } } }
See also the longer example program and the article on adding common sense to applications using the API.
The Java-based client API is provided in the java directory of the ThoughtTreasure distribution.