Skip to content

Commit

Permalink
Update Lindera to 0.12.0 (#41)
Browse files Browse the repository at this point in the history
* Update Lindera to 0.12.0

* Update CHANGES.md

* Fix lint

* Update README.md
  • Loading branch information
mosuka authored Mar 17, 2022
1 parent d2c45c7 commit 22a1fcb
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 0.12.0 (2022-03-17)
- Update Lindera to 0.12.0 #41 @mosuka

## 0.11.1 (2022-03-09)
- Update Lindera and Tantivy #37 @mosuka

Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lindera-tantivy"
version = "0.11.1"
version = "0.12.0"
edition = "2021"
description = "Lindera Tokenizer for Tantivy."
documentation = "https://docs.rs/lindera-tantivy"
Expand All @@ -22,8 +22,7 @@ cc-cedict = ["lindera/cc-cedict"] # Chinese dictionary
[dependencies]
tantivy = "0.17"

lindera = "0.11.1"
lindera-core = "0.11.1"
lindera = "0.12.0"

[dev-dependencies]
criterion = "0.3"
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following example enables IPADIC.

```
[dependencies]
lindera = { version = "0.11.1", features = ["ipadic"] }
lindera-tantivy = { version = "0.12.0", features = ["ipadic"] }
```

- ipadic: Japanese dictionary
Expand All @@ -27,10 +27,11 @@ lindera = { version = "0.11.1", features = ["ipadic"] }
use tantivy::collector::TopDocs;
use tantivy::query::QueryParser;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::{doc, Index};
use tantivy::doc;
use tantivy::Index;

use lindera::tokenizer::{TokenizerConfig, UserDictionaryType, DictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_tantivy::tokenizer::LinderaTokenizer;

fn main() -> tantivy::Result<()> {
Expand Down
7 changes: 2 additions & 5 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ use criterion::{criterion_group, criterion_main};
#[cfg(feature = "ipadic")]
fn bench_indexing(c: &mut Criterion) {
use tantivy::doc;
use tantivy::schema::IndexRecordOption;
use tantivy::schema::Schema;
use tantivy::schema::TextFieldIndexing;
use tantivy::schema::TextOptions;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::Index;

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera_tantivy::tokenizer::LinderaTokenizer;

// create schema builder
Expand Down
5 changes: 3 additions & 2 deletions examples/cc-cedict_example.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#[cfg(feature = "cc-cedict")]
fn main() -> tantivy::Result<()> {
use tantivy::collector::TopDocs;
use tantivy::doc;
use tantivy::query::QueryParser;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::{doc, Index};
use tantivy::Index;

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera_tantivy::tokenizer::LinderaTokenizer;

// create schema builder
Expand Down
5 changes: 3 additions & 2 deletions examples/ipadic_example.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#[cfg(feature = "ipadic")]
fn main() -> tantivy::Result<()> {
use tantivy::collector::TopDocs;
use tantivy::doc;
use tantivy::query::QueryParser;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::{doc, Index};
use tantivy::Index;

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera_tantivy::tokenizer::LinderaTokenizer;

// create schema builder
Expand Down
5 changes: 3 additions & 2 deletions examples/ko-dic_example.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#[cfg(feature = "ko-dic")]
fn main() -> tantivy::Result<()> {
use tantivy::collector::TopDocs;
use tantivy::doc;
use tantivy::query::QueryParser;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::{doc, Index};
use tantivy::Index;

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera_tantivy::tokenizer::LinderaTokenizer;

// create schema builder
Expand Down
5 changes: 3 additions & 2 deletions examples/unidic_example.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#[cfg(feature = "unidic")]
fn main() -> tantivy::Result<()> {
use tantivy::collector::TopDocs;
use tantivy::doc;
use tantivy::query::QueryParser;
use tantivy::schema::{IndexRecordOption, Schema, TextFieldIndexing, TextOptions};
use tantivy::{doc, Index};
use tantivy::Index;

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::{Mode, Penalty};
use lindera_tantivy::tokenizer::LinderaTokenizer;

// create schema builder
Expand Down
3 changes: 2 additions & 1 deletion src/stream.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use lindera::tokenizer::Token as LToken;
use tantivy::tokenizer::{Token, TokenStream};

use lindera::tokenizer::Token as LToken;

pub struct LinderaTokenStream<'a> {
pub result: Vec<LToken<'a>>,
pub index: usize,
Expand Down
5 changes: 2 additions & 3 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tantivy::tokenizer::{BoxTokenStream, Tokenizer};

use lindera::tokenizer::{Tokenizer as LTokenizer, TokenizerConfig};
use lindera_core::LinderaResult;
use lindera::LinderaResult;

use crate::stream::LinderaTokenStream;

Expand Down Expand Up @@ -53,9 +53,8 @@ impl Tokenizer for LinderaTokenizer {
mod tests {
use tantivy::tokenizer::{BoxTokenStream, Token, Tokenizer};

use lindera::mode::{Mode, Penalty};
use lindera::tokenizer::{DictionaryType, TokenizerConfig, UserDictionaryType};
use lindera_core::viterbi::Mode;
use lindera_core::viterbi::Penalty;

use crate::tokenizer::LinderaTokenizer;

Expand Down

0 comments on commit 22a1fcb

Please sign in to comment.