X-Delivery-Notice:  SMTP MAIL FROM does not correspond to sender.
Newsgroups: bit.listserv.notis-l
Date:         Fri, 4 Sep 1992 13:13:00 EDT
From:         Ron Johnston <ADLB001@MVS.MCGILL.CA>
Subject:      apostrophe in keyword
Comments: To: Notis Discussion <NOTIS-L@VM.TCS.TULANE.EDU>

Indeed, Bob, the change I suggested yesterday did prevent searching for
   k='near' adj east
whilst permitting the search for
   k=o'brien
to work identically to the search for
   k=obrien

The attached patch to LPC100P allows both 'quoted strings' and embedded
apostrophe's to work correctly.  Thus we now see all three of the above searches
giving the desired results in our test 5.0.2 OPAC.

We also find that
   k=1960's
is locating bib records containing either 1960s or 1960's which is encouraging.

This change is unlikely to be perfect.  In particular, there are four
punctuation marks defined in EBCDIC among the letters and numbers.  However
LPC100P has already changed three of the four to the space character, leaving
only the tilde (hex A1).  So this patch treats the tilde as alphanumeric which
is unlikely to cause trouble.

The usual caveats about NSI not supporting locally modified modules apply of
course.  No promises, but the adventurous may wish to apply this mod to their
5.0.2 opac.  The first line marked RJ is a change to a branch.  The rest of the
lines form an insertion.

Ron Johnston  McGill University Libraries  Montreal Quebec

voice:        (514) 398-4797          |    S/390  ES/9000-320
fax:          (514) 398-7356          |    MVS/XA  CICS 1.7
internet:     ADLB001@MVS.MCGILL.CA   |    NOTIS 4.6.1
bitnet:       ADLB001@MCGILLVS        |    GTO 2-Utlas
telnet:       132.206.27.5            |    GTO 3-Bibliofile
===============================//=========================================
         B     SRQF32               0C -- PROCESS :            VC0@R502
*                                   10 -- PROCESS QUOTE        VC0@R502
*        SHIFT DATA OVER FOR QUOTES
*
         CLI   OPACFNDT,OPACFKEY   IS THIS A KEYWORD SEARCH?
         BNE   SRQF04                NO, GO SQUEEZE OUT              RJ
*                                                                    RJ
*        ATTEMPT TO SQUEEZE OUT AN APOSTROPHE BUT NOT A SINGLE       RJ
*        QUOTE IN A KEYWORD SEARCH.  THE APOSTROPHE IS DEFINED AS    RJ
*        (A) NOT BEING IN EITHER FIRST OR LAST POSITION AND          RJ
*        (B) BEING PRECEDED AND FOLLOWED BY AN ALPHANUMERIC.         RJ
*                                                                    RJ
         CLM   R1,X'F',OPACSRQ     FIRST POSITION ?                  RJ
         BE    SRQF40                YES, LEAVE ALONE                RJ
         CLM   R1,X'F',DSSRQEND    LAST POSITION ?                   RJ
         BE    SRQF40                YES, LEAVE ALONE                RJ
         CLI   1(R1),X'81'         ALPHANUMERIC FOLLOWING ?          RJ
         BL    SRQF40                NO, LEAVE ALONE                 RJ
         S     R1,=F'1'            POINT TO PRECEDING                RJ
         CLI   0(R1),X'81'         ALPHANUMERIC PRECEDING ?          RJ
         BNL   SRQF02                YES, GO SQUEEZE IT OUT          RJ
         A     R1,=F'1'            POINT BACK TO QUOTE               RJ
         B     SRQF40              LEAVE ALONE                       RJ
SRQF02   EQU   *                   APOSTROPHE FOUND IN KEYWORD       RJ
         A     R1,=F'1'            POINT BACK TO QUOTE               RJ
SRQF04   EQU   *                   SQUEEZE OUT THIS QUOTE            RJ
         L     R15,DSSRQEND        END OF SEARCH QUERY ADDRESS
         BCTR  R15,R0              DECREMENT BY ONE
         ST    R15,DSSRQEND        STORE NEW END ADDRESS