Ignore:
Timestamp:
1998-11-25T20:55:52+13:00 (26 years ago)
Author:
rjmcnab
Message:

Modified mg to that you can specify the stemmer you want
to use via a command line option. You specify it to
mg_passes during the build process. The number of the
stemmer that you used is stored within the inverted
dictionary header and the stemmed dictionary header so
the correct stemmer is used in later stages of building
and querying.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/packages/mg-1.3d/src/text/mg_hilite_words.c

    r29 r34  
    104104static short hilite_style = BOLD;
    105105static char *pager = "less";
     106static int stemmer_num = 0; /* Lovin's stemmer */
    106107static int stem_method = 3; /* fold & stem */
    107108static char **word_list;
     
    458459      PARSE_STEM_WORD (word, s_in, end);
    459460
    460       stemmer (stem_method, word);
     461      stemmer (stem_method, stemmer_num, word);
    461462
    462463      if (set_member (word))    /* output with highlighting */
     
    567568  {"pager", required_argument, 0, 'p'},
    568569  {"stem_method", required_argument, 0, 'm'},
     570  {"stemmer", required_argument, 0, 'a'},
    569571  {0, 0, 0, 0}
    570572};
     
    577579
    578580  opterr = 0;
    579   while ((ch = getopt_long (argc, argv, "s:p:t:m:", long_opts, (int *) 0)) != -1)
     581  while ((ch = getopt_long (argc, argv, "s:p:t:m:a:", long_opts, (int *) 0)) != -1)
    580582    {
    581583      switch (ch)
     
    591593          hilite_style = i;
    592594      }
     595      break;
     596    case 'a':
     597      stemmer_num = stemmernumber (optarg);
    593598      break;
    594599    case 't':
     
    604609      FatalError (1, "Usage: \n"
    605610              "mg_hilite_words --stem_method [0-3]\n"
     611      "                --stemmer [english|lovin|french|simplefrench]\n"
    606612      "                --style [bold|underline|italic|emphasis|strong]\n"
    607613              "                --pager [less|more|html|???]\n");
Note: See TracChangeset for help on using the changeset viewer.