xuexi 0.1.5

utility to parse a sentence into words for multiple language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::error::DictionaryError;
use serde::Deserialize;

#[derive(Debug, Deserialize)]
pub struct Puncutation {
    pub chinese: Vec<String>,
    pub laotian: Vec<String>,
}

impl Puncutation {
    /// Create a new puncutation enum from the json list
    pub fn new() -> Result<Self, DictionaryError> {
        let value = include_bytes!("./puncutation.json");
        let ds: Puncutation = serde_json::from_slice(value)?;

        Ok(ds)
    }
}