URL 关键词提取工具 keyword-extract

码农软件 · 软件分类 · 常用工具包 · 2019-08-12 20:42:11

软件介绍

单文件、无三方依赖、支持在线规则升级、非标准协议的 URL 关键词提取工具。

使用

<dependency>
  <groupId>com.ecfront</groupId>
  <artifactId>keyword-extract</artifactId>
  <version>1.4</version>
</dependency>
// 关键词提取
KeyWordExtract.Result result = KeyWordExtract.extract(url);

// 使用在线规则
KeyWordExtract.loadOnlineRules("https://raw.githubusercontent.com/gudaoxuri/keyword-extract/master/src/main/resources/kwe-rules.txt");

规则配置说明

本地规则文件默认已打到 jar 中,如要修改可在 classpath 根目录中创建 kwe-rules.txt 文件,此文件会覆盖默认规则。

使用在线规则会覆盖自定义规则。

# 一行一条规则,配置项以|分隔
# 规则分一般规则和自定义规则,后者使用js代码处理

# 一般规则
<名称>|<host>|<关键字所在位置,query:查询条件中,path:url路径中>|<对于query位置指定关键字的key,对于path位置指定以/分隔的偏移量>|<解码方式,目前只支持decodeURI,空>|<编码>

e.g. :

百度|www.baidu.com|query|wd|decodeURI|UTF-8
搜狗微信|weixin.sogou.com|query|query|encodeURI|UTF-8
苏宁|search.suning.com|path|0|decodeURI|UTF-8

# 自定义规则
<名称>|<host>|<js代码,入参为uri,返回值为result>

e.g. :

微博|s.weibo.com|var uri = decodeURI(decodeURI(uri)); var kv = uri.split("/")[2]; result = kv.split("&Refer=")[0];

# 自定义协议支持

app://app1/somepath?q=URL关键词提取
custom://custom1/somepath?q=URL关键词提取

本文地址:https://codercto.com/soft/d/12231.html

Advanced Web Metrics with Google Analytics

Advanced Web Metrics with Google Analytics

Brian Clifton / Sybex / 2008 / USD 39.99

Are you getting the most out of your website? Google insider and web metrics expert Brian Clifton reveals the information you need to get a true picture of your site's impact and stay competitive usin......一起来看看 《Advanced Web Metrics with Google Analytics》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

html转js在线工具
html转js在线工具

html转js在线工具