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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@isdk/zh-particles

v0.2.0

Published

Part-of-speech-aware detection of Chinese structural particles 的/地/得: tells particles from content words (大地/得到/详细地址)

Downloads

361

Readme

@isdk/zh-particles

English | 中文

中文结构助词「的/地/得」判定:区分助词与实词

它解决什么

这三个字混用确实是常见错别字,但它们同时也是实词的一部分:

| 原文 | 误用后 | 是否等价 | |---|---|---| | 他高兴地接受 | 他高兴的接受 | ✅ 是(助词) | | 辽阔的大地 | 辽阔的大的 | ❌ 否(实词) | | 他得到了批准 | 他到的了批准 | ❌ 否(实词) |

所以判定的关键不是"是不是这三个字",而是**"此处的字是不是独立的助词 token"**。 jieba 把「土地」切成 土地/n,里面的「地」根本不是独立 token,自然不会被折叠。

用法

npm i @isdk/zh-particles
import { createGuardListParticleTagger, createJiebaParticleTagger } from '@isdk/zh-particles';

// 零依赖保守模式(实词保护表)
createGuardListParticleTagger().foldableAt('辽阔的大地').has(4); // false

// 精确模式:注入 jieba
import * as jieba from '@isdk/nlp-jieba';
const tagger = createJiebaParticleTagger(jieba);
tagger.foldableAt('他高兴地接受').has(3); // true(助词)
tagger.foldableAt('这片土地').has(3);     // false(实词)

边界与取舍

  • 契约是 foldableAt(text) → ReadonlySet<下标>,一次性返回可折叠下标集合, 只需分词一次而非每位置各分一次
  • 主包默认不折叠(ignoreParticles: false):误判代价高于漏判
  • 保护表是无底洞(大地/土地/得到/值得/懂得…),能引 jieba 就引

相关