X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fnormalize7bit.c;h=29ee8f18d1ab45f817c1d440bc7092378f43c5e0;hb=817e3ec506c4095bc4fcc1923cee36153ef4ee43;hp=6e1562abce1499656efe3e26c1b56173cc1d714a;hpb=49088b6680bed3c069be10ff0cb7cc16f3733729;p=pazpar2-moved-to-github.git diff --git a/src/normalize7bit.c b/src/normalize7bit.c index 6e1562a..29ee8f1 100644 --- a/src/normalize7bit.c +++ b/src/normalize7bit.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2008 Index Data + Copyright (C) Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -44,29 +44,9 @@ char * normalize7bit_generic(char * str, const char * rm_chars) return p; } - - -char * normalize7bit_mergekey(char *buf, int skiparticle) +char *normalize7bit_mergekey(char *buf) { char *p = buf, *pout = buf; - - if (skiparticle) - { - char firstword[64]; - char articles[] = "the den der die des an a "; // must end in space - - while (*p && !isalnum(*(unsigned char *)p)) - p++; - pout = firstword; - while (*p && *p != ' ' && pout - firstword < 62) - *(pout++) = tolower(*(unsigned char *)(p++)); - *(pout++) = ' '; - *(pout++) = '\0'; - if (!strstr(articles, firstword)) - p = buf; - pout = buf; - } - while (*p) { while (*p && !isalnum(*(unsigned char *)p)) @@ -83,7 +63,7 @@ char * normalize7bit_mergekey(char *buf, int skiparticle) *(pout--) = '\0'; } while (pout > buf && *pout == ' '); - + return buf; } @@ -124,7 +104,9 @@ int extract7bit_dates(const char *buf, int *first, int *last, int longdate) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +