pub trait TextSplitter {
    // Required method
    fn split_text(&self, text: &str) -> Result<Vec<String>, Box<dyn Error>>;

    // Provided methods
    fn split_documents(
        &self,
        documents: &[Document]
    ) -> Result<Vec<Document>, Box<dyn Error>> { ... }
    fn create_documents(
        &self,
        text: &[String],
        metadatas: &[HashMap<String, Value>]
    ) -> Result<Vec<Document>, Box<dyn Error>> { ... }
}

Required Methods§

source

fn split_text(&self, text: &str) -> Result<Vec<String>, Box<dyn Error>>

Provided Methods§

source

fn split_documents( &self, documents: &[Document] ) -> Result<Vec<Document>, Box<dyn Error>>

source

fn create_documents( &self, text: &[String], metadatas: &[HashMap<String, Value>] ) -> Result<Vec<Document>, Box<dyn Error>>

Implementors§