How kartik-sc/sanskrit-nlp works
Sanskrit NLP is a reproducible corpus-analysis project. Its main workflow acquires Sanskrit corpus records, profiles and cleans them, segments text into sentences, then produces lexical, vocabulary, and length analyses. Separate comparison and error-analysis tools support the documented linguistic experiments. Edges follow the shown input/output behavior and imports; several capabilities are documented or present in the tree but their implementation was not sampled, so their connections are limited or omitted. Phase 2 is a stated future direction, not an implemented subsystem.
Main entry points: processed Cleaned corpus · results Analysis results · download_corpus.py Corpus downloader · segment_sentences.py Sentence segmenter
Components 20
Corpus acquisition
- Corpus downloader
src/acquisition/download_corpus.py - Corpus inspection
src/acquisition/inspect_corpus.py - Raw corpus
data/raw - Interim text
data/interim
Corpus preparation
- Corpus profiling
src/preprocessing/profile_corpus.py - Cleaning V1
src/preprocessing/clean_corpus.py - Normalized corpus
data/processed - Cleaning V2
src/preprocessing/clean_corpus_v2.py - Cleaned corpus
data/processed
Sentence segmentation
- Sentence segmenter
src/segmentation/segment_sentences.py - Segmented sentences
data/processed - Mode comparison
src/segmentation/compare_segmentation_modes.py - Segmentation error analysis
src/segmentation/error_analysis.py
Corpus analysis
- Lexical analysis
src/analysis/lexical_analyzer.py - Full frequencies
src/analysis/export_full_frequencies.py - Length analysis
src/segmentation/length_analysis.py - Word-length comparison
src/segmentation/word_length_comparison.py - Analysis results
results
Other components
- Researcher
- Sangraha dataset
Connections 28
- Researcher → Corpus downloader: runs
src/acquisition/download_corpus.py - Corpus downloader → Sangraha dataset: streams dataset
src/acquisition/download_corpus.py - Corpus downloader → Raw corpus: writes records
src/acquisition/download_corpus.py - Corpus downloader → Interim text: writes text
src/acquisition/download_corpus.py - Raw corpus → Corpus profiling: profiles
src/preprocessing/profile_corpus.py - Raw corpus → Cleaning V1: cleans records
src/preprocessing/clean_corpus.py - Cleaning V1 → Normalized corpus: writes normalized data
src/preprocessing/clean_corpus.py - Cleaning V1 → Cleaned corpus: writes cleaned text
src/preprocessing/clean_corpus.py - Normalized corpus → Cleaning V2: cleans further
src/preprocessing/clean_corpus_v2.py - Cleaning V2 → Cleaned corpus: writes V2 corpus
src/preprocessing/clean_corpus_v2.py - Normalized corpus → Sentence segmenter: segments
src/segmentation/segment_sentences.py - Sentence segmenter → Segmented sentences: writes sentences
src/segmentation/segment_sentences.py - Segmented sentences → Segmentation error analysis: flags and samples
src/segmentation/error_analysis.py - Segmentation error analysis → Length analysis: uses token helpers
src/segmentation/error_analysis.py - Segmentation error analysis → Sentence segmenter: uses terminator check
src/segmentation/error_analysis.py - Interim text → Lexical analysis: compares corpus
src/analysis/lexical_analyzer.py - Cleaned corpus → Lexical analysis: compares corpus
src/analysis/lexical_analyzer.py - Interim text → Full frequencies: counts tokens
src/analysis/export_full_frequencies.py - Cleaned corpus → Full frequencies: counts tokens
src/analysis/export_full_frequencies.py - Cleaned corpus → Length analysis: measures word length
src/segmentation/length_analysis.py - Segmented sentences → Length analysis: measures sentence length
src/segmentation/length_analysis.py - Cleaned corpus → Word-length comparison: compares measures
src/segmentation/word_length_comparison.py - Lexical analysis → Analysis results: writes metrics and tables
src/analysis/lexical_analyzer.py - Full frequencies → Analysis results: writes frequency tables
src/analysis/export_full_frequencies.py - Length analysis → Analysis results: writes distributions
src/segmentation/length_analysis.py - Word-length comparison → Analysis results: writes comparisons
src/segmentation/word_length_comparison.py - Corpus profiling → Analysis results: writes profile metrics
src/preprocessing/profile_corpus.py - Sentence segmenter → Mode comparison: compares modes