[][src]Struct lingua::TestDataFilesWriter

pub struct TestDataFilesWriter;

This struct creates test data files for accuracy report generation and writes them to a directory.

Implementations

impl TestDataFilesWriter[src]

pub fn create_and_write_test_data_files(
    input_file_path: &Path,
    output_directory_path: &Path,
    char_class: &str,
    maximum_lines: u32
) -> Result<()>
[src]

Creates test data files for accuracy report generation and writes them to a directory.

input_file_path: The path to a txt file used for test data creation. The assumed encoding of the txt file is UTF-8.

output_directory_path: The path to an existing directory where the test data files are to be written.

char_class: A regex character class such as \\p{L} to restrict the set of characters that the test data are built from.

maximum_lines: The maximum number of lines each test data file should have.

⚠ Panics if:

  • the input file path is not absolute or does not point to an existing txt file
  • the input file's encoding is not UTF-8
  • the output directory path is not absolute or does not point to an existing directory
  • the character class cannot be compiled to a valid regular expression

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.