public static void main(String[] args) {
    String domain = "/home/gv/fsa/automata/us_main_20041002_20041008";

    ConceptNet cn = new ConceptNet(domain);

    System.out.println("Loading ConceptNet domain "+domain+": "+cn.isOk());
    int idx = cn.lookup("new york");
    System.out.println("  lookup(\"new york\") -> "+idx);
    System.out.println("  lookup("+idx+")     -> "+cn.lookup(idx)+"("+cn.score(idx)+","+cn.strength(idx)+")");
    System.out.println("    extensions("+cn.numExt(idx)+"):");
    for(int i=0;i<5 && i<cn.numExt(idx);i++){
      System.out.println("      "+cn.lookup(cn.ext(idx,i))+","+cn.extFrq(idx,i));
    }
    if(5<cn.numExt(idx)){
      System.out.println("      ...");
    }
    System.out.println("    associations("+cn.numAssoc(idx)+"):");
    for(int i=0;i<5 && i<cn.numAssoc(idx);i++){
      System.out.println("      "+cn.lookup(cn.assoc(idx,i))+","+cn.assocFrq(idx,i));
    }
    if(5<cn.numAssoc(idx)){
      System.out.println("      ...");
    }
    System.out.println("    categories("+cn.numCat(idx)+"):");
    for(int i=0;i<5 && i<cn.numCat(idx);i++){
      System.out.println("      "+cn.catName(cn.cat(idx,i)));
    }
    if(5<cn.numCat(idx)){
      System.out.println("      ...");
    }
  }
Class for accessing the concept network automata.

@author  <a href="mailto:boros@yahoo-inc.com">Peter Boros</a>
fsa/src/main/java/com/yahoo/fsa/conceptnet/ConceptNet.java