pub struct CastRow {
pub id: String,
pub name: String,
pub pattern: Option<Regex>,
pub words: usize,
pub fields: Vec<(String, String)>,
}Expand description
A row of a cast table (ruling #79): the character’s id (the
prosopon a mention answers), its name, the pattern a word
token must match to be its mention, and the table’s other
columns as the character’s fields.
Fields§
§id: String§name: String§pattern: Option<Regex>§words: usizeHow many word tokens the pattern spans (a mention or
stem of several words matches a run of tokens).
fields: Vec<(String, String)>Implementations§
Source§impl CastRow
impl CastRow
Sourcepub fn read_csv(path: &str) -> Result<Vec<CastRow>, String>
pub fn read_csv(path: &str) -> Result<Vec<CastRow>, String>
Read a cast table from a CSV file: an id column (required),
a name, and the pattern a word token must match to be the
character’s mention — pattern as a regex, stem (or
prefix) as a prefix, or mention / form as the whole
word — with every
other column kept as the character’s fields.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CastRow
impl RefUnwindSafe for CastRow
impl Send for CastRow
impl Sync for CastRow
impl Unpin for CastRow
impl UnsafeUnpin for CastRow
impl UnwindSafe for CastRow
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