From: Mike Taylor Date: Wed, 19 May 2010 23:37:46 +0000 (+0100) Subject: isRelation() recognises word-form relations from context sets. X-Git-Tag: v1.5~15 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=4d0ef95b01450f0462d1b2bffccbc3cefb5c2996;p=cql-java-moved-to-github.git isRelation() recognises word-form relations from context sets. parseTerm() accumulates multi-word query terms. --- diff --git a/src/main/java/org/z3950/zing/cql/CQLParser.java b/src/main/java/org/z3950/zing/cql/CQLParser.java index dab0e80..25b49d0 100644 --- a/src/main/java/org/z3950/zing/cql/CQLParser.java +++ b/src/main/java/org/z3950/zing/cql/CQLParser.java @@ -192,7 +192,12 @@ public class CQLParser { debug("non-parenthesised term"); word = matchSymbol("index or term"); - if (!isSymbolicRelation() && lexer.ttype != lexer.TT_WORD) + while (lexer.ttype == lexer.TT_WORD && !isRelation()) { + word = word + " " + lexer.sval; + match(lexer.TT_WORD); + } + + if (!isRelation()) break; index = word; @@ -235,10 +240,11 @@ public class CQLParser { debug("isRelation: checking ttype=" + lexer.ttype + " (" + lexer.render() + ")"); if (lexer.ttype == lexer.TT_WORD && - (lexer.sval == "exact" || - lexer.sval == "any" || - lexer.sval == "all" || - (lexer.sval == "scr" && compat == V1POINT2))) + (lexer.sval.indexOf('.') >= 0 || + lexer.sval.equals("exact") || + lexer.sval.equals("any") || + lexer.sval.equals("all") || + (lexer.sval.equals("scr") && compat == V1POINT2))) return true; return isSymbolicRelation();