How does wikipedia turn key words into links?
I'm trying to code something in Node.js where I have a model called
"tags". Say I want to see whenever a user types a tag in a comment, and
turn that into a link to the relevant tag page.
For example, a user enters a comment: "What is a chicken?", and "chicken"
turns into a link to the "chicken" tag page.
My current approach is to parse the text against database queries to the
tag model, but this seems like a bad way, not to mention dealing multiple
word tags like "chicken soup" etc...
Thanks so much for the help! I imagine wikipedia's got a good way of doing
this.
No comments:
Post a Comment