Closed (works as designed)
Project:
Porter Algorithm Search Stemmer
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2009 at 11:31 UTC
Updated:
25 Aug 2009 at 15:06 UTC
Comments
Comment #1
gpk commentedThis should probably filed against 2.0 but I've not got round to trying it out yet... From what I can see from the details of the 2.0 algorithm, days of week and month names are not treated in a special way as I'm suggesting.
Comment #2
jhodgdonThe Porter Stemmer module implements the Porter Stemmer algorithm, which does not stem weeks and months (or anything else) to abbreviations.
A person could definitely write a search preprocessing module that would expand abbreviations in the search index, or "stem" things like weeks and months to abbreviations, but that is beyond the scope of the Porter Stemmer algorithm.
Comment #3
gpk commentedThanks, would such a "search preprocessing module" (presumably Porter Stemmer is one such) be able to sit alongside/play nicely with Porter Stemmer itself, i.e. can you have multiple search preprocessing modules?
Comment #4
jhodgdonIt should work fine next to Porter Stemmer, since Porter Stemmer doesn't do anything with abbreviations or days/months.
And yes, Porter Stemmer is a search preprocessing module, in that its only function in Drupal is to pre-process text/keywords for Drupal's core search module. An abbreviation module would also implement Drupal's hook_search_preprocess(), and instead of calling the Porter Stemmer's stemming function, it would do a search/replace on the abbreviations.
If you are thinking of developing this module, I would make it language-independent, and give the user an option to add/remove things from the list of abbreviations to be substituted. I would also recommend expanding abbreviations during preprocessing (e.g. save Tuesday in the index if Tue is encountered), rather than the reverse (save Tue if Tuesday is encountered), to avoid running into word length issues.