sentencex 0.1.28

Sentence segmentation library with wide language support optimized for speed and utility.
Documentation
use rustc_hash::FxHashSet;
use std::sync::LazyLock;

use super::Language;
use super::parse_abbreviation_list;

#[derive(Debug, Clone)]
pub struct Hindi {}
static HINDI_ABBREVIATIONS: LazyLock<FxHashSet<String>> = LazyLock::new(|| {
    parse_abbreviation_list([
        include_str!("./abbrev/hi.txt"),
        include_str!("./abbrev/en.txt"),
    ])
});

impl Language for Hindi {
    fn get_abbreviations(&self) -> &FxHashSet<String> {
        &HINDI_ABBREVIATIONS
    }
}

#[cfg(test)]
mod tests {
    use crate::languages::tests::run_language_tests;

    use super::*;

    #[test]
    fn test_segment() {
        run_language_tests(Hindi {}, "tests/hi.txt");
    }
}