X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fyaz-icu.c;h=ac7806a33d1d5e96298c751e553810e1c8ef2115;hp=369982a95d4775c1b1b52f6799f998df3c00d810;hb=30af0a1ebbea75c3e757eb03d3f988c61fce8511;hpb=ffb913afb48e3a0cb3539827daafed79562ab0b7 diff --git a/util/yaz-icu.c b/util/yaz-icu.c index 369982a..ac7806a 100644 --- a/util/yaz-icu.c +++ b/util/yaz-icu.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -26,6 +26,7 @@ #include #include +#include /* commando line and config parameters */ struct config_t { @@ -478,9 +479,11 @@ static void process_text_file(struct config_t *p_config) else { size_t start, len; + const char *org_string = 0; 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++; @@ -524,6 +527,12 @@ static void process_text_file(struct config_t *p_config) { 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"); } @@ -552,6 +561,7 @@ int main(int argc, char **argv) #if YAZ_HAVE_ICU struct config_t config; + yaz_enable_panic_backtrace(*argv); read_params(argc, argv, &config); if (config.conffile && strlen(config.conffile))