You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
--- /home/wzy/Desktop/ydcv.py 2022-07-23 21:36:39.586450097 +0800+++ /usr/lib/python3.10/site-packages/ydcv.py 2022-07-23 22:51:26.334572339 +0800@@ -344,6 +344,10 @@
action="store",
default="~/.ydcv_history.txt",
help="History file. Default: ~/.ydcv_history.txt")
+ parser.add_argument('--split',+ action="store_true",+ default=False,+ help="Split multi-lines input")
parser.add_argument('words',
nargs='*',
help="words to lookup, or quoted sentences to translate.")
@@ -376,12 +380,16 @@
readline.add_history(word)
else:
if options.selection:
- last = check_output(["xclip", "-o"], universal_newlines=True)+ last = check_output(["xsel", "-o"], universal_newlines=True)+ if not options._options.split:+ last = last.replace("-\n", "").replace("\n", ' ')
print("Waiting for selection>")
while True:
try:
sleep(0.1)
- curr = check_output(["xclip", "-o"], universal_newlines=True)+ curr = check_output(["xsel", "-o"], universal_newlines=True)+ if not options._options.split:+ curr = curr.replace("-\n", "").replace("\n", ' ')
if curr != last:
last = curr
if last.strip():
@@ -393,6 +401,8 @@
while True:
try:
words = input('> ')
+ if not options._options.split:+ words = words.replace("-\n", "").replace("\n", ' ')
if words.strip():
lookup_word(words)
except KeyboardInterrupt:
❯ ydcv --selection
Waiting for selection>
Some earlier results suggest that incorporating local normalization in linear block transform coding methods can improve coding performance
Translation:
* 一些早期的研究结果表明,在线性块变换编码方法中加入局部归一化可以提高编码性能
❯ ydcv --selection --split
Waiting for selection>
Some earlier results suggest
that incorporating local normalization in linear block transform coding methods can improve cod-
ing performance
Translation:
* 一些早期的结果表明
在线性分块变换编码方法中加入局部归一化可以提高编码质量
荷兰国际集团(ing)性能
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: