Skip to content

Commit

Permalink
Make zh and ja pull relevant optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed May 7, 2020
1 parent 696bda2 commit d9a1934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ serde_derive = "1.0.34" # First verstion to support #[serde(flatten)]
serde_json = "1"
strum = "0.16"
strum_macros = "0.16"
jieba-rs = "0.4.10"
lindera = "0.3.4"
jieba-rs = { version = "0.4.10", optional = true }
lindera = { version = "0.3.4", optional = true }

[features]
default = ["languages"]
Expand All @@ -50,5 +50,5 @@ ro = ["rust-stemmers"]
ru = ["rust-stemmers"]
sv = ["rust-stemmers"]
tr = ["rust-stemmers"]
zh = ["rust-stemmers"]
ja = ["rust-stemmers"]
zh = ["jieba-rs"]
ja = ["lindera"]
4 changes: 3 additions & 1 deletion tests/test-lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use std::path::Path;

use elasticlunr::pipeline::tokenize;
#[cfg(feature = "zh")]
use elasticlunr::pipeline::{tokenize_chinese, tokenize_japanese};
use elasticlunr::pipeline::tokenize_chinese;
#[cfg(feature = "ja")]
use elasticlunr::pipeline::tokenize_japanese;
use elasticlunr::*;
use strum::IntoEnumIterator;

Expand Down

0 comments on commit d9a1934

Please sign in to comment.