Provide stem common root function

malc_b - June 18, 2009 - 18:55
Project:Porter-Stemmer
Version:6.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

In order to fix the excerpt problem, that is where search can't find an excerpt matching the search (due to the search being the stemmed value), can I suggest that you provide a function that returns just the root. So for likely, like, liking all of which return a search key of like the common root function would return lik, or lik.*? which matches all the possible keys. That would enable search excerpt to work will a simple patch to call this function.

Looking at the code I think this could just be a copy of stem functions and then change all the replaces to replace with ''. Would that work?

#1

jhodgdon - July 2, 2009 - 22:56

You can use the Stem() function in Porter Stemmer to return the root of a word. That is exactly what it does. For the word "liking", "like" is the grammatical root.

Anyway, I have a fix for the underlying problem with search excerpts now, see #493270: search_excerpt() doesn't work well with stemming

#2

greggles - July 3, 2009 - 15:06
Category:feature request» support request
Status:active» fixed

Since this is already provided, I guess this can be considered a support request and considered fixed.

Thanks @jhodgdon.

#3

System Message - July 17, 2009 - 15:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.