ecdict 1.2 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ecdict +16 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 450409babed4eef94062a845a4512ae333460f0cf61712a1adff7b8dbf3f4efa
|
4
|
+
data.tar.gz: 2e1e85623352e3659cc612ff9261876ad23b0bc993b5f3499f03054a988aa845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4adfb282ca00ddff850f02c6e7b133c802b3c7a3958f94465349be43deab3c4a4805994cadbd7eb2ca2aea3e4907b04b7263a893da8d0cc1ce54863db97712bb
|
7
|
+
data.tar.gz: 27a3a238959cb00294a0a54d5d49c44975762ac009852cc87e68df151495742bfe8d1f41107f6cf1b94dd1a24de9092fdb46db018a54cb931f73bcbbdf01d464
|
data/bin/ecdict
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# File : ecdict.rb
|
4
4
|
# Authors : ccmywish <ccmywish@qq.com>
|
5
5
|
# Created on : <2020-10-18>
|
6
|
-
# Last modified : <2022-03-
|
6
|
+
# Last modified : <2022-03-25>
|
7
7
|
#
|
8
8
|
# ecdict:
|
9
9
|
#
|
@@ -33,7 +33,7 @@ ECDICT_RAW_DATA = File.join(ECDICT_STORAGE, 'ecdict-csv.7z')
|
|
33
33
|
ECDictDB = File.join(ECDICT_STORAGE, 'ecdict.db')
|
34
34
|
ECDictCSV = File.join(ECDICT_STORAGE, 'ecdict.csv')
|
35
35
|
|
36
|
-
ECDICT_GEM_VERSION = "1.2"
|
36
|
+
ECDICT_GEM_VERSION = "1.2.1"
|
37
37
|
|
38
38
|
# 这个版本是我从上游下载的CSV后自己压缩的
|
39
39
|
# 这个文件的实际创建日期(上游作者创建)是2017/06/04
|
@@ -451,7 +451,7 @@ def chinese_search(cn_word, support_phrase: false)
|
|
451
451
|
end
|
452
452
|
end
|
453
453
|
if rows.empty?
|
454
|
-
puts "ecdict:
|
454
|
+
puts "ecdict: 抱歉,未找到与之相关的英文"
|
455
455
|
close_db
|
456
456
|
return
|
457
457
|
else
|
@@ -467,12 +467,14 @@ def chinese_search(cn_word, support_phrase: false)
|
|
467
467
|
next if trans.include?("\r\n")
|
468
468
|
next if trans.include?("\n")
|
469
469
|
|
470
|
-
|
470
|
+
|
471
471
|
if !support_phrase
|
472
|
+
# 不要搜索词组
|
472
473
|
next if en_word.include?(' ')
|
474
|
+
# 不要搜索连字词
|
475
|
+
next if en_word.include?('-')
|
473
476
|
end
|
474
|
-
|
475
|
-
next if en_word.include?('-')
|
477
|
+
|
476
478
|
|
477
479
|
# filter
|
478
480
|
# "[网络] 微软,认证专家;微软认证产品专家;微软专家认证"
|
@@ -506,8 +508,14 @@ def chinese_search(cn_word, support_phrase: false)
|
|
506
508
|
if found_a_word
|
507
509
|
puts
|
508
510
|
else
|
509
|
-
|
510
|
-
|
511
|
+
|
512
|
+
if !support_phrase
|
513
|
+
puts "ecdict: 抱歉,为了防止显示内容过多,已将可能的答案过滤了"
|
514
|
+
puts "ecdict: 您可尝试使用`ecdict -cp`来搜索短语,扩大搜索范围"
|
515
|
+
else
|
516
|
+
puts "ecdict: 抱歉,未找到与之相关的英文"
|
517
|
+
end
|
518
|
+
|
511
519
|
end
|
512
520
|
# end of else
|
513
521
|
end
|