pub struct CoreMetadata {
pub name: String,
pub encoding: String,
pub default_word_cost: i16,
pub default_left_context_id: u16,
pub default_right_context_id: u16,
pub default_field_value: String,
pub flexible_csv: bool,
pub skip_invalid_cost_or_id: bool,
pub normalize_details: bool,
pub dictionary_schema: CoreSchema,
pub user_dictionary_schema: CoreSchema,
}Expand description
Dictionary metadata shared by the bindings.
Mirrors the binding Metadata wrappers as a pure-Rust type (using
CoreSchema for the two schema fields) so each binding can wrap a
CoreMetadata instead of re-declaring the same defaults and conversions.
Converts to and from lindera::dictionary::Metadata; the optional
model_info carried by the lindera type is not retained (the bindings do
not expose it).
Fields§
§name: StringDictionary name.
encoding: StringCharacter encoding.
default_word_cost: i16Default word cost for simple user-dictionary entries.
default_left_context_id: u16Default left context id for simple user-dictionary entries.
default_right_context_id: u16Default right context id for simple user-dictionary entries.
default_field_value: StringDefault value substituted for missing fields.
flexible_csv: boolWhether CSV columns are handled flexibly.
skip_invalid_cost_or_id: boolWhether entries with invalid cost or id are skipped.
normalize_details: boolWhether morphological details are normalized.
dictionary_schema: CoreSchemaSchema for the main dictionary.
user_dictionary_schema: CoreSchemaSchema for the user dictionary.
Implementations§
Source§impl CoreMetadata
impl CoreMetadata
Sourcepub fn new(
name: Option<String>,
encoding: Option<String>,
default_word_cost: Option<i16>,
default_left_context_id: Option<u16>,
default_right_context_id: Option<u16>,
default_field_value: Option<String>,
flexible_csv: Option<bool>,
skip_invalid_cost_or_id: Option<bool>,
normalize_details: Option<bool>,
dictionary_schema: Option<CoreSchema>,
user_dictionary_schema: Option<CoreSchema>,
) -> Self
pub fn new( name: Option<String>, encoding: Option<String>, default_word_cost: Option<i16>, default_left_context_id: Option<u16>, default_right_context_id: Option<u16>, default_field_value: Option<String>, flexible_csv: Option<bool>, skip_invalid_cost_or_id: Option<bool>, normalize_details: Option<bool>, dictionary_schema: Option<CoreSchema>, user_dictionary_schema: Option<CoreSchema>, ) -> Self
Creates metadata, falling back to the binding defaults for any None.
Sourcepub fn create_default() -> Self
pub fn create_default() -> Self
Creates metadata with all binding defaults.
Trait Implementations§
Source§impl Clone for CoreMetadata
impl Clone for CoreMetadata
Source§fn clone(&self) -> CoreMetadata
fn clone(&self) -> CoreMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoreMetadata
impl Debug for CoreMetadata
Source§impl Default for CoreMetadata
impl Default for CoreMetadata
Source§fn default() -> Self
fn default() -> Self
Returns CoreMetadata::create_default.
Source§impl From<CoreMetadata> for Metadata
impl From<CoreMetadata> for Metadata
Source§fn from(metadata: CoreMetadata) -> Self
fn from(metadata: CoreMetadata) -> Self
Converts a CoreMetadata into a lindera Metadata (model_info is None).
Auto Trait Implementations§
impl Freeze for CoreMetadata
impl RefUnwindSafe for CoreMetadata
impl Send for CoreMetadata
impl Sync for CoreMetadata
impl Unpin for CoreMetadata
impl UnsafeUnpin for CoreMetadata
impl UnwindSafe for CoreMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.