php - Best approach to create a tag cloud from input text -



php - Best approach to create a tag cloud from input text -

i wondering best approach generate tag cloud input text (while user typing it). example, if user types story's text containing keywords "sci-fi, technology, effects", tag cloud formed each of keywords ordered relevance according frequency on every story. tag cloud displayed in descending order , using same font size, it's not display algorithm, search algorithm should implement. i'm using mysql , php. should stick match...against clause? should implement tags table?

more details have mysql table containing lot of stories. when user typing 1 of his/her own, want display tag cloud containing frequent words, taken input text, occurring on set of stories saved on db. tag cloud used show user relevance of words he/she has entered on his/her own story according frequency occur on stories entered users.

i think first thing need more define purpose of tagging system. want build tags based on words occur within text? strikes me designed search rankings in mind.

...or want content improve organized, , tag cloud way of providing improve user experience , creating more distinct relationships between pieces of content (ie both of these tagged sci-fi, display them in sci-fi category).

if former case, might not need but:

explode text delimiter single space explode(' ', $content); have list (possibly in config file or within script itself) of words occur want exclude beingness tags (and, or, this, the, etc. jack them off pages this: http://www.esldesk.com/vocabulary/pronouns , http://www.english-grammar-revolution.com/list-of-conjunctions.html

then need decide how many times word has occur (either percentage or numeric), , store tags in table shows connection between tags , content.

to implement "as user typing" part need utilize bit of jquery's ajax functionality continually phone call script builds tag list (ie on keydown).

the other alternative (better user experience) incorporate lot of same elements, you'll have think bit more. things consider:

do want restrict tags (perhaps don't want allow create new tags)? how deal synonyms if back upwards multiple languages if want preference towards suggesting existing tags (which might close) on suggesting new ones

once you've defined logic , user experience can come search algorithm. match , against options may find simple you.

good luck = )

php mysql text input tag-cloud

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -