pub trait OovProviderPlugin: Sync + Send {
// Required methods
fn set_up(
&mut self,
settings: &Value,
config: &Config,
grammar: &mut Grammar<'_>,
) -> SudachiResult<()>;
fn provide_oov(
&self,
input_text: &InputBuffer,
offset: usize,
other_words: CreatedWords,
result: &mut Vec<Node>,
) -> SudachiResult<usize>;
}
Expand description
Trait of plugin to provide oov node during tokenization
Required Methods§
sourcefn set_up(
&mut self,
settings: &Value,
config: &Config,
grammar: &mut Grammar<'_>,
) -> SudachiResult<()>
fn set_up( &mut self, settings: &Value, config: &Config, grammar: &mut Grammar<'_>, ) -> SudachiResult<()>
Loads necessary information for the plugin
sourcefn provide_oov(
&self,
input_text: &InputBuffer,
offset: usize,
other_words: CreatedWords,
result: &mut Vec<Node>,
) -> SudachiResult<usize>
fn provide_oov( &self, input_text: &InputBuffer, offset: usize, other_words: CreatedWords, result: &mut Vec<Node>, ) -> SudachiResult<usize>
Generate a list of oov nodes offset - char idx
Trait Implementations§
source§impl PluginCategory for dyn OovProviderPlugin
impl PluginCategory for dyn OovProviderPlugin
source§type BoxType = Box<dyn OovProviderPlugin + Sync + Send>
type BoxType = Box<dyn OovProviderPlugin + Sync + Send>
Boxed type of the plugin. Should be Box.
source§type InitFnType = unsafe fn() -> Result<<dyn OovProviderPlugin as PluginCategory>::BoxType, SudachiError>
type InitFnType = unsafe fn() -> Result<<dyn OovProviderPlugin as PluginCategory>::BoxType, SudachiError>
Type of the initialization function.
It must take 0 arguments and return
SudachiResult<Self::BoxType>
.source§fn configurations(cfg: &Config) -> &[Value]
fn configurations(cfg: &Config) -> &[Value]
Extract plugin configurations from the config