We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d631f7e commit ceebcb7Copy full SHA for ceebcb7
src/main.rs
@@ -55,10 +55,8 @@ fn main() {
55
eprintln!("Usage: {} <pinyin>", args[0]);
56
std::process::exit(1);
57
}
58
- let han_re = regex::Regex::new(r"\p{Han}").unwrap();
59
60
let input: &str = &args[1];
61
- if han_re.is_match(input) {return};
62
let notation = parse_pinyin_notation_env();
63
let matcher = PinyinMatcher::builder(input)
64
.pinyin_notations(notation)
@@ -68,7 +66,7 @@ fn main() {
68
66
let reader = BufReader::new(stdin.lock());
69
67
for line_result in reader.lines() {
70
let candidate = line_result.unwrap().trim_end().to_string();
71
- if han_re.is_match(&candidate) && matcher.is_match(&candidate) {
+ if matcher.is_match(&candidate) {
72
println!("{}", candidate);
73
74
0 commit comments