From: Adam Dickmeiss Date: Thu, 22 Mar 2001 21:23:30 +0000 (+0000) Subject: Directive s=pw sets structure to phrase if term includes blank(s). X-Git-Tag: YAZ.1.8~105 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=59526fbbf2e3b54ce94b3e79e6c7fef9e4f456fb Directive s=pw sets structure to phrase if term includes blank(s). --- diff --git a/ccl/bib1 b/ccl/bib1 index 7c101c7..0e9459c 100644 --- a/ccl/bib1 +++ b/ccl/bib1 @@ -1,4 +1,4 @@ -# $Id: bib1,v 1.7 2001-03-20 11:22:58 adam Exp $ +# $Id: bib1,v 1.8 2001-03-22 21:23:30 adam Exp $ # CCL qualifiers and their mappings # # Each line takes the form: @@ -27,7 +27,7 @@ # n Set truncation explicitly to "none" if no ? is given. # This rule is for CCL tokens where no fields are specified -term s=pw t=l,r s=al +term u=1016 t=l,r s=pw,al # Common short-hand access points. au u=1 s=pw t=l,r # author ti u=4 s=pw t=l,r # title diff --git a/ccl/cclfind.c b/ccl/cclfind.c index 5702322..59a9065 100644 --- a/ccl/cclfind.c +++ b/ccl/cclfind.c @@ -45,7 +45,10 @@ * Europagate, 1995 * * $Log: cclfind.c,v $ - * Revision 1.23 2001-03-20 11:22:58 adam + * Revision 1.24 2001-03-22 21:23:30 adam + * Directive s=pw sets structure to phrase if term includes blank(s). + * + * Revision 1.23 2001/03/20 11:22:58 adam * CCL Truncation character may be defined. * * Revision 1.22 2001/03/07 13:24:40 adam @@ -361,6 +364,7 @@ static struct ccl_rpn_node *search_term_x (CCL_parser cclp, { struct ccl_rpn_node *p; size_t no, i; + int no_spaces = 0; int left_trunc = 0; int right_trunc = 0; int mid_trunc = 0; @@ -380,8 +384,9 @@ static struct ccl_rpn_node *search_term_x (CCL_parser cclp, for (no = 0; no < max && is_term_ok(lookahead->kind, term_list); no++) { for (i = 0; ilen; i++) - if (truncation_value == -1 && strchr(truncation_aliases, - lookahead->name[i])) + if (lookahead->name[i] == ' ') + no_spaces++; + else if (strchr(truncation_aliases, lookahead->name[i])) { if (no == 0 && i == 0 && lookahead->len >= 1) left_trunc = 1; @@ -469,7 +474,7 @@ static struct ccl_rpn_node *search_term_x (CCL_parser cclp, qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset)) { /* no structure attribute met. Apply either structure attribute WORD or PHRASE depending on number of CCL tokens */ - if (no == 1) + if (no == 1 && no_spaces == 0) add_attr (p, attset, CCL_BIB1_STR, 2); else add_attr (p, attset, CCL_BIB1_STR, 1);