pub struct JapaneseDictionary { /* private fields */ }Implementations§
Source§impl JapaneseDictionary
impl JapaneseDictionary
Sourcepub fn from_cfg(cfg: &Config) -> SudachiResult<JapaneseDictionary>
pub fn from_cfg(cfg: &Config) -> SudachiResult<JapaneseDictionary>
Creates a dictionary from the specified configuration Dictionaries will be read from disk
Sourcepub fn from_cfg_storage(
cfg: &Config,
storage: SudachiDicData,
) -> SudachiResult<JapaneseDictionary>
pub fn from_cfg_storage( cfg: &Config, storage: SudachiDicData, ) -> SudachiResult<JapaneseDictionary>
Creates a dictionary from the specified configuration and storage
Sourcepub fn from_cfg_storage_with_embedded_chardef(
cfg: &Config,
storage: SudachiDicData,
) -> SudachiResult<JapaneseDictionary>
👎Deprecated since 0.7.0: embedded resources are now resolved through Config; use from_cfg_storage instead
pub fn from_cfg_storage_with_embedded_chardef( cfg: &Config, storage: SudachiDicData, ) -> SudachiResult<JapaneseDictionary>
embedded resources are now resolved through Config; use from_cfg_storage instead
Creates a dictionary from the specified configuration and storage, with embedded character definition
pub fn from_cfg_storage_chardef( cfg: &Config, storage: SudachiDicData, chardef: CharacterCategory, ) -> SudachiResult<JapaneseDictionary>
Sourcepub fn lexicon(&self) -> &LexiconSet<'_>
pub fn lexicon(&self) -> &LexiconSet<'_>
Returns lexicon with the correct lifetime
pub fn description(&self) -> &Description
Sourcepub fn entries(
&self,
) -> impl Iterator<Item = SudachiResult<SingleMorpheme<&Self>>> + '_
pub fn entries( &self, ) -> impl Iterator<Item = SudachiResult<SingleMorpheme<&Self>>> + '_
Iterates over dictionary entries as standalone morphemes.
This corresponds to public lexicon CSV rows. It includes entries that are referred to from other entries, such as split or constituent units, even when they are not indexed for normal lookup. Internal entries automatically generated for literal normalized forms are not exposed. The iteration order is not part of the public contract.
Sourcepub fn entries_subset(
&self,
subset: InfoSubset,
) -> impl Iterator<Item = SudachiResult<SingleMorpheme<&Self>>> + '_
pub fn entries_subset( &self, subset: InfoSubset, ) -> impl Iterator<Item = SudachiResult<SingleMorpheme<&Self>>> + '_
Iterates over dictionary entries, loading only the requested word-info fields.
Sourcepub fn lookup_all_entries(
&self,
surface: &str,
) -> SudachiResult<Vec<SingleMorpheme<&Self>>>
pub fn lookup_all_entries( &self, surface: &str, ) -> SudachiResult<Vec<SingleMorpheme<&Self>>>
Looks up all dictionary entries whose normalized surface matches surface.
This normalizes the query using dictionary input-text plugins and scans
every public lexicon entry. It can find entries that are not indexed for
normal lookup. Use lookup for normal indexed lookup.
Sourcepub fn lookup_all_entries_subset(
&self,
surface: &str,
subset: InfoSubset,
) -> SudachiResult<Vec<SingleMorpheme<&Self>>>
pub fn lookup_all_entries_subset( &self, surface: &str, subset: InfoSubset, ) -> SudachiResult<Vec<SingleMorpheme<&Self>>>
Looks up all matching dictionary entries, loading only requested fields.
Sourcepub fn oov_morpheme(
&self,
pos_id: u16,
surface: &str,
) -> SudachiResult<SingleMorpheme<&Self>>
pub fn oov_morpheme( &self, pos_id: u16, surface: &str, ) -> SudachiResult<SingleMorpheme<&Self>>
Creates an out-of-vocabulary standalone morpheme from the pos id and the surface.
Uses the surface for reading, normalized, and dictionary forms.
Sourcepub fn oov_morpheme_with_forms(
&self,
pos_id: u16,
surface: &str,
reading: &str,
normalized_form: &str,
dictionary_form: &str,
) -> SudachiResult<SingleMorpheme<&Self>>
pub fn oov_morpheme_with_forms( &self, pos_id: u16, surface: &str, reading: &str, normalized_form: &str, dictionary_form: &str, ) -> SudachiResult<SingleMorpheme<&Self>>
Creates an out-of-vocabulary standalone morpheme from the pos id and string forms.
Trait Implementations§
Source§impl DescriptionAccess for JapaneseDictionary
impl DescriptionAccess for JapaneseDictionary
fn description(&self) -> &Description
Source§impl DictionaryAccess for JapaneseDictionary
impl DictionaryAccess for JapaneseDictionary
fn grammar(&self) -> &Grammar<'_>
fn input_text_plugins(&self) -> &[Box<dyn InputTextPlugin + Sync + Send>]
fn oov_provider_plugins(&self) -> &[Box<dyn OovProviderPlugin + Sync + Send>]
fn path_rewrite_plugins(&self) -> &[Box<dyn PathRewritePlugin + Sync + Send>]
Source§impl LexiconAccess for JapaneseDictionary
impl LexiconAccess for JapaneseDictionary
fn lexicon(&self) -> &LexiconSet<'_>
Auto Trait Implementations§
impl !RefUnwindSafe for JapaneseDictionary
impl !UnwindSafe for JapaneseDictionary
impl Freeze for JapaneseDictionary
impl Send for JapaneseDictionary
impl Sync for JapaneseDictionary
impl Unpin for JapaneseDictionary
impl UnsafeUnpin for JapaneseDictionary
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
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 more