pub struct Chanoma { /* private fields */ }
Expand description

正規化処理のメイン構造体です。

Implementations

Chanoma 構造体を初期化します。

use chanoma::Chanoma;

let chanoma = Chanoma::new();

特定のファイルパスに配置された設定ファイルを読み込んで Chanoma 構造体を初期化します。

use chanoma::Chanoma;

let chanoma = Chanoma::load_rc();

ファイルパスの設定ファイルを読み込んで Chanoma 構造体を初期化します。

use chanoma::Chanoma;

let chanoma = Chanoma::from_config_file("/path/to/config.csv");

プリセットされた設定を使用するように Chanoma 構造体を初期化します。

use chanoma::Chanoma;

let chanoma = Chanoma::preset();

プリセットされた設定を使用します。

use chanoma::Chanoma;

let mut chanoma = Chanoma::new();
chanoma.use_preset();

neologdn の同様の結果になる設定を使用するように Chanoma 構造体を初期化します。

use chanoma::Chanoma;

let chanoma = Chanoma::neologdn();

neologdn の同様の結果になる設定を使用します。

use chanoma::Chanoma;

let mut chanoma = Chanoma::new();
chanoma.use_neologdn();

正規化処理を実行します。

use chanoma::Chanoma;

let chanoma = Chanoma::preset();
assert_eq!(chanoma.normalize("チャノマ"), "チャノマ");

正規化処理を実行します。 処理の途中経過をスタックして保持しています。

use chanoma::Chanoma;

let chanoma = Chanoma::preset();
assert_eq!(chanoma.normalize_with_positions("チャノマ").text(), "チャノマ");

一文字から一文字の置換テーブルを定義した Table 構造体を使用するように Chanoma 構造体を初期化します。

use chanoma::{Chanoma, TableBuilder};

let mut table_builder = TableBuilder::new();
table_builder.preset();
let chanoma = Chanoma::from_table(table_builder.build());

一文字から一文字の置換テーブルを定義した Table 構造体を使用します。

use chanoma::{Chanoma, TableBuilder};

let mut table_builder = TableBuilder::new();
table_builder.preset();
let mut chanoma = Chanoma::new();
chanoma.add_table(table_builder.build());

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.