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

  • This is a call to all my past resignations

    My building, like many here in the fair City O' Fog, has a door entry system which calls a phone number - I can then buzz the door open using the…

  • You Get Me Closer To God

    And ooooooooooooh, the music puns get worse and worse. So, at work we stumbled across an interesting Perlism. Well, interesting if you're a huge…

  • All Tomorrow's Parties

    After my last bit of Calendar fiddling I was left slightly disgusted by the state of the code. In my defence it was written over the course of a…

  • 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.