pub struct TrainerConfig { /* private fields */ }Expand description
Configuration for training.
Implementations§
Source§impl TrainerConfig
impl TrainerConfig
Sourcepub fn system_lexicon(&self) -> &PrefixDictionary
pub fn system_lexicon(&self) -> &PrefixDictionary
Access system lexicon for morphological analysis
Sourcepub fn dict(&self) -> &Dictionary
pub fn dict(&self) -> &Dictionary
Access dictionary (for compatibility)
Sourcepub fn unk_handler(&self) -> &UnknownDictionary
pub fn unk_handler(&self) -> &UnknownDictionary
Access unknown word handler for out-of-vocabulary processing
Source§impl TrainerConfig
impl TrainerConfig
Sourcepub fn from_readers<R1, R2, R3, R4, R5>(
lexicon_rdr: R1,
char_prop_rdr: R2,
unk_handler_rdr: R3,
feature_templates_rdr: R4,
rewrite_rules_rdr: R5,
) -> Result<Self>
pub fn from_readers<R1, R2, R3, R4, R5>( lexicon_rdr: R1, char_prop_rdr: R2, unk_handler_rdr: R3, feature_templates_rdr: R4, rewrite_rules_rdr: R5, ) -> Result<Self>
Creates a new trainer configuration from readers.
§Arguments
lexicon_rdr- Reader for the seed lexicon file (lex.csv)char_prop_rdr- Reader for the character property file (char.def)unk_handler_rdr- Reader for the unknown word file (unk.def)feature_templates_rdr- Reader for the feature templates file (feature.def)rewrite_rules_rdr- Reader for the rewrite rules file (rewrite.def)
Sourcepub fn surface_features(&self) -> &HashMap<String, String>
pub fn surface_features(&self) -> &HashMap<String, String>
Get the surface features mapping
Sourcepub fn user_lexicon(&self) -> &HashMap<String, String>
pub fn user_lexicon(&self) -> &HashMap<String, String>
Get the user lexicon mapping.
This map only feeds TrainerConfig::get_features; dictionary export
reads the user entries loaded via Model::read_user_lexicon instead
(#981).
§戻り値
The surface-to-features map.
Sourcepub fn add_user_lexicon_entry(&mut self, surface: String, features: String)
👎Deprecated since 5.3.0: this map only feeds TrainerConfig::get_features; dictionary export reads user entries loaded via Model::read_user_lexicon
pub fn add_user_lexicon_entry(&mut self, surface: String, features: String)
this map only feeds TrainerConfig::get_features; dictionary export reads user entries loaded via Model::read_user_lexicon
Add user lexicon entry (user dictionary support).
§引数
surface- Surface form of the entry.features- Comma-joined feature string of the entry.
Sourcepub fn get_features(&self, surface: &str) -> Option<String>
pub fn get_features(&self, surface: &str) -> Option<String>
Get features for a given surface form
Sourcepub fn load_user_lexicon_from_content(&mut self, content: &str) -> Result<()>
👎Deprecated since 5.3.0: this map only feeds TrainerConfig::get_features; dictionary export reads user entries loaded via Model::read_user_lexicon
pub fn load_user_lexicon_from_content(&mut self, content: &str) -> Result<()>
this map only feeds TrainerConfig::get_features; dictionary export reads user entries loaded via Model::read_user_lexicon
Auto Trait Implementations§
impl Freeze for TrainerConfig
impl RefUnwindSafe for TrainerConfig
impl Send for TrainerConfig
impl Sync for TrainerConfig
impl Unpin for TrainerConfig
impl UnsafeUnpin for TrainerConfig
impl UnwindSafe for TrainerConfig
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.