pub trait BaseConllu: Sized {
Show 13 methods
// Required methods
fn files(&self) -> &VecDeque<ConlluFile>;
fn files_mut(&mut self) -> &mut VecDeque<ConlluFile>;
fn from_files(files: VecDeque<ConlluFile>) -> Self;
// Provided methods
fn num_files(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn file_paths(&self) -> Vec<String> { ... }
fn sentences(&self) -> Vec<&Sentence> { ... }
fn to_strings(&self) -> Vec<String> { ... }
fn default_output_filenames(&self, target_ext: &str) -> Vec<String> { ... }
fn write_conllu_files(
&self,
dir_path: &str,
filenames: Option<Vec<String>>,
) -> Result<(), WriteError> { ... }
fn to_chat_strings(&self) -> Vec<String> { ... }
fn to_chat_obj(&self) -> Chat { ... }
fn write_chat_files(
&self,
dir_path: &str,
filenames: Option<Vec<String>>,
) -> Result<(), WriteError> { ... }
}Expand description
Core CoNLL-U reader behavior with default implementations.
Required Methods§
fn files(&self) -> &VecDeque<ConlluFile>
fn files_mut(&mut self) -> &mut VecDeque<ConlluFile>
fn from_files(files: VecDeque<ConlluFile>) -> Self
Provided Methods§
Sourcefn file_paths(&self) -> Vec<String>
fn file_paths(&self) -> Vec<String>
Return the file paths.
Sourcefn to_strings(&self) -> Vec<String>
fn to_strings(&self) -> Vec<String>
Return CoNLL-U strings, one per file.
Sourcefn default_output_filenames(&self, target_ext: &str) -> Vec<String>
fn default_output_filenames(&self, target_ext: &str) -> Vec<String>
Derive default output filenames from existing file paths.
Sourcefn write_conllu_files(
&self,
dir_path: &str,
filenames: Option<Vec<String>>,
) -> Result<(), WriteError>
fn write_conllu_files( &self, dir_path: &str, filenames: Option<Vec<String>>, ) -> Result<(), WriteError>
Write CoNLL-U files to a directory.
Sourcefn to_chat_strings(&self) -> Vec<String>
fn to_chat_strings(&self) -> Vec<String>
Return CHAT format strings (one per file) for CHAT export.
Sourcefn to_chat_obj(&self) -> Chat
fn to_chat_obj(&self) -> Chat
Convert to a Chat object.
Sourcefn write_chat_files(
&self,
dir_path: &str,
filenames: Option<Vec<String>>,
) -> Result<(), WriteError>
fn write_chat_files( &self, dir_path: &str, filenames: Option<Vec<String>>, ) -> Result<(), WriteError>
Write CHAT (.cha) files to a directory.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.