From b5560b25433089a66c56dbf09e3b6e62da634d18 Mon Sep 17 00:00:00 2001 From: Minoru Osuka Date: Mon, 23 Jan 2023 22:47:44 +0900 Subject: [PATCH] Bump up version to 0.21.0 (#70) --- Cargo.toml | 2 +- README.md | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9252749..7cfa6df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lindera-tantivy" -version = "0.20.0" +version = "0.21.0" edition = "2021" description = "Lindera Tokenizer for Tantivy." documentation = "https://docs.rs/lindera-tantivy" diff --git a/README.md b/README.md index b632ed3..1179d68 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,15 @@ lindera-tantivy = { version = "0.12.0", features = ["ipadic"] } ### Basic example ```rust -use lindera_tantivy::mode::Mode; -use lindera_tantivy::tokenizer::{ - DictionaryConfig, DictionaryKind, LinderaTokenizer, TokenizerConfig, +use tantivy::{ + collector::TopDocs, + doc, + query::QueryParser, + schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions}, + Index, }; -use tantivy::collector::TopDocs; -use tantivy::doc; -use tantivy::query::QueryParser; -use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions}; -use tantivy::Index; + +use lindera_tantivy::tokenizer::LinderaTokenizer; fn main() -> tantivy::Result<()> { // create schema builder @@ -80,22 +80,10 @@ fn main() -> tantivy::Result<()> { // create index on memory let index = Index::create_in_ram(schema.clone()); - let dictionary = DictionaryConfig { - kind: DictionaryKind::IPADIC, - path: None, - }; - - let config = TokenizerConfig { - dictionary, - user_dictionary: None, - mode: Mode::Normal, - with_details: false, - }; - // register Lindera tokenizer index .tokenizers() - .register("lang_ja", LinderaTokenizer::from_config(config).unwrap()); + .register("lang_ja", LinderaTokenizer::default()); // create index writer let mut index_writer = index.writer(50_000_000)?;