From 6cb93fe44be70d87286dc68385efdf9563e1849f Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Fri, 26 Jun 1998 11:16:35 +0000 Subject: [PATCH] Added support (un-optimised) for left and left/right truncation --- CHANGELOG | 2 ++ index/zrpn.c | 23 +++++++++++++++++++++-- test/gils/test.sh | 5 +++++ test/gils/zebra.cfg | 4 +++- test/usmarc/test.sh | 3 +++ 5 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 test/gils/test.sh create mode 100755 test/usmarc/test.sh diff --git a/CHANGELOG b/CHANGELOG index c783420..03c7a5a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +Added un-optimised support for left and left/right truncation attributes. + Added support for relational operators on text when using RPN queries. diff --git a/index/zrpn.c b/index/zrpn.c index 5a1b42a..c5da516 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.81 1998-06-24 12:16:14 adam + * Revision 1.82 1998-06-26 11:16:40 quinn + * Added support (un-optimised) for left and left/right truncation + * + * Revision 1.81 1998/06/24 12:16:14 adam * Support for relations on text operands. Open range support in * DFA module (i.e. [-j], [g-]). * @@ -1006,8 +1009,24 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, dict_lookup_grep (zh->dict, term_dict, 0, grep_info, &max_pos, 0, grep_handle); break; - case 2: /* left truncation */ + case 2: /* keft truncation */ + term_dict[j++] = '('; term_dict[j++] = '.'; term_dict[j++] = '*'; + if (!term_100 (zh->zebra_maps, reg_type, + &termp, term_dict + j, space_split, term_dst)) + return 0; + strcat (term_dict, ")"); + dict_lookup_grep (zh->dict, term_dict, 0, grep_info, + &max_pos, 0, grep_handle); + break; case 3: /* left&right truncation */ + term_dict[j++] = '('; term_dict[j++] = '.'; term_dict[j++] = '*'; + if (!term_100 (zh->zebra_maps, reg_type, + &termp, term_dict + j, space_split, term_dst)) + return 0; + strcat (term_dict, ".*)"); + dict_lookup_grep (zh->dict, term_dict, 0, grep_info, + &max_pos, 0, grep_handle); + break; zh->errCode = 120; return -1; case 101: /* process # in term */ diff --git a/test/gils/test.sh b/test/gils/test.sh new file mode 100755 index 0000000..8f0292b --- /dev/null +++ b/test/gils/test.sh @@ -0,0 +1,5 @@ +: +echo Loading Records +../../index/zebraidx update records +echo Starting Server +../../index/zebrasrv diff --git a/test/gils/zebra.cfg b/test/gils/zebra.cfg index 5c6ace5..8b4f7f6 100644 --- a/test/gils/zebra.cfg +++ b/test/gils/zebra.cfg @@ -1,9 +1,11 @@ # Simple Zebra configuration file -# $Id: zebra.cfg,v 1.2 1998-05-20 10:12:28 adam Exp $ +# $Id: zebra.cfg,v 1.3 1998-06-26 11:16:42 quinn Exp $ # # Where are the YAZ / Zebra tables located? profilePath: .:../../tab:../../../yaz/tab +recordType: grs.regx.sgml + # Files that describe the attribute sets supported. attset: bib1.att attset: gils.att diff --git a/test/usmarc/test.sh b/test/usmarc/test.sh new file mode 100755 index 0000000..4795a88 --- /dev/null +++ b/test/usmarc/test.sh @@ -0,0 +1,3 @@ +: +../../index/zebraidx update records +../../index/zebrasrv -- 1.7.10.4