pub struct TextToGraph {
pub documents: Vec<Document>,
pub text_field: String,
pub window_size: usize,
pub language: String,
}Expand description
Build a token co-occurrence graph from a document corpus.
Each unique token becomes a vertex (label "", property token).
window_size == 0 connects every pair of distinct tokens that
appear in the same document; a positive window_size only connects
tokens within window_size positions of each other. Edges are
labeled co_occurs and carry a weight property equal to the
total co-occurrence count.
Fields§
§documents: Vec<Document>§text_field: String§window_size: usize§language: StringImplementations§
Source§impl TextToGraph
impl TextToGraph
pub fn new(documents: Vec<Document>) -> Self
pub fn text_field(self, name: impl Into<String>) -> Self
pub fn window_size(self, w: usize) -> Self
pub fn language(self, lang: impl Into<String>) -> Self
pub fn execute(self) -> CrossParadigmResult<MemoryGraphStore>
Auto Trait Implementations§
impl Freeze for TextToGraph
impl RefUnwindSafe for TextToGraph
impl Send for TextToGraph
impl Sync for TextToGraph
impl Unpin for TextToGraph
impl UnsafeUnpin for TextToGraph
impl UnwindSafe for TextToGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more