Skip to content

prabhashj07/nepalikit

Repository files navigation

NepaliKit

Current Release Version pypi Version PyPi downloads

NepaliKit is a Python library for natural language processing tasks in the Nepali language.

Installation

pip install nepalikit

Quick Start

from nepalikit.tokenization import Tokenizer
from nepalikit.preprocessing import TextProcessor
from nepalikit.manage_stopwords import get_stopwords, remove_stopwords_from_text

# Tokenize text
tokenizer = Tokenizer()
tokens = tokenizer.tokenize("नमस्ते, के छ खबर? यो एउटा वाक्य हो।", level='word')

# Clean text
processor = TextProcessor()
clean = processor.remove_html_tags("<p>नमस्ते</p>")
clean = processor.remove_special_characters(clean)

# Remove stopwords
filtered = remove_stopwords_from_text("म घर जाँदै छु")

Features

  • Tokenization — Rule-based and SentencePiece tokenizers
  • Preprocessing — HTML removal, special character cleaning, whitespace normalization
  • Stopword Management — 340+ curated Nepali stopwords with dynamic add/remove
  • Stemming — Rule-based suffix stripping
  • Normalization — Unicode NFC normalization, ZWNJ/ZWJ stripping, script detection
  • POS Tagging — Dictionary-based tagger with 11 grammatical categories
  • Spell Checking — Dictionary-based with Levenshtein edit distance suggestions
  • Transliteration — Roman ↔ Devanagari + Preeti font conversion
  • Number Extraction — Parse Devanagari digits and Nepali number words to integers
  • Sentence Operations — Sentence segmentation, extraction, and analysis

Documentation

Full documentation is available at the living website:

Alternatively, browse the raw documentation files:

License

This project is licensed under the MIT License.

Author

About

NepaliKit is a Python library for natural language processing (NLP) tasks in Nepali. It features tokenization (rule-based and SentencePiece), text preprocessing, stopword management, and sentence segmentation. Ideal for developers and researchers working with Nepali text data.

Topics

Resources

License

Code of conduct

Contributing

Stars

7 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages