creating keywords dynamically from mysql using php -


My structure: There are texts in each category, because these texts have their own entries, therefore table 'category' and table 'treatise' each There are about 90 texts in the category, each lesson is about 300 characters.

What I have to do is create meta tags for categories, how to get all relevant 'texts' and rank all the words and take the top 10 words. These will be the top 10 category keyword meta tags.

Now .. move how to get those top 10 words> Currently I've found that each text (a full text) will be divided into a one-per-word array this array (in php) is quite long After that, I take the frequency of each word and rank it again at the frequency. Voila Top 10 Words

I have not tested this process but I think that it can take a bit, it will be cached, so it can only be run once or every week, but still, I I do not want to end the time.

Do you have any suggestions?

Maurice

Any help appreciated.

OK, now I have said my peace in the above comment, I'll come to your algorithm.

There are several ways to do this, I will focus on the PHP-heavy approach and let others do something else.

I believe that you have already inquired from the database and stored all the words in the variable $ texts as a space separated list

  // $ sample text data $ texts = "orange orange apple apple apple"; $ Withcounts = array_count_values ​​(explosion ('', $ text)); Esport (Dollar with Dollar); $ TopTen = array_keys (array_reverse (array_slice ($ catches with -10)); Print_r (TopTine $);  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -