Skip to content

Commit

Permalink
Bump dependencies and fix test (#30)
Browse files Browse the repository at this point in the history
* Bump dependencies and fix test

* Update Cargo.toml
  • Loading branch information
jackyu1996 authored Feb 12, 2023
1 parent 05144bb commit b7c56d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
name = "cang-jie"
version = "0.14.0"
version = "0.15.0"
authors = ["DCjanus <[email protected]>"]
edition = "2018"
edition = "2021"
description = "A Chinese tokenizer for tantivy"
license = "MIT"
repository = "https://github.com/DCjanus/cang-jie"
readme = "README.MD"
keywords = ["search", "tokenizer", "Chinese", "tantivy"]

[dependencies]
tantivy = "0.18.0"
jieba-rs = { version = "0.6.6", default-features = false }
tantivy = "0.19.1"
jieba-rs = { version = "0.6.7", default-features = false }
log = "0.4.17"

[dev-dependencies]
flexi_logger = "0.22.5"
time = "0.3.11"
flexi_logger = "0.25.1"

9 changes: 4 additions & 5 deletions tests/unicode_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use flexi_logger::{Logger, Record};
use jieba_rs::Jieba;
use std::{collections::HashSet, io, iter::FromIterator, sync::Arc};
use tantivy::{collector::TopDocs, doc, query::QueryParser, schema::*, Index};
use time::format_description::well_known::Rfc3339;

#[test]
fn full_test_unicode_split() -> tantivy::Result<()> {
Expand All @@ -29,9 +28,9 @@ fn full_test_unicode_split() -> tantivy::Result<()> {
index.tokenizers().register(CANG_JIE, tokenizer()); // Build cang-jie Tokenizer

let mut index_writer = index.writer(50 * 1024 * 1024)?;
index_writer.add_document(doc! { title => "南京长江大桥" });
index_writer.add_document(doc! { title => "这个是长江" });
index_writer.add_document(doc! { title => "这个是南京长" });
index_writer.add_document(doc! { title => "南京长江大桥" })?;
index_writer.add_document(doc! { title => "这个是长江" })?;
index_writer.add_document(doc! { title => "这个是南京长" })?;
index_writer.commit()?;

let reader = index.reader()?;
Expand Down Expand Up @@ -76,7 +75,7 @@ pub fn logger_format(
write!(
w,
"[{}] {} [{}:{}] {}",
now.now().format(&Rfc3339).unwrap(),
now.now().format("%Y-%m-%d %H:%M:%S %:z"),
record.level(),
record.module_path().unwrap_or("<unnamed>"),
record.line().unwrap_or(0),
Expand Down

0 comments on commit b7c56d4

Please sign in to comment.