pub struct SystemDictionaryBuilder {}
Expand description

Builder for Dictionary from system lexicon entries.

Implementations§

source§

impl SystemDictionaryBuilder

source

pub fn from_readers<S, C, P, U>( system_lexicon_rdr: S, connector_rdr: C, char_prop_rdr: P, unk_handler_rdr: U ) -> Result<Dictionary>where S: Read, C: Read, P: Read, U: Read,

Creates a new Dictionary from readers of system entries in the MeCab format.

Consider to use from_readers_with_bigram_info() if you want to store a dictionary with smaller memory.

Arguments
  • system_lexicon_rdr: A reader of a lexicon file *.csv.
  • connector_rdr: A reader of matrix file matrix.def.
  • char_prop_rdr: A reader of character definition file char.def.
  • unk_handler: A reader of unknown definition file unk.def.
Errors

VibratoError is returned when an input format is invalid.

source

pub fn from_readers_with_bigram_info<S, R, L, C, P, U>( system_lexicon_rdr: S, bigram_right_rdr: R, bigram_left_rdr: L, bigram_cost_rdr: C, char_prop_rdr: P, unk_handler_rdr: U, dual_connector: bool ) -> Result<Dictionary>where S: Read, R: Read, L: Read, C: Read, P: Read, U: Read,

Creates a new memory-efficient Dictionary from readers of system entries.

This function implements a matrix of connection costs in a compact format. Compared to a dictionary generated by from_readers(), one generated by this function can save memory consumption, although analysis speed can be slower.

Arguments
  • system_lexicon_rdr: A reader of a lexicon file *.csv.
  • bigram_right_rdr: A reader of bi-gram info associated with right IDs bigram.right.
  • bigram_left_rdr: A reader of bi-gram info associated with left IDs bigram.left.
  • bigram_cost_rdr: A reader of a bi-gram cost file bigram.cost.
  • char_prop_rdr: A reader of character definition file char.def.
  • unk_handler: A reader of unknown definition file unk.def.
  • dual_connector: If true, the dictionary controls speed reduction.
Errors

VibratoError is returned when an input format is invalid.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendAlias for T

§

impl<T> SendSyncUnwindSafe for Twhere T: Send + Sync + UnwindSafe + ?Sized,

§

impl<T> SyncAlias for T