Skip to content

Commit

Permalink
Bump up version to 0.21.0 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuka authored Jan 23, 2023
1 parent c10023e commit b5560b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
30 changes: 9 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)?;
Expand Down

0 comments on commit b5560b2

Please sign in to comment.