Substituting Nouns With A Keyword With WordNet


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  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), ' ' )

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.