예제 #1
0
  protected Vector /* of TTPNode */ queryPNodes1(String query) throws IOException {
    write(query);
    Vector lines = readlines();
    Vector r = new Vector();
    for (Enumeration e = lines.elements(); e.hasMoreElements(); ) {
      Vector line = stringToVector((String) e.nextElement(), ":");

      TTLexEntry le = new TTLexEntry();
      le.citationForm = (String) line.elementAt(0);
      le.features = (String) line.elementAt(1);
      le.inflection = (String) line.elementAt(2);
      le.inflFeatures = (String) line.elementAt(3);

      TTLexEntryToObj leo = new TTLexEntryToObj();
      leo.lexentry = le;
      leo.objname = (String) line.elementAt(4);
      leo.features = (String) line.elementAt(5);

      TTPNode pn = new TTPNode();
      pn.feature = TT.featureGet(le.features, TT.FT_POS, TT.F_NULL);
      pn.leo = leo;
      pn.startpos = TT.longParse((String) line.elementAt(8), true);
      pn.endpos = TT.longParse((String) line.elementAt(9), true);

      r.addElement(pn);
    }
    return r;
  }
예제 #2
0
 protected Vector /* of Object */ queryAssertionLines1(String query) throws IOException {
   write(query);
   Vector v = readlines();
   Vector r = new Vector();
   for (Enumeration e = v.elements(); e.hasMoreElements(); ) {
     r.addElement(TT.stringToObject((String) e.nextElement()));
   }
   return r;
 }
예제 #3
0
 /**
  * Generates the specified ThoughtTreasure assertion in natural language.
  *
  * @param feat a String containing single-character ThoughtTreasure features such as <code>
  *     F_ENGLISH</code> or <code>F_FRENCH</code>. The feature codes are defined in the <code>TT
  *     </code> class.
  * @param obj Java Object representing a ThoughtTreasure assertion
  * @exception IOException if an I/O error occurs communicating with the server
  * @see TT
  */
 public String generate(String feat, Object obj) throws IOException {
   return queryString("Generate " + feat.trim() + " " + TT.objectToString(obj) + "\n");
 }