Simon Wistow (deflatermouse) wrote,
Simon Wistow

I want to live with common people^W parts

The one thing about the keywords service from Yahoo! is that it's prone to returning keywords with common stems. For example if I was talking a lot about sheep it might return

    sheep, sheep shearing, sheep dipping, sheep rustling 

when really all I want to do is have it return 'sheep'. Enter Text::CommonParts which will also do the trick of


    sheep shearing, sheep dipping, sheep rustling, sheep shearing shears, sheep shearing shed

and returning

    sheep, sheep shearing

Given a singleton

    thing one, thing two, another thing

it does the right thing and returns

    thing, another thing

It has occurred to me that I may want a more complicated API that returns, instead of a list of common parts, a hash of common parts with the key being the part and the value being a list of the snipped off tails.

Tags: api, common parts, enter, hash, keywords, lot, prone, service, sheep, singleton, stems

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.