npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

word-picker2

v1.1.7

Published

文本分词,中文分词,大文本分词,支持第三方词库,效率高

Downloads

11

Readme

特性

  • 效率非常高
  • 支持第三方词库,例如搜狗词库,您只需要下载后利用接口导入即可
  • 支持模糊关键词匹配,例如关键词为:‘互联网%开发者’,那么‘互联网公司的开发者’可分词为:‘互联网%开发者’
  • 示例 作为一个互联网从业人员和一个普通开发者,我认为本质上互联网公司还是要回到如何解决人们生活中遇到的问题。 => 作为,一个,联网,从业,人员,普通,开发,认为,本质,公司,还是,要回,回到,如何,解决,人们,生活,遇到,问题,互联网,开发者,我认为,本 质上,从业人员,互联网%公司,互联网%公司%开发者

安装:

npm install word-picker2

模块暴露类

module.exports = Picker

method

picker.doPicker(str) // 执行分词 return ['word1', 'word2']
picker.addLib(filename/array)  // 载入其它文件夹下词库
picker.reloadLib(filename/array)  // 重新加载词库

用法:

var Picker = require('word-picker2')

var picker = new Picker({
  wordMinLen: 2,
  wordMaxLen: 10
})

picker.addLib(['互联网', '开发人员', '互联网公司%开发人员', '公司开发人员'])

var ret = picker.doPicker('互联网公司的开发人员都有一个普遍的特点,就是帅')
console.log(ret)

# 打印结果:['互联网', '开发人员', '互联网公司%开发人员']

词库文件格式示例(存储为文本格式,每个词根之间回车换行):

八八
八比特组
八叉树
八皇后问题
八进制
八进制数字
八位
巴克斯
巴克斯范式
吧主
霸王大陆
白板服务
白鹿书院
白消耗周期
白噪声发生器
百度
百堂互联
百阅
百兆网卡
版本编程
版本管理
版本号
版本控制
版本升级
版权