pub trait InputTextPlugin: Sync + Send {
    // Required methods
    fn set_up(
        &mut self,
        settings: &Value,
        config: &Config,
        grammar: &Grammar<'_>,
    ) -> SudachiResult<()>;
    fn rewrite_impl<'a>(
        &'a self,
        input: &InputBuffer,
        edit: InputEditor<'a>,
    ) -> SudachiResult<InputEditor<'a>>;
    // Provided methods
    fn uses_chars(&self) -> bool { ... }
    fn rewrite(&self, input: &mut InputBuffer) -> SudachiResult<()> { ... }
}Expand description
Trait of plugin to modify the input text before tokenization
Required Methods§
Sourcefn set_up(
    &mut self,
    settings: &Value,
    config: &Config,
    grammar: &Grammar<'_>,
) -> SudachiResult<()>
 
fn set_up( &mut self, settings: &Value, config: &Config, grammar: &Grammar<'_>, ) -> SudachiResult<()>
Loads necessary information for the plugin
Sourcefn rewrite_impl<'a>(
    &'a self,
    input: &InputBuffer,
    edit: InputEditor<'a>,
) -> SudachiResult<InputEditor<'a>>
 👎Deprecated: call rewrite instead
fn rewrite_impl<'a>( &'a self, input: &InputBuffer, edit: InputEditor<'a>, ) -> SudachiResult<InputEditor<'a>>
Actual implementation of rewriting. Call apply_rewrite instead.
Provided Methods§
Sourcefn uses_chars(&self) -> bool
 
fn uses_chars(&self) -> bool
Whether the rewrite process uses chars
Sourcefn rewrite(&self, input: &mut InputBuffer) -> SudachiResult<()>
 
fn rewrite(&self, input: &mut InputBuffer) -> SudachiResult<()>
Perform rewrites
Trait Implementations§
Source§impl PluginCategory for dyn InputTextPlugin
 
impl PluginCategory for dyn InputTextPlugin
Source§type BoxType = Box<dyn InputTextPlugin + Send + Sync>
 
type BoxType = Box<dyn InputTextPlugin + Send + Sync>
Boxed type of the plugin. Should be Box. 
Source§type InitFnType = unsafe fn() -> Result<<dyn InputTextPlugin as PluginCategory>::BoxType, SudachiError>
 
type InitFnType = unsafe fn() -> Result<<dyn InputTextPlugin 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