Posted By

matthewnovak on 10/26/08


Tagged

keyword wordnet subsitution


Versions (?)

Substituting Nouns With A Keyword With WordNet


 / Published in: Python
 

URL: http://www.blackcodeseo.com/keyword-distribution-over-rss-syndication/

  1. from wordnet import *
  2. from wntools import *
  3.  
  4. def substituteKeyword(description, keyword):
  5. words = description.split(' ')
  6. return string.join( map(lambda word: (keyword, word)[morphy(word, 'noun')==None], words), ' ' )

Report this snippet  

You need to login to post a comment.