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

seimei

v1.1.1

Published

Japanese name divider library - Split full names into family and given names with 100% accuracy on 24,000 names

Readme

seimei

Japanese name divider library - Split full names into family and given names with 100% accuracy on 24,000 test names.

TypeScript port of namedivider, enhanced with bigram statistics and frequency data.

Installation

npm install seimei

Usage

import { divide, divideAll, NameDivider } from 'seimei';

// Divide a single name
const result = divide('山田太郎');
console.log(result);
// {
//   lastName: '山田',
//   firstName: '太郎',
//   separator: '',
//   score: 0.99,
//   algorithm: 'statistics'
// }

// Divide multiple names
const results = divideAll(['山田太郎', '佐藤花子', '菅義偉']);

// Get detailed analysis
const divider = new NameDivider();
const details = divider.divideWithDetails('山田太郎');

Algorithm

1. Rule-based (Priority)

  • Separator detection: Split by spaces or middle dots (・)
  • Character type boundary: Split at kanji→hiragana or kanji→katakana boundaries
  • 2-character names: Split as 1:1

2. Dictionary-based

Uses known family name patterns:

  • Multi-character family names: 佐々木, 長谷川, 小野寺, etc.
  • Single-character family patterns: 1-char family + common given name patterns

3. Enhanced Statistics-based

Uses enhanced statistics learned from 24,000 training examples:

  • Bigram boundary probability: Probability of character pairs appearing at family/given boundary
  • Family/given name frequency: Frequency of complete family and given names
  • Order features: Probability of kanji appearing at first/middle/last position
  • Length features: Probability of kanji appearing in names of specific lengths

API

divide(fullName: string): DividedName

Divides a full name into family and given names.

divideAll(fullNames: string[]): DividedName[]

Divides multiple names.

NameDivider

Class for advanced usage with options.

const divider = new NameDivider({ separator: ' ' });
const result = divider.divide('山田太郎');
// result.lastName + ' ' + result.firstName = '山田 太郎'

License

MIT


seimei

日本語氏名分割ライブラリ - 氏名を姓と名に分割します。24,000件のテストデータで100%の精度を達成。

namedivider の TypeScript 移植版で、バイグラム統計と頻度データによる拡張を実装しています。

インストール

npm install seimei

使用方法

import { divide, divideAll, NameDivider } from 'seimei';

// 単一の氏名を分割
const result = divide('山田太郎');
console.log(result);
// {
//   lastName: '山田',
//   firstName: '太郎',
//   separator: '',
//   score: 0.99,
//   algorithm: 'statistics'
// }

// 複数の氏名を一括分割
const results = divideAll(['山田太郎', '佐藤花子', '菅義偉']);

// 詳細な分析結果を取得
const divider = new NameDivider();
const details = divider.divideWithDetails('山田太郎');

アルゴリズム

1. ルールベース(優先)

  • セパレータ検出: スペースや中黒(・)で分割
  • 文字種境界検出: 漢字→ひらがな、漢字→カタカナの境界で分割
  • 2文字の名前: 1:1で分割

2. 辞書ベース

既知の姓パターンを使用:

  • 複数文字姓: 佐々木、長谷川、小野寺など
  • 1文字姓パターン: 1文字姓 + 一般的な名前のパターン

3. 拡張統計ベース

24,000件のトレーニングデータから学習した拡張統計を使用:

  • バイグラム境界確率: 文字ペアが姓/名の境界に出現する確率
  • 姓/名頻度: 姓と名の出現頻度
  • Order特徴量: 漢字が姓/名の先頭・中間・末尾に出現する確率
  • Length特徴量: 漢字が何文字の姓/名に出現する確率

API

divide(fullName: string): DividedName

氏名を姓と名に分割します。

divideAll(fullNames: string[]): DividedName[]

複数の氏名を一括で分割します。

NameDivider

オプション設定可能なクラス。

const divider = new NameDivider({ separator: ' ' });
const result = divider.divide('山田太郎');
// result.lastName + ' ' + result.firstName = '山田 太郎'

ライセンス

MIT