projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
35c32d0
)
yaz-icu option -o writes original string as well
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 31 Mar 2015 12:58:29 +0000
(14:58 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 31 Mar 2015 12:58:29 +0000
(14:58 +0200)
This changes the output and so test results must be updated. yaz-icu
now uses new facilities of YAZ-836.
test/test_icu.0.output
patch
|
blob
|
history
test/test_icu.1.output
patch
|
blob
|
history
test/test_icu.2.output
patch
|
blob
|
history
test/test_icu.3.output
patch
|
blob
|
history
test/test_icu.4.output
patch
|
blob
|
history
util/yaz-icu.c
patch
|
blob
|
history
diff --git
a/test/test_icu.0.output
b/test/test_icu.0.output
index
ba0c37c
..
c34bcb1
100644
(file)
--- a/
test/test_icu.0.output
+++ b/
test/test_icu.0.output
@@
-1,7
+1,7
@@
-1 1 'børn' 'Børn' 0+5
-2 2 'le' 'Le' 0+3
-3 2 'carré' 'Carré' 3+6
-4 3 'le' 'Le' 0+3
-5 3 'carre' 'Carre' 3+5
-6 4 'le' 'Le' 0+3
-7 4 'carré' 'Carré' 3+7
+1 1 'børn' 'Børn' 0+5 *Børn*
+2 2 'le' 'Le' 0+3 *Le *Carré
+3 2 'carré' 'Carré' 3+6 Le *Carré*
+4 3 'le' 'Le' 0+3 *Le *Carre
+5 3 'carre' 'Carre' 3+5 Le *Carre*
+6 4 'le' 'Le' 0+3 *Le *Carré
+7 4 'carré' 'Carré' 3+7 Le *Carré*
diff --git
a/test/test_icu.1.output
b/test/test_icu.1.output
index
ba8e613
..
8a0b32c
100644
(file)
--- a/
test/test_icu.1.output
+++ b/
test/test_icu.1.output
@@
-1,7
+1,7
@@
-1 1 'børn' 'Børn' 0+5
-2 2 'le' 'Le' 0+3
-3 2 'carre' 'Carre' 3+6
-4 3 'le' 'Le' 0+3
-5 3 'carre' 'Carre' 3+5
-6 4 'le' 'Le' 0+3
-7 4 'carre' 'Carre' 3+7
+1 1 'børn' 'Børn' 0+5 *Børn*
+2 2 'le' 'Le' 0+3 *Le *Carré
+3 2 'carre' 'Carre' 3+6 Le *Carré*
+4 3 'le' 'Le' 0+3 *Le *Carre
+5 3 'carre' 'Carre' 3+5 Le *Carre*
+6 4 'le' 'Le' 0+3 *Le *Carré
+7 4 'carre' 'Carre' 3+7 Le *Carré*
diff --git
a/test/test_icu.2.output
b/test/test_icu.2.output
index
d8bf7c6
..
fdff316
100644
(file)
--- a/
test/test_icu.2.output
+++ b/
test/test_icu.2.output
@@
-1,4
+1,6
@@
1 1 '‘a'
1 1 '‘a'
-' '' 0+4
+' '' 0+4 *`a'
+*
2 2 '“a''
2 2 '“a''
-' '' 0+6
+' '' 0+6 *``a''
+*
diff --git
a/test/test_icu.3.output
b/test/test_icu.3.output
index
3fe68cc
..
b85056b
100644
(file)
--- a/
test/test_icu.3.output
+++ b/
test/test_icu.3.output
@@
-1,4
+1,4
@@
-1 1 'men' '' 0+4
-2 1 'run' '' 4+7
-3 2 'he' '' 0+3
-4 2 'run' '' 3+5
+1 1 'men' '' 0+4 *men *running
+2 1 'run' '' 4+7 men *running*
+3 2 'he' '' 0+3 *he *runs
+4 2 'run' '' 3+5 he *runs *
diff --git
a/test/test_icu.4.output
b/test/test_icu.4.output
index
5bbdaed
..
01dd145
100644
(file)
--- a/
test/test_icu.4.output
+++ b/
test/test_icu.4.output
@@
-1
+1
@@
-1 1 'Andersen, H.C' '' 0+15
+1 1 'Andersen, H.C' '' 0+15 *Andersen, H.C.,*
diff --git
a/util/yaz-icu.c
b/util/yaz-icu.c
index
1386a16
..
ac7806a
100644
(file)
--- a/
util/yaz-icu.c
+++ b/
util/yaz-icu.c
@@
-479,9
+479,11
@@
static void process_text_file(struct config_t *p_config)
else
{
size_t start, len;
else
{
size_t start, len;
+ const char *org_string = 0;
const char *sortkey = icu_chain_token_sortkey(p_config->chain);
const char *sortkey = icu_chain_token_sortkey(p_config->chain);
- icu_chain_get_org_info(p_config->chain, &start, &len);
+ icu_chain_get_org_info2(p_config->chain, &start, &len,
+ &org_string);
wrbuf_rewind(sw);
wrbuf_puts_escaped(sw, sortkey);
token_count++;
wrbuf_rewind(sw);
wrbuf_puts_escaped(sw, sortkey);
token_count++;
@@
-525,6
+527,12
@@
static void process_text_file(struct config_t *p_config)
{
fprintf(p_config->outfile, " %ld+%ld",
(long) start, (long) len);
{
fprintf(p_config->outfile, " %ld+%ld",
(long) start, (long) len);
+ fputc(' ', p_config->outfile);
+ fwrite(org_string, 1, start, p_config->outfile);
+ fputc('*', p_config->outfile);
+ fwrite(org_string + start, 1, len, p_config->outfile);
+ fputc('*', p_config->outfile);
+ fputs(org_string + start + len, p_config->outfile);
}
fprintf(p_config->outfile, "\n");
}
}
fprintf(p_config->outfile, "\n");
}