@pakhad/default
v1.0.0
Published
Zero-config pakhad — pre-configured detector with English + Indian locales. Just import and use.
Downloads
77
Maintainers
Readme
@pakhad/default
Zero-config pakhad — pre-loaded with English and all 9 Indian locales. Install and use, no setup.
Install
npm install @pakhad/defaultUsage
import { detect } from '@pakhad/default';
detect('John Smith');
// { label: 'clean', score: 0.075, ... }
detect('asdfgh qwerty');
// { label: 'gibberish', score: 0.7, ... }
detect('Rahul Sharma');
// { label: 'clean', score: 0.086, ... }That's it. One import, one function call.
What's Included
@pakhad/core— detection engine@pakhad/locale-en— English (165k names)@pakhad/locale-in— Hindi, Marathi, Tamil, Telugu, Kannada, Malayalam, Bengali, Gujarati, Punjabi (9k+ names each)
All re-exported from @pakhad/default, so you can do everything without installing individual packages:
import { create, tokenize, inferFieldType, en, indiaLocales, hi } from '@pakhad/default';Custom Options
detect() accepts the same options as the core API:
import { detect } from '@pakhad/default';
detect('John Smith', { fieldType: 'name' });
detect('rahul', { locale: 'in-hi' });
detect('xkqzvb', { thresholds: { suspicious: 0.2, gibberish: 0.4 } });Access the Underlying Detector
import { detector } from '@pakhad/default';
detector.registerScorer({ /* custom scorer */ });
detector.detect('anything');When to Use @pakhad/core Instead
- You want only English or only specific Indian locales (smaller bundle)
- You need custom locale packs
- You want to build models from your own data
npm install @pakhad/core @pakhad/locale-enFull Documentation
github.com/nikhilchintawar/pakhad
License
MIT
