Skip to content

Commit ceebcb7

Browse files
committed
feat: hybrid completion
Signed-off-by: wxiwnd <wxiwnd@outlook.com>
1 parent d631f7e commit ceebcb7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ fn main() {
5555
eprintln!("Usage: {} <pinyin>", args[0]);
5656
std::process::exit(1);
5757
}
58-
let han_re = regex::Regex::new(r"\p{Han}").unwrap();
5958

6059
let input: &str = &args[1];
61-
if han_re.is_match(input) {return};
6260
let notation = parse_pinyin_notation_env();
6361
let matcher = PinyinMatcher::builder(input)
6462
.pinyin_notations(notation)
@@ -68,7 +66,7 @@ fn main() {
6866
let reader = BufReader::new(stdin.lock());
6967
for line_result in reader.lines() {
7068
let candidate = line_result.unwrap().trim_end().to_string();
71-
if han_re.is_match(&candidate) && matcher.is_match(&candidate) {
69+
if matcher.is_match(&candidate) {
7270
println!("{}", candidate);
7371
}
7472
}

0 commit comments

Comments
 (0)