X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Ffulltext%2Fft_wordbreaker.c;h=968fa9f02b0aa2bf21ddf87890a0e19887d8a56a;hb=8e944083763c9ddcb32d763cf8f19c966d01f873;hp=44f40a45c58915a2b1748f696c0585b57b949f17;hpb=6106c1da54f0923550c7bdceb45246fb88e9ea19;p=citadel.git diff --git a/citadel/modules/fulltext/ft_wordbreaker.c b/citadel/modules/fulltext/ft_wordbreaker.c index 44f40a45c..968fa9f02 100644 --- a/citadel/modules/fulltext/ft_wordbreaker.c +++ b/citadel/modules/fulltext/ft_wordbreaker.c @@ -1,24 +1,17 @@ /* * Default wordbreaker module for full text indexing. * - * Copyright (c) 2005-2009 by the citadel.org team + * Copyright (c) 2005-2017 by the citadel.org team * - * This program 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 Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ - #include "sysdep.h" #include #include @@ -154,26 +147,6 @@ void initialize_noise_words(void) } -void noise_word_cleanup(void) -{ - int i; - noise_word *cur, *next; - - CtdlLogPrintf(CTDL_INFO, "Cleaning up fulltext noise words.\n"); - - for (i = 0 ; i < 26 ; i++) - { - cur = noise_words[i]; - while (cur) - { - next = cur->next; - free(cur->word); - free(cur); - cur = next; - } - } -} - /* * Compare function */ @@ -231,12 +204,11 @@ void wordbreaker(const char *text, int *num_tokens, int **tokens) { ch = *ptr; if ( (!isalnum(ch)) && (word_start) ) { word_end = ptr; -// --word_end; /* extract the word */ word_len = word_end - word_start; if (word_len >= sizeof word) { - CtdlLogPrintf(CTDL_DEBUG, "Invalid word length: %d\n", word_len); + syslog(LOG_DEBUG, "wordbreaker: invalid word length: %d", word_len); safestrncpy(word, word_start, sizeof word); word[(sizeof word) - 1] = 0; }