Forum Moderators: coopster

Message Too Old, No Replies

Automatically turning keywords in an article into links to Wikipedia

         

ntbgl

11:40 am on Jul 13, 2009 (gmt 0)

10+ Year Member



I would like to take an article, and have words or phrases in the article be turned into links to Wikipedia if there is an article on it. Not every word, but major keywords.

A sentence like "The Magna Carta was written in Latin." would have links to "Magna Carta" and "Latin", not "The", "was", "written" or "in", even though there is an article for written.

How is this done? I see sites like Google have links to Answers.com (a parser of Wikipedia) for a definition if the word or keyword has a match. And there is an ad revenue program that parses articles with links to affiliates.

Would I somehow isolate the keywords of a document, and match those against Wikipedia?

andrewsmd

3:00 pm on Jul 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your on the right track. You would somehow need to decide what are key words and what are not. You can then check if the words are valid links to wikipedia with php. Just look and see fi wikipedia has that link. I.e. for Magna Carta the link would be
[en.wikipedia.org...] check and see if that is a valid link. If it is, then you would create it. It's not going be be 100% accurate but it will be close. Post some code if you are having problems.

Nutter

1:21 am on Jul 14, 2009 (gmt 0)

10+ Year Member



Are you writing on a set of topics that would share the same keywords? It seems like it would be easier to have a list of keywords and their associated link and then just replace keyword with <a href="link">keyword</a> rather than trying to guess keywords and check if they have a live Wiki page.