www.webdeveloper.com
Results 1 to 6 of 6

Thread: I was wondering how to create a tag cloud based on post contents

  1. #1
    Join Date
    Apr 2009
    Posts
    5

    I was wondering how to create a tag cloud based on post contents

    I'm trying to think of how to create a tag cloud based on the content of threads/posts. I haven't created one yet but I believe the best way to create one would be to take each thread and split the text based on space. I would then cycle through the words and remove any word under say 3 characters. I would then iterate over the remaining words removing noise words (which I would put in noise array) and any words that weren't in that array I'd add to a 2 dimension array called tags (with a count). If the word exists in the array I'd increment one to the value in the array, if not I'd add the result to tags. Afterwards I'd have the ability to sort by name or count. However, I don't know if this is the most efficient way to do this. Does anyone know of a better method?

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,290
    This is more of a server-side issue like PHP + SQL
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #3
    Join Date
    Apr 2009
    Posts
    5

    Reply

    Quote Originally Posted by \\.\ View Post
    This is more of a server-side issue like PHP + SQL
    Yes and no. I tend to like to put as much as I can on the client side for overall performance. Spread the workload. SQL would definitely make it easier, however I can't see many reasons not to make some use of client side.

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,290
    tag clouds are server side and not client side and once created add no additional work load to a server, only thing the server has to do is make a simple and quick SQL query.

    You do not keep large numbers of tags, your tag cloud is meant to be what is currently trending.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  5. #5
    Join Date
    Apr 2009
    Posts
    5
    Quote Originally Posted by \\.\ View Post
    tag clouds are server side and not client side and once created add no additional work load to a server, only thing the server has to do is make a simple and quick SQL query.

    You do not keep large numbers of tags, your tag cloud is meant to be what is currently trending.
    Tag cloud was probably the wrong word. Here's what I'm working on. I'm trying to make an RSS reader, like Google Reader. What I plan to have is the ability to use regular SQL or full text searches (obviously) but also have filtering capabilities based off the returned results. Here's the difference. When you do a search for foobar you do a SQL search against the site. The results are returned. You can then start typing tag1 or tag2 and it will only show the results from the search that contain the tag. Clearing them out just shows the full results. There's no server involvement. I'd also like a side tag cloud that shows the tags used on the page and you can click on them to filter the results. I've seen some clouds on other sites like this. This can give the user very fast results while also putting less stress on the server.

  6. #6
    Join Date
    Apr 2009
    Posts
    5
    I think I just noticed some faulty logic on my end. The server results can easily do the tag cloud. The cloud can just then filter the results.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles