-$Id: README,v 1.5 2002-10-30 09:19:26 mike Exp $
+$Id: README,v 1.6 2002-10-30 11:13:18 mike Exp $
cql-java -- a free CQL compiler for Java
and running that through JZKit's existing PQN-to-Type-1 compiler.
* Refinements to random query generator:
- * Fix to handle new, structured, relation representation
* Generate relation modifiers
* Proximity support
+ * Don't always generate qualifier/relation for terms
* Better selection of qualifier (configurable?)
* Better selection of terms (from a dictionary file?)
* Introduce wildcard characters into generated terms
-// $Id: CQLGenerator.java,v 1.1 2002-10-30 09:19:26 mike Exp $
+// $Id: CQLGenerator.java,v 1.2 2002-10-30 11:13:18 mike Exp $
package org.z3950.zing.cql;
import java.util.Properties;
* this distribution - there is a <TT>generate_<I>x</I>()</TT> method
* for each grammar element <I>X</I>.
*
- * @version $Id: CQLGenerator.java,v 1.1 2002-10-30 09:19:26 mike Exp $
+ * @version $Id: CQLGenerator.java,v 1.2 2002-10-30 11:13:18 mike Exp $
* @see <A href="http://zing.z3950.org/cql/index.html"
* >http://zing.z3950.org/cql/index.html</A>
*/
return generate_cql_query();
}
+ // ### Should sometimes generate qualifier/relation-free terms
String qualifier = generate_qualifier();
- String relation = generate_relation();
+ CQLRelation relation = generate_relation();
String term = generate_term();
return new CQLTermNode(qualifier, relation, term);
return qualifier;
}
- // ### Representation of relations will change when we handle modifiers
- private String generate_relation() throws ParameterMissingException {
- return generate_base_relation();
+ private CQLRelation generate_relation() throws ParameterMissingException {
+ String base = generate_base_relation();
+ CQLRelation rel = new CQLRelation(base);
// ### should generate modifiers too
+ return rel;
}
private String generate_base_relation() throws ParameterMissingException {
-// $Id: CQLNode.java,v 1.7 2002-10-30 09:19:26 mike Exp $
+// $Id: CQLNode.java,v 1.8 2002-10-30 11:13:18 mike Exp $
package org.z3950.zing.cql;
* Represents a node in a CQL parse-tree.
* ###
*
- * @version $Id: CQLNode.java,v 1.7 2002-10-30 09:19:26 mike Exp $
+ * @version $Id: CQLNode.java,v 1.8 2002-10-30 11:13:18 mike Exp $
*/
public abstract class CQLNode {
abstract String toXCQL(int level);
// Test harness
public static void main (String[] args) {
- CQLNode n1 = new CQLTermNode("dc.author", "=", "kernighan");
- CQLNode n2 = new CQLTermNode("dc.title", "all", "elements style");
+ CQLNode n1 = new CQLTermNode("dc.author",
+ new CQLRelation("="),
+ "kernighan");
+ CQLNode n2 = new CQLTermNode("dc.title",
+ new CQLRelation("all"),
+ "elements style");
CQLNode root = new CQLAndNode(n1, n2);
System.out.println(root.toXCQL(0));
}