dspld86684 2011-03-14 23:12
浏览 23
已采纳

PHP检测页面类型/类别

I was wondering if their was any sort of way to detect a pages genre/category.

Possibly their is a way to find keywords or something?

Unfortunately I don't have any idea so far, so I don't have any code to show you.

But if anybody has any ideas at all, let me know.

Thanks!

EDIT @Nican

Perhaps their is a way to set, let's say 10 category's (Entertainment, Funny, Tech).

Then creating keywords for these category's (Funny = Laughter, Funny, Joke etc).

Then searching through a webpage (maybe using a cUrl) for these keywords and assigning it to the right category.

Hope that makes sense.

  • 写回答

2条回答 默认 最新

  • donglu6303 2011-03-14 23:22
    关注

    Folksonomy may be a way of accomplishing what you're looking for:

    http://en.wikipedia.org/wiki/Folksonomy

    For instance, in Drupal they have a Folksonomy module:

    http://drupal.org/node/19697 (Note this module appears to be dead, see http://drupal.org/taxonomy/term/71)

    Couple that with a tag cloud generator, and you may get somewhere:

    http://drupal.org/project/searchcloud

    Plus, a little more complexity may be able to derive mapped relationships to other terms, especially if you control the structure of the tagging options.

    http://intranetblog.blogware.com/blog/_archives/2008/5/22/3707044.html

    EDIT

    In general, the type of system you're trying to build relies on unique word values on a page. So you would need to...

    1. Get unique word values from your content (index values or create a bot to crawl your site)
    2. Remove all words and symbols you can't use (at, the, or, and, etc...)
    3. Count the number of times the unique words appear on the page
    4. Add them to some type of datastore so you can call them based on the relationships you're mapping
    5. If you have a root label system in place, associate those values with the word counts on the page (such as a query or derived table)

    This is very general, and there are a number of ways this can be implemented/interpreted. Folksonomies are meant to "crowdsource" much of the effort for you, in a "natural way", as long as you have a user base that will contribute.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法