php - 以编程方式从域名中提取关键字

标签 php string dns keyword extraction

假设我有一个要分析的域名列表。除非域名带有连字符,否则我看不到一种特别简单的方法来“提取”域中使用的关键字。然而,我看到它在 DomainTools.com、Estibot.com 等网站上完成。例如:

ilikecheese.com becomes "i like cheese"
sanfranciscohotels.com becomes "san francisco hotels"
...

对于有效地完成此任务有什么建议吗?

编辑:我想用 PHP 编写。

最佳答案

好的,我运行了为 this SO question 编写的脚本,有几个小的变化——使用对数概率来避免下溢,并将其修改为读取多个文件作为语料库。

对于我的语料库,我从 Gutenberg 项目下载了一堆文件——没有真正的方法,只是从 etext00、etext01 和 etext02 中抓取了所有英语文件。

下面是结果,我为每个组合保存了前三名。

expertsexchange: 97 possibilities
 -  experts exchange -23.71
 -  expert sex change -31.46
 -  experts ex change -33.86

penisland: 11 possibilities
 -  pen island -20.54
 -  penis land -22.64
 -  pen is land -25.06

choosespain: 28 possibilities
 -  choose spain -21.17
 -  chooses pain -23.06
 -  choose spa in -29.41

kidsexpress: 15 possibilities
 -  kids express -23.56
 -  kid sex press -32.65
 -  kids ex press -34.98

childrenswear: 34 possibilities
 -  children swear -19.85
 -  childrens wear -25.26
 -  child ren swear -32.70

dicksonweb: 8 possibilities
 -  dickson web -27.09
 -  dick son web -30.51
 -  dicks on web -33.63

关于php - 以编程方式从域名中提取关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1315373/

相关文章:

php - 相同字符串的 base64_encode() 值是否不同?

python - 如何将字符串列表转换为集合列表?

php - 如何在 WebTestCase 上进行 JSON 请求

PHP ZipArchive 状态值是什么意思?

javascript - 如何通过 AJAX 发送字体系列样式

c++ - 将 `int` 值插入到 `std::map` 中,它应该存储 `std::string`

asp.net-mvc - 使用 Razor View 引擎 - 如何将十进制值格式化为逗号和两位小数?

dns - 如何使用相同的 TXT 和 CNAME 为 Mailgun 配置 DNS?

c# - 关于DNS解析使用[System.Net.Dns] : how does it work and what port does it use?的两个问题

javascript - 请求模块中的 dns 缓存 - node.js