+--- 1.2.3 2009/11/24
+
+Metadata attribute 'skiparticle' also works for ICU based
+normalization. (was only working for the non-ICU/ASCII before).
+
+Command bytarget with argument settings=1 will show settings per
+target.. This is to be able to verify correct settings and be able to
+test that they are correct. The database settings array size is now
+also stored.. Problems with database settings array is that if not
+careful it will be too small (smaller than dictionary per-service
+in settings).
+
+Make record list sorting stable by comparing mergekey for records if
+relevance/title or other sorting criteria all match. This is merely to
+ensure that our regressions tests works (reproducible output).
+
+Relevance calculation changes: use a different denominator (length) for
+per-field relevance scoring.. Instead of length of all ranked fields we
+now use length of individual fields (as if they were individual "free"
+text fields). This will ensure that documents with a long field with no
+match (say description) will not "hurt" a title match.
+
+Diagnostic member was not set on connection error. Fixed
+
--- 1.2.2 2009/10/13
Command search takes two optional parameters, startecs and maxrecs,
# Autoconf and automake setup
AC_PREREQ(2.60)
-AC_INIT([pazpar2],[1.2.2],[pazpar2-help@indexdata.dk])
+AC_INIT([pazpar2],[1.2.3],[pazpar2-help@indexdata.dk])
AC_CONFIG_HEADERS(src/config.h)
+pazpar2 (1.2.3-1indexdata) unstable; urgency=low
+
+ * Upstream.
+
+ -- Adam Dickmeiss <adam@indexdata.dk> Tue, 24 Nov 2009 12:22:52 +0100
+
pazpar2 (1.2.2-1indexdata) unstable; urgency=low
* Upstream.
#include <yaz/log.h>
#include <ctype.h>
#include <assert.h>
+#include <string.h>
#include "charsets.h"
#include "normalize7bit.h"
/* charset handle */
struct pp2_charset_s {
const char *(*token_next_handler)(pp2_relevance_token_t prt);
- const char *(*get_sort_handler)(pp2_relevance_token_t prt, int skip);
+ const char *(*get_sort_handler)(pp2_relevance_token_t prt);
int ref_count;
#if YAZ_HAVE_ICU
struct icu_chain * icu_chn;
};
static const char *pp2_relevance_token_a_to_z(pp2_relevance_token_t prt);
-static const char *pp2_get_sort_ascii(pp2_relevance_token_t prt, int skip_article);
+static const char *pp2_get_sort_ascii(pp2_relevance_token_t prt);
#if YAZ_HAVE_ICU
static const char *pp2_relevance_token_icu(pp2_relevance_token_t prt);
-static const char *pp2_get_sort_icu(pp2_relevance_token_t prt, int skip_article);
+static const char *pp2_get_sort_icu(pp2_relevance_token_t prt);
#endif
/* tokenzier handle */
}
pp2_relevance_token_t pp2_relevance_tokenize(pp2_charset_t pct,
- const char *buf)
+ const char *buf,
+ int skip_article)
{
pp2_relevance_token_t prt = xmalloc(sizeof(*prt));
assert(pct);
+ if (skip_article)
+ {
+ const char *p = buf;
+ char firstword[64];
+ char *pout = firstword;
+ char articles[] = "the den der die des an a "; // must end in space
+
+ while (*p && !isalnum(*(unsigned char *)p))
+ p++;
+ for (; *p && *p != ' ' && pout - firstword < (sizeof(firstword)-2); p++)
+ *pout++ = tolower(*(unsigned char *)p);
+ *pout++ = ' ';
+ *pout++ = '\0';
+ if (strstr(articles, firstword))
+ buf = p;
+ }
+
prt->norm_str = wrbuf_alloc();
prt->sort_str = wrbuf_alloc();
prt->cp = buf;
return (prt->pct->token_next_handler)(prt);
}
-const char *pp2_get_sort(pp2_relevance_token_t prt, int skip)
+const char *pp2_get_sort(pp2_relevance_token_t prt)
{
- return prt->pct->get_sort_handler(prt, skip);
+ return prt->pct->get_sort_handler(prt);
}
#define raw_char(c) (((c) >= 'a' && (c) <= 'z') ? (c) : -1)
return wrbuf_cstr(prt->norm_str);
}
-static const char *pp2_get_sort_ascii(pp2_relevance_token_t prt,
- int skip_article)
+static const char *pp2_get_sort_ascii(pp2_relevance_token_t prt)
{
if (prt->last_cp == 0)
return 0;
{
char *tmp = xstrdup(prt->last_cp);
char *result = 0;
- result = normalize7bit_mergekey(tmp, skip_article);
+ result = normalize7bit_mergekey(tmp);
wrbuf_rewind(prt->sort_str);
wrbuf_puts(prt->sort_str, result);
return 0;
}
-static const char *pp2_get_sort_icu(pp2_relevance_token_t prt,
- int skip_article)
+static const char *pp2_get_sort_icu(pp2_relevance_token_t prt)
{
return icu_chain_token_sortkey(prt->pct->icu_chn);
}
void pp2_charset_incref(pp2_charset_t pct);
pp2_relevance_token_t pp2_relevance_tokenize(pp2_charset_t pct,
- const char *buf);
+ const char *buf,
+ int skip_article);
void pp2_relevance_token_destroy(pp2_relevance_token_t prt);
const char *pp2_relevance_token_next(pp2_relevance_token_t prt);
-const char *pp2_get_sort(pp2_relevance_token_t prt, int skip_article);
+const char *pp2_get_sort(pp2_relevance_token_t prt);
#if 0
typedef int pp2_charset_normalize_t(pp2_charset_t pct,
pp2_relevance_token_t prt =
pp2_relevance_tokenize(
service->mergekey_pct,
- (const char *) value);
+ (const char *) value, 0);
wrbuf_puts(norm_wr, name);
wrbuf_puts(norm_wr, "=");
pp2_relevance_token_t prt =
pp2_relevance_tokenize(
service->mergekey_pct,
- (const char *) mergekey);
+ (const char *) mergekey, 0);
while ((norm_str = pp2_relevance_token_next(prt)))
{
prt = pp2_relevance_tokenize(
service->sort_pct,
- rec_md->data.text.disp);
+ rec_md->data.text.disp, skip_article);
pp2_relevance_token_next(prt);
- sort_str = pp2_get_sort(prt, skip_article);
+ sort_str = pp2_get_sort(prt);
cluster->sortkeys[sk_field_id]->text.disp =
rec_md->data.text.disp;
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))
#ifndef NORMALIZE7BIT_H
#define NORMALIZE7BIT_H
-char *normalize7bit_mergekey(char *buf, int skiparticle);
+char *normalize7bit_mergekey(char *buf);
char * normalize7bit_generic(char * str, const char * rm_chars);
int extract7bit_dates(const char *buf, int *first, int *last, int longdate);
for (; *p; p++)
{
- pp2_relevance_token_t prt = pp2_relevance_tokenize(pct, *p);
+ pp2_relevance_token_t prt = pp2_relevance_tokenize(pct, *p, 0);
const char *norm_str;
while ((norm_str = pp2_relevance_token_next(prt)))
void relevance_countwords(struct relevance *r, struct record_cluster *cluster,
const char *words, int multiplier, const char *name)
{
- pp2_relevance_token_t prt = pp2_relevance_tokenize(r->pct, words);
+ pp2_relevance_token_t prt = pp2_relevance_tokenize(r->pct, words, 0);
int *mult = cluster->term_frequency_vec_tmp;
const char *norm_str;
int i, length = 0;
</hit>
<hit>
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description tag="504">Includes bibliographical references and index</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+</hit>
+<hit>
+
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
</hit>
<hit>
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
-<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
-<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
-<md-test-usersetting-2>test-usersetting-2 data:
- YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title the computer bible author medium book</recid>
-</hit>
-<hit>
-
-<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
-<md-title-remainder>proceedings of the workshop</md-title-remainder>
-<md-date>1977</md-date>
-<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
-<md-title-remainder>proceedings of the workshop</md-title-remainder>
-<md-date>1977</md-date>
-<md-description tag="504">Includes bibliographical references and index</md-description>
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+<recid>title a plan for community college computer development author medium book</recid>
</hit>
<hit>
</hit>
<hit>
-<md-title>A plan for community college computer development</md-title>
-<md-date>1971</md-date>
-<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>A plan for community college computer development</md-title>
-<md-date>1971</md-date>
-<md-description tag="500">Cover title</md-description>
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
+<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title a plan for community college computer development author medium book</recid>
+<recid>title the computer bible author medium book</recid>
</hit>
</show>
<num>9</num>
<hit>
-<md-title>A plan for community college computer development</md-title>
-<md-date>1971</md-date>
-<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>A plan for community college computer development</md-title>
-<md-date>1971</md-date>
-<md-description tag="500">Cover title</md-description>
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
+<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title a plan for community college computer development author medium book</recid>
+<recid>title the computer bible author medium book</recid>
</hit>
<hit>
</hit>
<hit>
-<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
-<md-title-remainder>proceedings of the workshop</md-title-remainder>
-<md-date>1977</md-date>
-<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
-<md-title-remainder>proceedings of the workshop</md-title-remainder>
-<md-date>1977</md-date>
-<md-description tag="504">Includes bibliographical references and index</md-description>
-<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
-<md-test-usersetting-2>test-usersetting-2 data:
- YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
-</hit>
-<hit>
-
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
-<md-title>The Computer Bible</md-title>
-<md-date>1973-1980</md-date>
-<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
-<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<recid>title the computer bible author medium book</recid>
+<recid>title a plan for community college computer development author medium book</recid>
</hit>
<hit>
</hit>
<hit>
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description tag="504">Includes bibliographical references and index</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+</hit>
+<hit>
+
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
DEBUG=0 # 0 for release, 1 for debug
USE_MANIFEST = 0 # Can be enabled Visual Studio 2005/2008
PACKAGE_NAME=pazpar2
-PACKAGE_VERSION=1.2.2
+PACKAGE_VERSION=1.2.3
# YAZ
YAZ_DIR=..\..\yaz