Changeset 12915


Ignore:
Timestamp:
2006-09-28T16:58:10+12:00 (18 years ago)
Author:
kjdon
Message:

the compilation of the accent folding stuff (which needs unac package and iconv library) is now under the control of ENABLE_ACCENTFOLD, which gets defined in the CFLAGS if we want accent folding. turn it off in the mgpp/src/text/Makefile

Location:
trunk/gsdl/src/mgpp/text
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/Makefile.in

    r12888 r12915  
    2424PACKAGE = @PACKAGE@
    2525VERSION = @VERSION@
     26
     27ENABLE_ACCENTFOLD = 1
     28ifeq ($(ENABLE_ACCENTFOLD), 1)
     29AFLIBS = ../../../packages/unac/libunac.a
     30AFINCLUDES = -I../../../packages/unac
     31AFFLAGS = -DENABLE_ACCENTFOLD
     32else
     33AFLIBS =
     34AFINCLUDES =
     35AFFLAGS =
     36endif
    2637
    2738SHELL = /bin/sh
     
    3748CC = @CC@
    3849CXX = @CXX@
    39 CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
    40 CXXFLAGS = @CXXFLAGS@ -DSILENT -DSHORT_SUFFIX
     50CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX $(AFFLAGS)
     51CXXFLAGS = @CXXFLAGS@ -DSILENT -DSHORT_SUFFIX $(AFFLAGS)
    4152DEFS = @DEFS@
    4253RANLIB = @RANLIB@
     
    4556INSTALL_PROGRAM = @INSTALL_PROGRAM@
    4657LDFLAGS = @LDFLAGS@
    47 LIBS = ../lib/libmg.a ../../../packages/unac/libunac.a -lstdc++ @LIBS@
     58LIBS = ../lib/libmg.a  $(AFLIBS) -lstdc++ @LIBS@
    4859TOUCH = echo timestamp >
    4960AWK = @AWK@
     
    95106
    96107# want toplevel config.h, not local mg one
    97 INCLUDES = -I../../.. -I../lib -I. -I../../../packages/unac
     108INCLUDES = -I../../.. -I../lib -I. $(AFINCLUDES)
    98109
    99110#############################################################################
  • trunk/gsdl/src/mgpp/text/Queryer.cpp

    r12882 r12915  
    5050       << "\t.c0/.c1\t\tcasefolding off/on\n"
    5151       << "\t.s0/.s1\t\tstemming off/on\n"
     52#ifdef ENABLE_ACCENTFOLD
    5253       << "\t.a0/.a1\t\taccentfolding off/on\n"
     54#endif
    5355       << "\t.o0/.o1\t\tshort output off/on\n"
    5456       << "\t.m\t\tset maxnumeric (enter the number at the prompt)\n\n"
     
    221223    }
    222224      }     
     225#ifdef ENABLE_ACCENTFOLD
    223226      else if (queryArray[1] == 'a') { // accentfolding - on/off
    224227    if (queryArray[2] == '1') defaultStemMethod |= STEM_AccentFolding;
     
    228231    }
    229232      }
     233#endif
    230234      else if (queryArray[1] == 'o') { // output - short/long
    231235    if (queryArray[2] == '1') shortOutput = true;
  • trunk/gsdl/src/mgpp/text/mgpp_stem_idx.cpp

    r12885 r12915  
    216216    case '?':
    217217      fprintf (stderr, "usage: %s [-d directory] "
    218            "[-b entries-per-block] [-h] -s 1|2|3 "
    219            "[-a stemmer-method] -f name\n", argv[0]);
     218           "[-b entries-per-block] [-h] -s 1|2|3", argv[0]);
     219#ifdef ENABLE_ACCENTFOLD
     220      fprintf (stderr, "|4|5|6|7");
     221#endif
     222      fprintf (stderr, " [-a stemmer-method] -f name\n");
    220223      exit (1);
    221224    }
     
    225228  if (stemMethod < STEM_MIN || stemMethod > STEM_MAX)
    226229    FatalError (1, "Stem method must be between %d and %d", STEM_MIN, STEM_MAX);
    227 
     230#ifndef ENABLE_ACCENTFOLD
     231  if (stemMethod & STEM_AccentFolding) {
     232    // accent folding not enabled
     233    return -1;
     234  }
     235#endif
    228236  // read in the dictionary and create the in memory dictionary
    229237  StemMapDict stemDict;
  • trunk/gsdl/src/mgpp/text/stemmer.cpp

    r12879 r12915  
    2727#include "unitool.h"
    2828
     29#ifdef ENABLE_ACCENTFOLD
    2930/* [JFG - Mar 06: Accent folding patch] */
    3031#include "unac.h"
     32#endif
    3133
    3234#define LOVINSTEMMER        0
     
    5557}
    5658
     59#ifdef ENABLE_ACCENTFOLD
    5760/* [JFG - Mar 06: Accent folding patch] */
    5861/* =========================================================================
     
    7578  return;
    7679}
    77 
     80#endif
    7881     
    7982int mgpp_stemmernumber (u_char *stemmerdescription) {
     
    123126  }
    124127
     128#ifdef ENABLE_ACCENTFOLD
    125129  if (method & STEM_AccentFolding) {
    126130    mgpp_unicode_accentfold (word);
    127131  }
     132#endif
    128133
    129134  if (method & STEM_Stemming) {
Note: See TracChangeset for help on using the changeset viewer.