pub struct JsMetadata { /* private fields */ }Expand description
Dictionary metadata configuration.
Contains all configuration parameters for building and using dictionaries.
Implementations§
Source§impl JsMetadata
impl JsMetadata
Sourcepub fn new(options: Option<MetadataOptions>) -> Self
pub fn new(options: Option<MetadataOptions>) -> Self
Creates a new Metadata with optional configuration.
§Arguments
options- Optional configuration object. When omitted, all defaults are used.
Sourcepub fn create_default() -> Self
pub fn create_default() -> Self
Creates a Metadata with all default values.
§Returns
A Metadata instance with default configuration.
Sourcepub fn from_json_file(path: String) -> Result<Self>
pub fn from_json_file(path: String) -> Result<Self>
Sourcepub fn set_encoding(&mut self, encoding: String)
pub fn set_encoding(&mut self, encoding: String)
Sets the character encoding.
Sourcepub fn default_word_cost(&self) -> i32
pub fn default_word_cost(&self) -> i32
Default word cost.
Sourcepub fn set_default_word_cost(&mut self, cost: i32)
pub fn set_default_word_cost(&mut self, cost: i32)
Sets the default word cost.
Sourcepub fn default_left_context_id(&self) -> u32
pub fn default_left_context_id(&self) -> u32
Default left context ID.
Sourcepub fn set_default_left_context_id(&mut self, id: u32)
pub fn set_default_left_context_id(&mut self, id: u32)
Sets the default left context ID.
Sourcepub fn default_right_context_id(&self) -> u32
pub fn default_right_context_id(&self) -> u32
Default right context ID.
Sourcepub fn set_default_right_context_id(&mut self, id: u32)
pub fn set_default_right_context_id(&mut self, id: u32)
Sets the default right context ID.
Sourcepub fn default_field_value(&self) -> String
pub fn default_field_value(&self) -> String
Default field value for missing fields.
Sourcepub fn set_default_field_value(&mut self, value: String)
pub fn set_default_field_value(&mut self, value: String)
Sets the default field value.
Sourcepub fn flexible_csv(&self) -> bool
pub fn flexible_csv(&self) -> bool
Whether flexible CSV parsing is enabled.
Sourcepub fn set_flexible_csv(&mut self, value: bool)
pub fn set_flexible_csv(&mut self, value: bool)
Sets flexible CSV parsing.
Sourcepub fn skip_invalid_cost_or_id(&self) -> bool
pub fn skip_invalid_cost_or_id(&self) -> bool
Whether to skip entries with invalid cost or ID.
Sourcepub fn set_skip_invalid_cost_or_id(&mut self, value: bool)
pub fn set_skip_invalid_cost_or_id(&mut self, value: bool)
Sets whether to skip invalid entries.
Sourcepub fn normalize_details(&self) -> bool
pub fn normalize_details(&self) -> bool
Whether to normalize morphological details.
Sourcepub fn set_normalize_details(&mut self, value: bool)
pub fn set_normalize_details(&mut self, value: bool)
Sets whether to normalize details.
Source§impl JsMetadata
impl JsMetadata
Sourcepub fn to_lindera_metadata(metadata: &JsMetadata) -> Metadata
pub fn to_lindera_metadata(metadata: &JsMetadata) -> Metadata
Trait Implementations§
Source§impl From<JsMetadata> for Metadata
impl From<JsMetadata> for Metadata
Source§fn from(metadata: JsMetadata) -> Self
fn from(metadata: JsMetadata) -> Self
Converts to this type from the input type.
Source§impl From<Metadata> for JsMetadata
impl From<Metadata> for JsMetadata
Source§impl FromNapiMutRef for JsMetadata
impl FromNapiMutRef for JsMetadata
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for JsMetadata
impl FromNapiRef for JsMetadata
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl JavaScriptClassExt for JsMetadata
impl JavaScriptClassExt for JsMetadata
fn into_instance<'scope>( self, env: &'scope Env, ) -> Result<ClassInstance<'scope, Self>>
fn into_reference(self, env: Env) -> Result<Reference<Self>>
fn instance_of<'env, V: JsValue<'env>>(env: &Env, value: &V) -> Result<bool>
Source§impl ToNapiValue for JsMetadata
impl ToNapiValue for JsMetadata
Source§unsafe fn to_napi_value(env: napi_env, val: JsMetadata) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: JsMetadata) -> Result<napi_value>
Safety Read more
fn into_unknown(self, env: &Env) -> Result<Unknown<'_>, Error>
Source§impl TypeName for &JsMetadata
impl TypeName for &JsMetadata
Source§impl TypeName for &mut JsMetadata
impl TypeName for &mut JsMetadata
Source§impl TypeName for JsMetadata
impl TypeName for JsMetadata
Source§impl ValidateNapiValue for &JsMetadata
impl ValidateNapiValue for &JsMetadata
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut JsMetadata
impl ValidateNapiValue for &mut JsMetadata
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for JsMetadata
impl RefUnwindSafe for JsMetadata
impl Send for JsMetadata
impl Sync for JsMetadata
impl Unpin for JsMetadata
impl UnsafeUnpin for JsMetadata
impl UnwindSafe for JsMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
fn into_vec(self, env: *mut napi_env__) -> Result<Vec<*mut napi_value__>, Error>
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>
Returns the layout of the type.
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
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.