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 🙏

© 2025 – Pkg Stats / Ryan Hefner

balochi-spellcheck

v1.0.0

Published

Balochi spellchecker using BK-tree and Levenshtein distance

Downloads

7

Readme

📖 Balochi Spellchecker

A production-ready spellchecker for the Balochi language, built using BK-trees and Levenshtein distance.

This library lets you:

  • ✅ Verify if a Balochi word is spelled correctly
  • 🔍 Generate suggestions for misspelled words
  • 📦 Use it in Node.js, web apps, or as a base for APIs/CLIs

The wordlist (~16,000 words) is sourced from the SayadGanj Dictionary, one of the most comprehensive Balochi lexicons available.


🚀 Installation

npm install balochi-spellcheck

✨ Usage

import SpellChecker from "balochi-spellcheck";

// Initialize spellchecker
const checker = new SpellChecker();

// Check correctness
console.log(checker.isCorrect("جام")); 
// → true

console.log(checker.isCorrect("جامف")); 
// → false

// Get suggestions
console.log(checker.suggest("جامف", 2, 5));
// → ["جامی", "جامگ", "جامو", "جام", "جا"]

⚙️ API Reference

new SpellChecker(customWords = [])

Creates a spellchecker instance.

  • customWords (Array) — Optional wordlist. Defaults to SayadGanj data.

.isCorrect(word: string): boolean

Returns true if word exists in the dictionary, otherwise false.


.suggest(word: string, maxDist = 2, limit = 5): string[]

Returns a ranked array of suggestions.

  • word (string) — Input word to check
  • maxDist (number) — Maximum edit distance allowed (default 2)
  • limit (number) — Maximum number of suggestions (default 5)

Ranking is done by:

  1. Lowest edit distance
  2. Closest word length

📚 Wordlist Source

This package uses ~16,000 words from the SayadGanj Dictionary. Full credit goes to the dictionary maintainers and the wider Balochi linguistic community.


🌍 Real-world Applications

  • Spellchecking for editors, keyboards, or search bars
  • Autocomplete in Balochi typing tools
  • Search improvement (catching typos in queries)
  • Language research and digital preservation of Balochi

🛠 Development

Clone and install:

git clone https://github.com/umairayub79/balochi-spellcheck.git
cd balochi-spellcheck
npm install

Run tests:

npm test

🤝 Contributing

Contributions are welcome!

  • Fork the repo
  • Add features / bugfixes
  • Submit a PR

We especially encourage contributions in:

  • Expanding/validating the wordlist
  • Improving suggestion ranking
  • Adding transliteration & grammar support

🗺 Roadmap

  • [ ] Publish hosted REST API
  • [ ] Add browser-optimized build (ESM/CDN)
  • [ ] Provide Balochi → Latin transliteration helpers
  • [ ] Support predictive typing models

📜 License

MIT License © 2025 Umair Ayub


⭐ Acknowledgements

  • SayadGanj Dictionary — primary data source
  • Balochi language community for keeping the language alive digitally
  • Open-source libraries: fast-levenshtein