进来遇到很多英语生词,工具书上给的解释错误百出,而很多在线词典不但可以给出某个单词的解释,而且有大量的示例,因此猜想利用在线词典批量查询这些单词。怎么实现呢?

首要问题是如何自动获取某个单词的解释。搜索之后,发现可以用curl实现,如

curl -s "http://www.google.com/dictionary?aq=f&langpair=en|en&q="$1"&hl=en" | html2text -nobs | sed '1,/^ *Dictionary/]/d' | head -n -5 | less

 

请参见http://ubuntuforums.org/showthread.php?t=1591389 和 http://stackoverflow.com/questions/1617152/using-google-as-a-dictionary-lookup-via-bash-how-can-one-grab-the-first-definiti

 

试过Google Dictionary之后发现, curl下来的网页用html2text转换时会报错:Input recoding failed due to invalid input sequence. 尝试了Python版的html2text之后,依然有大量的javascript和HTML代码残留。于是转而求助于百度词典——因为百度词典的搜索结果中没有Javascript语句,html2text一般可以完美转换。

 

转换完之后的文件如下,编码为UTF-8.

�新闻   网页   贴吧   知道   MP3   图片   视频   词典   
            [antiseptic                                ] 设置 | 帮助
               [查百度词典]   
                                     把百度设为首页
语法标注解释 antiseptic英音:[,ænti'septik]美音:[,æntə'sɛptɪk]
 
*****   *****
**** 以下结果由[bddict/source/img/logo.gif]译典通提供词典解释 ****
形容词 a.
1.
抗菌的,防腐的
2.
使用抗菌剂的,使用防腐剂的
antiseptic treatment
防腐处理
3.
未受感染的,无菌的,消过毒的
The technician had on an antiseptic white jacket.
那个技术员穿着消毒白色夹克。
4.
非常整洁的
5.
冷淡的,缺乏热情的
He nodded an antiseptic greeting.
他冷冷地点头打了个招呼。
名词 n.
1.
抗菌剂,防腐剂[C]
**** 以下结果来自互联网网络释义 ****
antiseptic
1.
防腐剂/消毒药
大学英语相似词辨析(13):ante-,a...
antiseptic 防腐剂/消毒药
http://www.english-ex...
2.
防霉剂
北京译邦达翻译公司-2008 Januar...
防霉剂 antiseptic
http://www.t-bond.com...
3.
防腐的;防腐剂
石油英语|能源动力行业英语第1521页
antiseptic防腐的;防腐剂
http://www.b2b99.com/...
4.
抗菌剂, 防腐剂
SAT化学词汇表Chapter 6_SAT...
antiseptic抗菌剂, 防腐剂
http://www.24en.com/s...
Antiseptic
1.
防腐剂
词博英语社区(生物词汇 A-F (1)[c...
Antiseptic 防腐剂
http://www.cibo.biz/f...
 显示更多网络释义结果
©2011 Baidu 此内容系百度根据您的指令自动搜索的结果,不代表百度赞成被搜索网站的内容或立场
[http://c.baidu.com/c.gif?t=0&q=antiseptic&p=0&pn=0]
      [wd                  ] [s]
**** 搜索框提示 ****
*** 是否希望搜索汉字和英语时显示搜索框提示 ***
 #显示 o不显示
[Unknown INPUT type]

 

 

显然上面的内容是不便于阅读的。为了提取有用信息,需要对上面的内容进行处理——下面的脚本参考了http://blog.csdn.net/jallin2001/archive/2009/11/13/4808618.aspx

 

#!/usr/bin/perl -w
############### censor.pl #################
# Handle the explanations got from online dictionary.
# Inputs:
#	ARGV[0] -- temparory file containning the explanations
#	ARGV[1] -- keyword
############################################
use strict;
use Encode;
my $syntax = Encode::decode('utf8', '语法标注解释 ');
my $internet = Encode::decode('utf8', '以下结果来自互联网网络释义');
my $yingyin = Encode::decode('utf8', '英音');
my $meiyin = Encode::decode('utf8', '美音');
my $write_flag=0;
open(EXP,$ARGV[0]);
while (my $nextline=<EXP>) {
	chomp($nextline);
	$nextline = Encode::decode('utf8', $nextline);
	if ($nextline =~ m/.*$syntax.*/) {
		$write_flag=1;
		$nextline =~ s/$syntax//;
	} elsif ($nextline =~ m/.*$internet.*/) {
		$write_flag=0;
	}
			
	if ($write_flag eq 1) {
		if ($nextline !~ m/.*/*/*/*/*.*/) { # Excluse lines containning ****
			# Add a space between the keyword and 英音/美音
			$nextline =~ s/$ARGV[1]([$yingyin|$meiyin])/$ARGV[1] $1/; 
			print encode("utf8",$nextline),"/r/n"; # In perl, /r/n is needed to add a new line
		}
	}
}

运行上面的脚本后,可以得到如下的输出:

antiseptic 英音:[,ænti'septik]美音:[,æntə'sɛptɪk]
 
形容词 a.
1.
抗菌的,防腐的
2.
使用抗菌剂的,使用防腐剂的
antiseptic treatment
防腐处理
3.
未受感染的,无菌的,消过毒的
The technician had on an antiseptic white jacket.
那个技术员穿着消毒白色夹克。
4.
非常整洁的
5.
冷淡的,缺乏热情的
He nodded an antiseptic greeting.
他冷冷地点头打了个招呼。
名词 n.
1.
抗菌剂,防腐剂[C]

 

另外,如果要自动化查询一批英文单词,可以把它们写到一个文件中,然后用下面的脚本进行自动查询

#!/bin/bash
# Command line look up using Google's define feature - command line dictionary
WORDS=$(cat ./words)
for word in $WORDS
do
#	word=$1
	#curl -s -A 'Mozilla/4.0'  'http://www.google.com/dictionary?langpair=zh-CN|en&hl=en&aq=f&q='$word >> test.html
	curl -s -A 'Mozilla/4.0' "http://dict.baidu.com/s?tn=dict&wd="$word | html2text > tmp 2>/dev/null
	echo "------------------ $word -------------------" >> mywords
	./censor.pl tmp $word >> mywords
	rm -f tmp
done

 

Update 2011-01-02:

 

终于找到了查询Google Dictionary的一种方法。

Google Dictionary对于单词abandon的解释可以利用URL:http://www.google.com/dictionary?langpair=en|zh-CN&q=abandon&hl=en&aq=f 得到,而网页的信息如下:

 

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<mce:script type="text/javascript"><!--
 
(function(){function a(d){this.t={};this.tick=function(e,f,b){b=b?b:(new Date).getTime();this.t[e]=[b,f]};this.tick("start",null,d)}var c=new a;window.jstiming={Timer:a,load:c};try{var g=null;if(window.chrome&&window.chrome.csi)g=Math.floor(window.chrome.csi().pageT);if(g==null)if(window.gtbExternal)g=window.gtbExternal.pageT();if(g==null)if(window.external)g=window.external.pageT;if(g)window.jstiming.pt=g}catch(h){};})();
// --></mce:script> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<meta name="keywords" content="dictionary, dict, language, translate, translation, define, definition, glossary, online dictionary, language tool, multilingual dictionary of abandon , Arabic, Bengali, Bulgarian, Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Dutch, English, Finnish, French, German, Greek, Gujarati, Hebrew, Hindi, Italian, Kannada, Korean, Malayalam, Marathi, Portuguese, Russian, Serbian, Spanish, Tamil, Telugu, Thai"> 
<meta name="description" content="abandon : (不顾责任、义务等)离弃,遗弃,抛弃, 不得已而放弃;舍弃, 停止(支持或帮助);放弃(信念), 中止;放弃;不再有, 陷入,沉湎于(某种情感), 放任;放纵 - Google's free online dictionary service."> 
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> 
<link rel="canonical" href="/dictionary?hl=en&sl=en&tl=zh-CN&q=abandon" mce_href="dictionary?hl=en&sl=en&tl=zh-CN&q=abandon"> 
<title> 
abandon in Chinese (Simplified) - Google Dictionary
</title> 
<link rel="stylesheet" href="/dictionary/css/google-common_post20090706.css" mce_href="dictionary/css/google-common_post20090706.css" type="text/css"> 
<mce:style type="text/css"><!--
  
  #gbar,#guser{font-size:13px;padding-right:1px;padding-top:2px !important}#gbar{padding-left:1px;float:left;height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbs,.gbm{background:#fff;left:0;position:absolute;text-align:left;visibility:hidden;z-index:1000}.gbm{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}.gb1{margin-right:.5em}#gbar .gbsup{color:#c00;font-size:9px;font-weight:normal;line-height:9px;margin-left:-.5em;margin-right:.5em;*margin-left:-.5em;*margin-right:.5em}.gb1,.gb3{zoom:1}.gb2{display:block;padding:.2em .5em}.gb2,.gb3{text-decoration:none;border-bottom:none}a.gb1,a.gb2,a.gb3,a.gb4{color:#00c !important}.gbi .gb3,.gbi .gb2,.gbi .gb4{color:#dd8e27 !important}.gbf .gb3,.gbf .gb2,.gbf .gb4{color:#900 !important}a.gb2:hover{background:#36c;color:#fff !important}
--></mce:style><style type="text/css" mce_bogus="1">  
  #gbar,#guser{font-size:13px;padding-right:1px;padding-top:2px !important}#gbar{padding-left:1px;float:left;height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#gbs,.gbm{background:#fff;left:0;position:absolute;text-align:left;visibility:hidden;z-index:1000}.gbm{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}.gb1{margin-right:.5em}#gbar .gbsup{color:#c00;font-size:9px;font-weight:normal;line-height:9px;margin-left:-.5em;margin-right:.5em;*margin-left:-.5em;*margin-right:.5em}.gb1,.gb3{zoom:1}.gb2{display:block;padding:.2em .5em}.gb2,.gb3{text-decoration:none;border-bottom:none}a.gb1,a.gb2,a.gb3,a.gb4{color:#00c !important}.gbi .gb3,.gbi .gb2,.gbi .gb4{color:#dd8e27 !important}.gbf .gb3,.gbf .gb2,.gbf .gb4{color:#900 !important}a.gb2:hover{background:#36c;color:#fff !important}</style> 
<link rel="stylesheet" href="/dictionary/css/dictionary-search_post20100310.css" mce_href="dictionary/css/dictionary-search_post20100310.css" type="text/css"> 
<link rel="stylesheet" href="/dictionary/css/gselectbox_post20090113.css" mce_href="dictionary/css/gselectbox_post20090113.css" type="text/css"> 
<mce:script type="text/javascript" src="/dictionary/js/dictionary_compiled_post20091026.js" mce_src="dictionary/js/dictionary_compiled_post20091026.js"><!--
 
// --></mce:script> 
<mce:script type="text/javascript"><!--
 
(function(){function i(a,b,c){var d="on"+b;if(a.addEventListener)a.addEventListener(b,c,false);else if(a.attachEvent)a.attachEvent(d,c);else{var h=a[d];a[d]=function(){var g=h.apply(this,arguments),e=c.apply(this,arguments);return g==undefined?e:e==undefined?g:e&&g}}};var j,k,l,m=window.gbar={};function _tvs(a,b){return a||b}function _tvn(a,b){var c=parseInt(a,10);return isNaN(c)?b:c}function _tvf(a,b){var c=parseFloat(a);return isNaN(c)?b:c}function _tvb(a,b){return a=="true"?true:a=="false"?false:b}var n,o,p;function q(a){var b=window.a&&(document.forms[0].b||"").value;if(b)a.href=a.href.replace(/([?&])q=[^&]*|$/,function(c,d){return(d||"&")+"q="+encodeURIComponent(b)})}l=q;
function r(a,b,c,d,h,g){var e=document.getElementById(a);if(e){var f=e.style;f.left=d?"auto":b+"px";f.right=d?b+"px":"auto";f.top=c+"px";f.visibility=o?"hidden":"visible";if(h&&g){f.width=h+"px";f.height=g+"px"}else{r(n,b,c,d,e.offsetWidth,e.offsetHeight);o=o?"":a}}}
var s=[],v=function(a){a=a||window.event;var b=a.target||a.srcElement;a.cancelBubble=true;if(n==null){a=document.createElement(Array.every||window.createPopup?"iframe":"div");a.frameBorder="0";n=a.id="gbs";a.src="javascript:''";b.parentNode.appendChild(a);i(document,"click",t)}var c=b;b=0;if(c.className!="gb3")c=c.parentNode;a=c.getAttribute("aria-owns")||"gbi";var d=c.offsetWidth,h=c.offsetTop>20?46:24;if(document.getElementById("tphdr"))h-=3;var g=false;do b+=c.offsetLeft||0;while(c=c.offsetParent);
c=(document.documentElement.clientWidth||document.body.clientWidth)-b-d;var e;d=document.body;var f=document.defaultView;if(f&&f.getComputedStyle){if(d=f.getComputedStyle(d,""))e=d.direction}else e=d.currentStyle?d.currentStyle.direction:d.style.direction;e=e=="rtl";if(a=="gbi"){for(d=0;f=s[d++];)f();u(null,window.navExtra);if(e){b=c;g=true}}else if(!e){b=c;g=true}o!=a&&t();r(a,b,h,g)},t=function(){o&&r(o,0,0)},u=function(a,b){var c,d=document.getElementById("gbi"),h=a;if(!h)h=d.firstChild;for(;b&&
(c=b.pop());){var g=d,e=c,f=h;p||(p="gb2");g.insertBefore(e,f).className=p}},w=function(a,b,c){if((b=document.getElementById(b))&&a){a.className="gb4";var d=document.createElement("span");d.appendChild(a);d.appendChild(document.createTextNode(" | "));d.id=c;b.appendChild(d)}};m.qs=l;m.setContinueCb=k;m.pc=j;m.tg=v;m.close=t;m.addLink=w;m.almm=u;})();
// --></mce:script> 
<mce:script type="text/javascript" src="/dictionary/js/autocomplete_compiled_post20090416.js" mce_src="dictionary/js/autocomplete_compiled_post20090416.js"><!--
 
// --></mce:script> 
</head> 
<body onload="document.f.q.select();tickBodyLoadAndReport();" bgcolor="#ffffff" > 
<div id=gbar><nobr><a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dw" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dw" onclick=gbar.qs(this) class=gb1>Web</a> <a href="http://www.google.com/images?langpair=en%7Czh-CN&q=abandon&hl=en&source=og&sa=N&tab=Di" mce_href="http://www.google.com/images?langpair=en%7Czh-CN&q=abandon&hl=en&source=og&sa=N&tab=Di" onclick=gbar.qs(this) class=gb1>Images</a> <a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=vid:1&source=og&sa=N&tab=Dv" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=vid:1&source=og&sa=N&tab=Dv" onclick=gbar.qs(this) class=gb1>Videos</a> <a href="http://maps.google.com/maps?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dl" mce_href="http://maps.google.com/maps?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dl" onclick=gbar.qs(this) class=gb1>Maps</a> <a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=nws:1&source=og&sa=N&tab=Dn" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=nws:1&source=og&sa=N&tab=Dn" onclick=gbar.qs(this) class=gb1>News</a> <a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=shop:1&source=og&sa=N&tab=Df" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=shop:1&source=og&sa=N&tab=Df" onclick=gbar.qs(this) class=gb1>Shopping</a> <a href="http://mail.google.com/mail/?hl=en&tab=Dm" mce_href="http://mail.google.com/mail/?hl=en&tab=Dm" class=gb1>Gmail</a> <a href="http://www.google.com/intl/en/options/" mce_href="http://www.google.com/intl/en/options/" onclick="this.blur();gbar.tg(event);return !1" aria-haspopup=true class=gb3><u>more</u> <small>▼</small></a><div class=gbm id=gbi><a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=bks:1&source=og&sa=N&tab=Dp" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=bks:1&source=og&sa=N&tab=Dp" onclick=gbar.qs(this) class=gb2>Books</a> <a href="http://www.google.com/finance?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=De" mce_href="http://www.google.com/finance?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=De" onclick=gbar.qs(this) class=gb2>Finance</a> <a href="http://translate.google.com/translate_t?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=DT" mce_href="http://translate.google.com/translate_t?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=DT" onclick=gbar.qs(this) class=gb2>Translate</a> <a href="http://scholar.google.com/scholar?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Ds" mce_href="http://scholar.google.com/scholar?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Ds" onclick=gbar.qs(this) class=gb2>Scholar</a> <a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=blg:1&source=og&sa=N&tab=Db" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=blg:1&source=og&sa=N&tab=Db" onclick=gbar.qs(this) class=gb2>Blogs</a> <a href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=mbl:1&source=og&sa=N&tab=DY" mce_href="http://www.google.com/search?langpair=en%7Czh-CN&q=abandon&hl=en&tbo=u&tbs=mbl:1&source=og&sa=N&tab=DY" onclick=gbar.qs(this) class=gb2>Realtime</a> <div class=gb2><div class=gbd></div></div><a href="http://www.youtube.com/results?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=D1" mce_href="http://www.youtube.com/results?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=D1" onclick=gbar.qs(this) class=gb2>YouTube</a> <a href="http://www.google.com/calendar/render?hl=en&tab=Dc" mce_href="http://www.google.com/calendar/render?hl=en&tab=Dc" class=gb2>Calendar</a> <a href="http://picasaweb.google.com/lh/view?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dq" mce_href="http://picasaweb.google.com/lh/view?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dq" onclick=gbar.qs(this) class=gb2>Photos</a> <a href="http://docs.google.com/?hl=en&tab=Do&authuser=0" mce_href="http://docs.google.com/?hl=en&tab=Do&authuser=0" class=gb2>Documents</a> <a href="http://www.google.com/reader/view/?hl=en&tab=Dy" mce_href="http://www.google.com/reader/view/?hl=en&tab=Dy" class=gb2>Reader</a> <a href="http://sites.google.com/?hl=en&tab=D3" mce_href="http://sites.google.com/?hl=en&tab=D3" class=gb2>Sites</a> <a href="http://groups.google.com/groups?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dg" mce_href="http://groups.google.com/groups?langpair=en%7Czh-CN&q=abandon&hl=en&sa=N&tab=Dg" onclick=gbar.qs(this) class=gb2>Groups</a> <div class=gb2><div class=gbd></div></div><a href="http://www.google.com/intl/en/options/" mce_href="http://www.google.com/intl/en/options/" class=gb2>even more »</a> </div></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><b class=gb4>bonny95@gmail.com</b> | <span id=gbe></span><a id="gb_67" href="http://www.google.com/history/?hl=en" mce_href="http://www.google.com/history/?hl=en" class=gb4>Web History</a> | <a id="gb_97" href="https://www.google.com/accounts/ManageAccount?hl=en" mce_href="https://www.google.com/accounts/ManageAccount?hl=en" class=gb4>My Account</a> | <a id="gb_71" href="http://www.google.com/accounts/Logout?continue=http://www.google.com/dictionary%3Flangpair%3Den%257Czh-CN%26q%3Dabandon%26hl%3Den%26aq%3Df" mce_href="http://www.google.com/accounts/Logout?continue=http://www.google.com/dictionary%3Flangpair%3Den%257Czh-CN%26q%3Dabandon%26hl%3Den%26aq%3Df" class=gb4>Sign out</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div> 
<div id=cnt> 
<table class="tb" style="clear:both" mce_style="clear:both" width="100%"> 
<tr> 
<form name="f" action="/dictionary"> 
<td class="tc" valign="top"> 
<a id="logo" href="http://www.google.com/webhp?hl=en" mce_href="http://www.google.com/webhp?hl=en" title="Go to Google Home"> 
Go to Google Home<span></span> 
</a> 
</td> 
<td style="padding:25px 0 7px 8px;position:relative;" mce_style="padding:25px 0 7px 8px;position:relative;" valign="top" width="100%"> 
<select id="dct-slc" name="langpair" onchange="onUpdateLangpair(this)"> 
<option value="ar|en">Arabic <> English</option> 
<option value="bn|en">Bengali <> English</option> 
<option value="bg|en">Bulgarian <> English</option> 
<option value="zh-CN|zh-CN">Chinese (Simplified) dictionary</option> 
<option value="zh-CN|en">Chinese (Simplified) <> English</option> 
<option value="zh-TW|zh-TW">Chinese (Traditional) dictionary</option> 
<option value="zh-TW|en">Chinese (Traditional) <> English</option> 
<option value="hr|en">Croatian <> English</option> 
<option value="cs|cs">Czech dictionary</option> 
<option value="cs|en">Czech <> English</option> 
<option value="nl|nl">Dutch dictionary</option> 
<option value="en|ar">English <> Arabic</option> 
<option value="en|bn">English <> Bengali</option> 
<option value="en|bg">English <> Bulgarian</option> 
<option selected  value="en|zh-CN">English <> Chinese (Simplified)</option> 
<option value="en|zh-TW">English <> Chinese (Traditional)</option> 
<option value="en|hr">English <> Croatian</option> 
<option value="en|cs">English <> Czech</option> 
<option value="en|en">English dictionary</option> 
<option value="en|fi">English <> Finnish</option> 
<option value="en|fr">English <> French</option> 
<option value="en|de">English <> German</option> 
<option value="en|el">English <> Greek</option> 
<option value="en|gu">English <> Gujarati</option> 
<option value="en|iw">English <> Hebrew</option> 
<option value="en|hi">English <> Hindi</option> 
<option value="en|it">English <> Italian</option> 
<option value="en|kn">English <> Kannada</option> 
<option value="en|ko">English <> Korean</option> 
<option value="en|ml">English <> Malayalam</option> 
<option value="en|mr">English <> Marathi</option> 
<option value="en|pt">English <> Portuguese</option> 
<option value="en|ru">English <> Russian</option> 
<option value="en|sr">English <> Serbian</option> 
<option value="en|es">English <> Spanish</option> 
<option value="en|ta">English <> Tamil</option> 
<option value="en|te">English <> Telugu</option> 
<option value="en|th">English <> Thai</option> 
<option value="fi|en">Finnish <> English</option> 
<option value="fr|en">French <> English</option> 
<option value="fr|fr">French dictionary</option> 
<option value="de|en">German <> English</option> 
<option value="de|de">German dictionary</option> 
<option value="el|en">Greek <> English</option> 
<option value="gu|en">Gujarati <> English</option> 
<option value="iw|en">Hebrew <> English</option> 
<option value="hi|en">Hindi <> English</option> 
<option value="it|en">Italian <> English</option> 
<option value="it|it">Italian dictionary</option> 
<option value="kn|en">Kannada <> English</option> 
<option value="ko|en">Korean <> English</option> 
<option value="ko|ko">Korean dictionary</option> 
<option value="ml|en">Malayalam <> English</option> 
<option value="mr|en">Marathi <> English</option> 
<option value="pt|en">Portuguese <> English</option> 
<option value="pt|pt">Portuguese dictionary</option> 
<option value="ru|en">Russian <> English</option> 
<option value="ru|ru">Russian dictionary</option> 
<option value="sr|en">Serbian <> English</option> 
<option value="es|en">Spanish <> English</option> 
<option value="es|es">Spanish dictionary</option> 
<option value="ta|en">Tamil <> English</option> 
<option value="te|en">Telugu <> English</option> 
<option value="th|en">Thai <> English</option> 
</select> 
<mce:script type="text/javascript"><!--
 
if (!window.google) { window.google = {}; }
var installLanguageSelection = function() {
var language_code = {
'ar':'Arabic',
'bn':'Bengali',
'bg':'Bulgarian',
'zh-CN':'Chinese (Simplified)',
'zh-TW':'Chinese (Traditional)',
'hr':'Croatian',
'cs':'Czech',
'nl':'Dutch',
'en':'English',
'fi':'Finnish',
'fr':'French',
'de':'German',
'el':'Greek',
'gu':'Gujarati',
'iw':'Hebrew',
'hi':'Hindi',
'it':'Italian',
'kn':'Kannada',
'ko':'Korean',
'ml':'Malayalam',
'mr':'Marathi',
'pt':'Portuguese',
'ru':'Russian',
'sr':'Serbian',
'es':'Spanish',
'ta':'Tamil',
'te':'Telugu',
'th':'Thai'
};
window.google.installLanguageSelect('dct-slc', language_code);
};
window.setTimeout(installLanguageSelection, 10);
// --></mce:script> 
<input autocomplete="off" type="text" name="q" size="40" maxlength="2048"
             value="abandon"
         title="Search Dictionary"> 
<input type="hidden" name="hl"
             value="en"> 
<input type="submit" value="Search Dictionary"
         style="padding:0 .25em 0 .25em; width:auto; overflow:visible"> 
</td> 
</form> 
</tr> 
</table> 
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="t bt"> 
<tbody> 
<tr> 
<td style="white-space:nowrap" mce_style="white-space:nowrap"> 
<span id="sd" style="float:left" mce_style="float:left">Dictionary</span> 
<a id="dct-clk-a"> 
<div id="dct-clk-im"><!- ie6 doesn't allow empty div. -></div> 
<span id="dct-clk-show">Show examples</span> 
<span id="dct-clk-hide">Hide examples</span> 
</a> 
</td> 
<td style="white-space:nowrap" mce_style="white-space:nowrap" align="right"> 
</td> 
</tr> 
</tbody> 
</table> 
<div class="dct-srch-otr"> 
<div class="dct-srch-inr rt-sct-exst"> 
<div class="dct-srch-rslt"> 
<p>Found in dictionary: <b>English > Chinese (Simplified)</b>.
</p> 
<ul class="dct-e2" id="pr-root" > 
<li class="dct-eh"
             > 
<div  class="dct-eh"> 
<span class="wl-st" id="wl-st-number1"
      onclick="window.google.addWord('abandon','en|zh-CN','number1');"><img alt="Add star"
    src="/dictionary/image/unstarred.gif" mce_src="dictionary/image/unstarred.gif"></span><span class="wl-ust"
  id="wl-ust-number1" onclick="window.google.removeWord('abandon','en|zh-CN','number1');"><img alt="Remove star"
    src="/dictionary/image/starred.gif" mce_src="dictionary/image/starred.gif"></span> 
<mce:script type="text/javascript"><!--
window.google.lookupWord('abandon','en|zh-CN','number1');
// --></mce:script> 
<span class="dct-tt">abandon</span><span class="dct-tp">   </span><span class="dct-tp">/əˈbændən/
<span class="dct-tlb" title="Phonetic">DJ</span></span><span class="prn-btn">/dictionary/flash/SpeakerApp16.swf</span><span class="dct-tp">   </span><span class="dct-tp">/ə'bændən/
<span class="dct-tlb" title="Phonetic">KK</span></span> 
</div> 
<ul> 
<li class="dct-ec"
               > 
<div  class="dct-ec"> 
<span class="dct-elb" title="Part-of-Speech">verb</span> 
</div> 
<ul> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">to leave somebody, especially somebody you are responsible for, with no intention of returning</span> <span class="dct-tt">(不顾责任、义务等)离弃,遗弃,抛弃
<span class="dct-tlb" title="Complement">~ sb (to sth)</span> 
<span class="dct-tlb" title="Grammar">VN</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">The baby had been abandoned by its mother.</span> <span class="dct-tt">这个婴儿被母亲遗弃了。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">People often simply abandon their pets when they go abroad.</span> <span class="dct-tt">人们出国时常常丢下宠物不管,一走了之。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">The study showed a deep fear among the elderly of being abandoned to the care of strangers.</span> <span class="dct-tt">研究表明,老人十分害怕被丢给陌生人照管。</span> 
</div> 
</li> 
</ul> 
</li> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">to leave a thing or place, especially because it is impossible or dangerous to stay</span> <span class="dct-tt">不得已而放弃;舍弃
<span class="dct-tlb" title="Complement">~ sth (to sb/sth)</span> 
<span class="dct-tlb" title="Grammar">VN</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">Snow forced many drivers to abandon their vehicles.</span> <span class="dct-tt">大雪迫使许多驾驶者弃车步行。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">They had to abandon their lands and property to the invading forces.</span> <span class="dct-tt">他们不得不放弃土地和财产,让侵略军占领。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">He gave the order to abandon ship(= to leave the ship because it was sinking).</span> <span class="dct-tt">他下令弃船(因船快要沉没)。</span> 
</div> 
</li> 
</ul> 
</li> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">to stop supporting or helping somebody; to stop believing in something</span> <span class="dct-tt">停止(支持或帮助);放弃(信念)
<span class="dct-tlb" title="Grammar">VN</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">The country abandoned its political leaders after the war.</span> <span class="dct-tt">战后该国人民不再拥护他们的政治领袖。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">By 1930 he had abandoned his Marxist principles.</span> <span class="dct-tt">1930 年时他已放弃了马克思主义信念。</span> 
</div> 
</li> 
</ul> 
</li> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">to stop doing something, especially before it is finished; to stop having something</span> <span class="dct-tt">中止;放弃;不再有
<span class="dct-tlb" title="Grammar">VN</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">They had to abandon the match because of rain.</span> <span class="dct-tt">因为下雨,他们只好中止比赛。</span> 
</div> 
</li> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">I have abandoned hope of any reconciliation.</span> <span class="dct-tt">我已对任何和解都不再抱希望。</span> 
</div> 
</li> 
</ul> 
</li> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">to feel an emotion so strongly that you can feel nothing else</span> <span class="dct-tt">陷入,沉湎于(某种情感)
<span class="dct-tlb" title="Complement">~ yourself to sth</span> 
<span class="dct-tlb" title="Register">literary</span> 
<span class="dct-tlb" title="Grammar">VN</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">He abandoned himself to despair.</span> <span class="dct-tt">他陷入绝望。</span> 
</div> 
</li> 
</ul> 
</li> 
</ul> 
</li> 
<li class="dct-ec"
               > 
<div  class="dct-ec"> 
<span class="dct-elb" title="Part-of-Speech">noun</span> 
</div> 
<ul> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">an uncontrolled way of behaving that shows that somebody does not care what other people think</span> <span class="dct-tt">放任;放纵
<span class="dct-tlb" title="Grammar">uncountable</span> 
<span class="dct-tlb" title="Register">written</span></span> 
</div> 
<ul> 
<li class="dct-ee"
              style="display:none" mce_style="display:none" > 
<div  class="dct-ee"> 
<span class="dct-tt">He signed cheques with careless abandon.</span> <span class="dct-tt">他无所顾忌地乱开支票。</span> 
</div> 
</li> 
</ul> 
<ul> 
<li class="dct-er"
               > 
<div  class="dct-er"> 
<span class="dct-elb" title="Word">See also:</span> 
</div> 
<div  class="dct-er"> 
<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=with+gay+abandon&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=with+gay+abandon&sl=en&tl=zh-CN&oi=dict_lk">with gay abandon</a></span> 
</div> 
</li> 
</ul> 
</li> 
</ul> 
</li> 
</ul> 
</li> 
</ul> 
<h3>English dictionary</h3> 
<ul class="dct-e2"  > 
<li class="dct-eh"
             > 
<div  class="dct-eh"> 
<span class="dct-tt">a·ban·don</span> 
</div> 
<ul> 
<li class="dct-em"
               > 
<div  class="dct-em"> 
<span class="dct-tt">Complete lack of inhibition or restraint</span> 
</div> 
</li> 
</ul> 
</li> 
</ul> 
<div class="mr-wds"> 
<a href="/dictionary?hl=en&q=abandon&sl=en&tl=en&oi=dict_mo" mce_href="dictionary?hl=en&q=abandon&sl=en&tl=en&oi=dict_mo"> 
More English dictionary results »</a> 
</div> 
<h3>Related phrases</h3> 
<ul class="rlt-snt"> 
<li> 
<div> 
<b><a href=" 
  /dictionary?q=abandon+oneself+to&hl=en&sl=en&tl=zh-CN&oi=dict_re
" mce_href=" 
  /dictionary?q=abandon+oneself+to&hl=en&sl=en&tl=zh-CN&oi=dict_re
">abandon oneself to</a></b> 
</div> 
沉溺于
</li> 
<li> 
<div> 
<b><a href=" 
  /dictionary?q=with+gay+abandon&hl=en&sl=en&tl=zh-CN&oi=dict_re
" mce_href=" 
  /dictionary?q=with+gay+abandon&hl=en&sl=en&tl=zh-CN&oi=dict_re
">with gay abandon</a></b> 
</div> 
不考虑后果;轻率
</li> 
</ul> 
<h3>Related languages</h3> 
<ul> 
<li> 
<strong>abandon</strong> is also a word in:
<a href="/dictionary?q=abandon&hl=en&sl=fr&tl=en
" mce_href="dictionary?q=abandon&hl=en&sl=fr&tl=en
">français</a> 
</li> 
</ul> 
<h3>Synonyms</h3> 
<ul> 
<li> 
<span class="dct-elb" title="Part-of-speech">verb</span>:<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=leave&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=leave&sl=en&tl=zh-CN&oi=dict_lk">leave</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=relinquish&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=relinquish&sl=en&tl=zh-CN&oi=dict_lk">relinquish</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=forsake&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=forsake&sl=en&tl=zh-CN&oi=dict_lk">forsake</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=quit&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=quit&sl=en&tl=zh-CN&oi=dict_lk">quit</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=give+up&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=give+up&sl=en&tl=zh-CN&oi=dict_lk">give up</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=desert&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=desert&sl=en&tl=zh-CN&oi=dict_lk">desert</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=renounce&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=renounce&sl=en&tl=zh-CN&oi=dict_lk">renounce</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=drop&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=drop&sl=en&tl=zh-CN&oi=dict_lk">drop</a></span>,<span class="dct-tt"> 
<a href="/dictionary?hl=en&q=vacate&sl=en&tl=zh-CN&oi=dict_lk" mce_href="dictionary?hl=en&q=vacate&sl=en&tl=zh-CN&oi=dict_lk">vacate</a></span> 
</li> 
</ul> 
<h3>Web translations</h3> 
<div> 
<h2 class="wd">abandon</h2> 
<div class="wbtr_cnt"> 
<ol> 
<li> 
<span class="wbtr_mn">放弃</span> 
<span class="wbtr_snp"><b>abandon放弃</b>离弃遗弃They were accused of abandoning their own principles </span> 
<span class="wbtr_url"> 
<a href="http://www.google.com/url?q=http://i.eol.cn/gchat.php%3Fid%3D5402&source=dictionary&type=we&usg=AFQjCNFpn25cb8sXwZ7B4vxhy9Rzg2Q33Q" mce_href="http://www.google.com/url?q=http://i.eol.cn/gchat.php%3Fid%3D5402&source=dictionary&type=we&usg=AFQjCNFpn25cb8sXwZ7B4vxhy9Rzg2Q33Q" target="_blank">i.eol.cn</a> 
</span> -
<span class="wbtr_rs"> 
<a href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E6%94%BE%E5%BC%83%22&ie=UTF-8&oi=dict_we" mce_href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E6%94%BE%E5%BC%83%22&ie=UTF-8&oi=dict_we" target="_blank"> 
Related search
</a> 
</span> 
</li> 
<li> 
<span class="wbtr_mn">抛弃</span> 
<span class="wbtr_snp"><b>抛弃</b>放弃 <b>abandon</b> 阿巴诺喹 Abanoquil 减轻减少消除 abate. 在线英语学习. 阿贝氏</span> 
<span class="wbtr_url"> 
<a href="http://www.google.com/url?q=http://www.scientrans.com/vocabulary/pages/20080202134324_34_65_1.html&source=dictionary&type=we&usg=AFQjCNHP7exeD0Iw8ck0Ps1yqu1yyu52SQ" mce_href="http://www.google.com/url?q=http://www.scientrans.com/vocabulary/pages/20080202134324_34_65_1.html&source=dictionary&type=we&usg=AFQjCNHP7exeD0Iw8ck0Ps1yqu1yyu52SQ" target="_blank">www.scientrans.com</a> 
</span> -
<span class="wbtr_rs"> 
<a href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E6%8A%9B%E5%BC%83%22&ie=UTF-8&oi=dict_we" mce_href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E6%8A%9B%E5%BC%83%22&ie=UTF-8&oi=dict_we" target="_blank"> 
Related search
</a> 
</span> 
</li> 
<li> 
<span class="wbtr_mn">遗弃</span> 
<span class="wbtr_snp"><b>abandon</b>放弃离弃<b>遗弃</b>They were accused of abandoning their own principles </span> 
<span class="wbtr_url"> 
<a href="http://www.google.com/url?q=http://i.eol.cn/gchat.php%3Fid%3D5402&source=dictionary&type=we&usg=AFQjCNFpn25cb8sXwZ7B4vxhy9Rzg2Q33Q" mce_href="http://www.google.com/url?q=http://i.eol.cn/gchat.php%3Fid%3D5402&source=dictionary&type=we&usg=AFQjCNFpn25cb8sXwZ7B4vxhy9Rzg2Q33Q" target="_blank">i.eol.cn</a> 
</span> -
<span class="wbtr_rs"> 
<a href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E9%81%97%E5%BC%83%22&ie=UTF-8&oi=dict_we" mce_href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E9%81%97%E5%BC%83%22&ie=UTF-8&oi=dict_we" target="_blank"> 
Related search
</a> 
</span> 
</li> 
<li> 
<span class="wbtr_mn">舍弃</span> 
<span class="wbtr_snp"><b>舍弃 abandon</b> 缩写地址呼号 abbreviated address calling 异常终止倾印 abend dump </span> 
<span class="wbtr_url"> 
<a href="http://www.google.com/url?q=http://www.scientrans.com/vocabulary/pages/20080317172247_106_65_1.html&source=dictionary&type=we&usg=AFQjCNExbMe6li2ZJzqgDvGM23Qdt1smpw" mce_href="http://www.google.com/url?q=http://www.scientrans.com/vocabulary/pages/20080317172247_106_65_1.html&source=dictionary&type=we&usg=AFQjCNExbMe6li2ZJzqgDvGM23Qdt1smpw" target="_blank">www.scientrans.com</a> 
</span> -
<span class="wbtr_rs"> 
<a href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E8%88%8D%E5%BC%83%22&ie=UTF-8&oi=dict_we" mce_href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E8%88%8D%E5%BC%83%22&ie=UTF-8&oi=dict_we" target="_blank"> 
Related search
</a> 
</span> 
</li> 
<li> 
<span class="wbtr_mn">丢弃</span> 
<span class="wbtr_snp"><b>abandon</b> vt<b>丢弃</b>放弃抛弃 ability n能力能耐本领 able a有能力的出色的 abnormal a不</span> 
<span class="wbtr_url"> 
<a href="http://www.google.com/url?q=http://www.51jnjj.cn/news_info.asp%3Fid%3D1602&source=dictionary&type=we&usg=AFQjCNGk60J0xWH-ue-l_HZKfm3O1PNfgQ" mce_href="http://www.google.com/url?q=http://www.51jnjj.cn/news_info.asp%3Fid%3D1602&source=dictionary&type=we&usg=AFQjCNGk60J0xWH-ue-l_HZKfm3O1PNfgQ" target="_blank">www.51jnjj.cn</a> 
</span> -
<span class="wbtr_rs"> 
<a href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E4%B8%A2%E5%BC%83%22&ie=UTF-8&oi=dict_we" mce_href="http://www.google.com/search?hl=en&q=%22abandon%22+%22%E4%B8%A2%E5%BC%83%22&ie=UTF-8&oi=dict_we" target="_blank"> 
Related search
</a> 
</span> 
</li> 
</ol> 
</div> 
</div> 
<h3>Usage examples</h3> 
<ul class="rlt-snt"> 
<li><div>"People died for this tournament, others were injured. We can't <b>abandon</b> them and leave like cowards," Alaixys Romao told French sports agency L'Equipe. "If we stay here, it's for them. But also so as not to give satisfaction to the rebels....</div><div><span class="grey">Jan 10, 2010</span> - <span> 
<a class="lightblue" href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Alaixys_Romao&source=dictionary&usg=AFQjCNG0zCsZW1KyoHGeZnumG5E2-qMhSg" mce_href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Alaixys_Romao&source=dictionary&usg=AFQjCNG0zCsZW1KyoHGeZnumG5E2-qMhSg">Alaixys Romao</a></span> - <span> 
<a class="green" href="http://www.google.com/url?q=http://www.bbc.co.uk/blogs/piersedwards/2010/01/gun_attack_overshadows_africa.html&source=dictionary&usg=AFQjCNFXePJzwrZ-RG_9bgFB4QdVuCMbhg" mce_href="http://www.google.com/url?q=http://www.bbc.co.uk/blogs/piersedwards/2010/01/gun_attack_overshadows_africa.html&source=dictionary&usg=AFQjCNFXePJzwrZ-RG_9bgFB4QdVuCMbhg">BBC Sport (blog)</a></span></div></li> 
<li><div>"The president would have us believe there are two choices: keep all of our troops in Iraq or <b>abandon</b> these Iraqis," Obama said. "I reject this choice."</div><div><span class="grey">Sep 12, 2007</span> - <span> 
<a class="lightblue" href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Barack_Obama&source=dictionary&usg=AFQjCNHQ0yfPaaXFGqLKymRgcres0I2nuA" mce_href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Barack_Obama&source=dictionary&usg=AFQjCNHQ0yfPaaXFGqLKymRgcres0I2nuA">Barack Obama</a></span> - <span> 
<a class="green" href="http://www.google.com/url?q=http://www.forbes.com/feeds/ap/2007/09/12/ap4108235.html&source=dictionary&usg=AFQjCNE9DqEquDtHBRoJSv9cfvjUPrgevg" mce_href="http://www.google.com/url?q=http://www.forbes.com/feeds/ap/2007/09/12/ap4108235.html&source=dictionary&usg=AFQjCNE9DqEquDtHBRoJSv9cfvjUPrgevg">Forbes</a></span></div></li> 
<li><div>"I am deeply disappointed that the governor has decided to <b>abandon</b> the state and her constituents before her term has concluded," Murkowski said.</div><div><span class="grey">Jul 3, 2009</span> - <span> 
<a class="lightblue" href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Lisa_Murkowski&source=dictionary&usg=AFQjCNGfUU0pjzbEuDwnY81jySj6rKn9pA" mce_href="http://www.google.com/url?q=http://en.wikipedia.org/wiki/Lisa_Murkowski&source=dictionary&usg=AFQjCNGfUU0pjzbEuDwnY81jySj6rKn9pA">Lisa Murkowski</a></span> - <span> 
<a class="green" href="http://www.google.com/url?q=http://www.politico.com/blogs/bensmith/0709/L_Murkowski_Deeply_disappointed_Palin_has_decided_to_abandon_the_state_.html&source=dictionary&usg=AFQjCNGtnwsoPi3e6Y5XTizOkg87g-_AsQ" mce_href="http://www.google.com/url?q=http://www.politico.com/blogs/bensmith/0709/L_Murkowski_Deeply_disappointed_Palin_has_decided_to_abandon_the_state_.html&source=dictionary&usg=AFQjCNGtnwsoPi3e6Y5XTizOkg87g-_AsQ">Politico</a></span></div></li> 
</ul> 
<h3>Web definitions</h3> 
<ul class="gls"> 
<li> 
<ul> 
<li> 
forsake, leave behind; "We abandoned the old car in the empty parking lot" <br> 
</li> 
<div> 
<a href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g" mce_href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g"> 
wordnetweb.princeton.edu/perl/webwn
</a> 
</div> 
</ul> 
</li> 
<li> 
<ul> 
<li> 
give up with the intent of never claiming again; "Abandon your life to God"; "She gave up her children to her ex-husband when she moved to Tahiti"; "We gave the drowning victim up for dead" <br> 
</li> 
<div> 
<a href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g" mce_href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g"> 
wordnetweb.princeton.edu/perl/webwn
</a> 
</div> 
</ul> 
</li> 
<li> 
<ul> 
<li> 
vacate: leave behind empty; move out of; "You must vacate your office by tonight" <br> 
</li> 
<div> 
<a href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g" mce_href="http://www.google.com/url?q=http://wordnetweb.princeton.edu/perl/webwn%3Fs%3Dabandon&source=dictionary&type=de&usg=AFQjCNHqLML70dHqzi04RiOEhnZ9Jvl71g"> 
wordnetweb.princeton.edu/perl/webwn
</a> 
</div> 
</ul> 
</li> 
</ul> 
<div class="mr-wds"> 
<a href="/dictionary?hl=en&q=abandon&sl=en&tl=en" mce_href="dictionary?hl=en&q=abandon&sl=en&tl=en"> 
Show more Web definitions »</a> 
</div> 
</div> 
</div> 
<div class="dct-rt-sct"> 
<div class="wl-hd"> 
<img src="/dictionary/image/starred.png" mce_src="dictionary/image/starred.png"> 
<a href="/dictionary/wordlist?hl=en" mce_href="dictionary/wordlist?hl=en">Starred words »</a> 
</div> 
<div id="dict-hist" class="rt-sct-blk"> 
<h4>Recent searches</h4> 
<div> 
<ul> 
<li> 
<a href="/dictionary?hl=en&sl=en&tl=en&q=abeyance" mce_href="dictionary?hl=en&sl=en&tl=en&q=abeyance">abeyance</a> 
</li> 
<li> 
<a href="/dictionary?hl=en&sl=en&tl=zh-CN&q=abeyance" mce_href="dictionary?hl=en&sl=en&tl=zh-CN&q=abeyance">abeyance</a> 
</li> 
<li> 
<a href="/dictionary?hl=en&sl=en&tl=zh-CN&q=abandon" mce_href="dictionary?hl=en&sl=en&tl=zh-CN&q=abandon">abandon</a> 
</li> 
<li> 
<a href="/dictionary?hl=en&sl=en&tl=zh-CN&q=abet" mce_href="dictionary?hl=en&sl=en&tl=zh-CN&q=abet">abet</a> 
</li> 
<li> 
<a href="/dictionary?hl=en&sl=en&tl=zh-CN&q=Phonetic" mce_href="dictionary?hl=en&sl=en&tl=zh-CN&q=Phonetic">Phonetic</a> 
</li> 
</ul> 
<div class="mrhist"> 
<a href="http://www.google.com/history/lookup?hl=en&st=dict" mce_href="http://www.google.com/history/lookup?hl=en&st=dict"> 
All recent searches »</a> 
</div> 
</div> 
</div> 
</div> 
<br class="clear"> 
</div> 
<div class="dscl-dct"><p> 
Results partly provided by <a href="http://www.dreye.com.cn" mce_href="http://www.dreye.com.cn">Dr.eye</a>.
</p></div> 
<div class="dscl-glb"> 
The usage examples, images and web definitions on this page were selected automatically by a computer program. They do not necessarily reflect the views of Google Inc. or its employees.
</div> 
<center> 
<p/> 
<hr class="z"> 
<div class="" style="border-top: 1px solid rgb(204, 204, 240); padding: 15px 2px 2px;" mce_style="border-top: 1px solid #ccccf0; padding: 15px 2px 2px;"> 
<font size="-1"> 
<span >©2009 Google</span> 
-
<a href="http://www.google.com/webhp?hl=en" mce_href="http://www.google.com/webhp?hl=en">Google Home</a> 
-
<a href="http://www.google.com/intl/en/about.html" mce_href="http://www.google.com/intl/en/about.html">All About Google</a> 
</font> 
</div> 
</center> 
</div> 
</body> 
<mce:script type="text/javascript"><!--
 
(function() {
})();
if (!window.google) { window.google = {}; }
(function(){if(window.jstiming){window.jstiming.a={};window.jstiming.c=1;var j=function(a,c,e){var b=a.t[c],g=a.t.start;if(b&&(g||e)){b=a.t[c][0];g=e!=undefined?e:g[0];return b-g}},n=function(a,c,e){var b="";if(window.jstiming.pt){b+="&srt="+window.jstiming.pt;delete window.jstiming.pt}try{if(window.external&&window.external.tran)b+="&tran="+window.external.tran;else if(window.gtbExternal&&window.gtbExternal.tran)b+="&tran="+window.gtbExternal.tran();else if(window.chrome&&window.chrome.csi)b+="&tran="+window.chrome.csi().tran}catch(g){}var d=
window.chrome;if(d)if(d=d.loadTimes){if(d().wasFetchedViaSpdy)b+="&p=s";if(d().wasNpnNegotiated)b+="&npn=1";if(d().wasAlternateProtocolAvailable)b+="&apa=1"}if(a.b)b+="&"+a.b;d=a.t;var m=d.start,k=[],h=[];for(var f in d)if(f!="start")if(f.indexOf("_")!=0){var i=d[f][1];if(i)d[i]&&h.push(f+"."+j(a,f,d[i][0]));else m&&k.push(f+"."+j(a,f))}delete d.start;if(c)for(var l in c)b+="&"+l+"="+c[l];return a=[e?e:"http://csi.gstatic.com/csi","?v=3","&s="+(window.jstiming.sn||"dictionary")+"&action=",a.name,
h.length?"&it="+h.join(","):"","",b,"&rt=",k.join(",")].join("")};window.jstiming.report=function(a,c,e){a=n(a,c,e);if(!a)return"";c=new Image;var b=window.jstiming.c++;window.jstiming.a[b]=c;c.onload=c.onerror=function(){delete window.jstiming.a[b]};c.src=a;c=null;return a}};})();
(function(){var b=true,g=null,h=h||{};h.global=this;h.v=b;h.w="en";h.d=g;h.Z=function(a){h.g(a)};h.g=function(a,c,d){a=a.split(".");d=d||h.global;!(a[0]in d)&&d.execScript&&d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)if(!a.length&&h.p(c))d[e]=c;else d=d[e]?d[e]:d[e]={}};h.K=function(a,c){for(var d=a.split("."),e=c||h.global,f;f=d.shift();)if(e[f])e=e[f];else return g;return e};h.M=function(a,c){var d=c||h.global;for(var e in a)d[e]=a[e]};h.A=function(){};h.da=false;h.aa=function(){};h.D="";
h.X=function(){};h.N=function(){return arguments[0]};h.z=function(){throw Error("unimplemented abstract method");};h.B=function(a){a.I=function(){return a.o||(a.o=new a)}};
h.a=function(a){var c=typeof a;if(c=="object")if(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else return"null";
else if(c=="function"&&typeof a.call=="undefined")return"object";return c};h.s=function(a,c){if(c in a)for(var d in a)if(d==c&&Object.prototype.hasOwnProperty.call(a,c))return b;return false};h.Y=function(a,c){return a instanceof Object?Object.prototype.propertyIsEnumerable.call(a,c):h.s(a,c)};h.p=function(a){return a!==undefined};h.U=function(a){return a===g};h.S=function(a){return a!=g};h.O=function(a){return h.a(a)=="array"};
h.P=function(a){var c=h.a(a);return c=="array"||c=="object"&&typeof a.length=="number"};h.R=function(a){return h.q(a)&&typeof a.getFullYear=="function"};h.W=function(a){return typeof a=="string"};h.Q=function(a){return typeof a=="boolean"};h.V=function(a){return typeof a=="number"};h.T=function(a){return h.a(a)=="function"};h.q=function(a){a=h.a(a);return a=="object"||a=="array"||a=="function"};h.n=function(a){return a[h.b]||(a[h.b]=++h.u)};
h.t=function(a){"removeAttribute"in a&&a.removeAttribute(h.b);try{delete a[h.b]}catch(c){}};h.b="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36);h.u=0;h.H=h.n;h.$=h.t;h.l=function(a){var c=h.a(a);if(c=="object"||c=="array"){if(a.k)return a.k();c=c=="array"?[]:{};for(var d in a)c[d]=h.l(a[d]);return c}return a};
h.c=function(a,c){var d=c||h.global;if(arguments.length>2){var e=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,e);return a.apply(d,f)}}else return function(){return a.apply(d,arguments)}};h.r=function(a){var c=Array.prototype.slice.call(arguments,1);return function(){var d=Array.prototype.slice.call(arguments);d.unshift.apply(d,c);return a.apply(this,d)}};h.i=function(a,c){for(var d in c)a[d]=c[d]};
h.now=Date.now||function(){return+new Date};
h.L=function(a){if(h.global.execScript)h.global.execScript(a,"JavaScript");else if(h.global.eval){if(h.d==g){h.global.eval("var _et_ = 1;");if(typeof h.global._et_!="undefined"){delete h.global._et_;h.d=b}else h.d=false}if(h.d)h.global.eval(a);else{var c=h.global.document,d=c.createElement("script");d.type="text/javascript";d.defer=false;d.appendChild(c.createTextNode(a));c.body.appendChild(d);c.body.removeChild(d)}}else throw Error("goog.globalEval not available");};h.ca=b;
h.G=function(a,c){var d=a+(c?"-"+c:"");return h.f&&d in h.f?h.f[d]:d};h.ba=function(a){h.f=a};h.J=function(a,c){var d=c||{};for(var e in d){var f=(""+d[e]).replace(//$/g,"$$");a=a.replace(RegExp("//{//$"+e+"//}","gi"),f)}return a};h.m=function(a,c,d){h.g(a,c,d)};h.F=function(a,c,d){a[c]=d};h.h=function(a,c){function d(){}d.prototype=c.prototype;a.e=c.prototype;a.prototype=new d;a.prototype.constructor=a};
h.C=function(a,c){var d=arguments.callee.caller;if(d.e)return d.e.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),f=false,i=a.constructor;i;i=i.e&&i.e.constructor)if(i.prototype[c]===d)f=b;else if(f)return i.prototype[c].apply(a,e);if(a[c]===d)return a.constructor.prototype[c].apply(a,e);else throw Error("goog.base called from a method of one name to a method of a different name");};h.scope=function(a){a.call(h.global)};h.j=b;
if(h.j){Function.prototype.c=function(a){if(arguments.length>1){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return h.c.apply(g,c)}else return h.c(this,a)};Function.prototype.r=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this,g);return h.c.apply(g,a)};Function.prototype.h=function(a){h.h(this,a)};Function.prototype.i=function(a){h.i(this.prototype,a)}};function j(){var a=window.jstiming.load;a.tick("ol");window.jstiming.report(a)}h.m("tickBodyLoadAndReport",j);})();
var installFunctions = function() {
window.google.ac.install(document.f,document.f.q,"d",true,
"close",true,"","","");
onUpdateLangpair(document.f['dct-slc']);
};
var hideShowEl = document.getElementById('dct-clk-a');
if (hideShowEl) {
hideShowEl.href = 'javascript:google.toggleDictionaryExample()';
}
function onUpdateLangpair(sel) {
langpair = sel.options[sel.selectedIndex].value;
window.google.ac.update(langpair);
};
window.setTimeout(installFunctions, 10);
// --></mce:script> 
</html> 

注意到有一行信息:

<meta name="description" content="abandon : (不顾责任、义务等)离弃,遗弃,抛弃, 不得已而放弃;舍弃, 停止(支持或帮助);放弃(信念), 中止;放弃;不再有, 陷入,沉湎于(某种情感), 放任;放纵 - Google's free online dictionary service."> 

 

 包含单词abandon的中文释义。于是可以利用curl获取到Google Dictionary的翻译网页,然后直接在获取的网页中查找上面那一行信息。

 

#!/bin/bash
# Command line look up using Google's define feature - command line dictionary
# gd -i <input_file> -o <output_file> [-w <word>]
function query
{
	typeset wd=$1
	typeset TMPFILE=tmp.$wd
	typeset i=0
	while ((i<5))
	do
		curl -s -A 'Mozilla/4.0' "http://www.google.com/dictionary?langpair=zh-CN|en&hl=en&aq=f&q=$wd" >$TMPFILE 2>/dev/null
		if [ -s $TMPFILE ]; then
			break
		elif ((i=4)); then
			echo $wd >> failed.gd.$input
		fi
		((i=i+1))
		sleep 1
	done
	perl -i -p -e "print STDOUT /$1,/"/r/n/" if (m/($wd.*:.*)- Google.*/);" $TMPFILE
	rm -f $TMPFILE
}
##############################################
#	MAIN LINE START HERE
##############################################
typeset input=
typeset output=
typeset word=
typeset -i flag=0
while getopts 'i:o:w:' OPT
do
        case $OPT in
        i)	input=${OPTARG};;
        o)	output=${OPTARG};;
        w)	word=${OPTARG};flag=1;;
        *)      echo -u2 "ERROR: Invalid argument [$OPT]"
                ;;
        esac
done
shift `expr $OPTIND - 1`
if ((flag==0)); then
	perl -i.bk -p -e "s/^(/w+).*[/[//].*[/]//]//$1/;" $input # Eliminate the phonetic symbol
	WORDS=$(cat $input)
	for word in $WORDS
	do
		word_exp=$(query $word)
		if [ ${#word_exp} != 0 ]; then
			echo $word_exp >> $output
		else
			echo "$word:" >> $output
		fi
	done
else
	word_exp=$(query $word)
	if [ ${#word_exp} != 0 ]; then
		echo $word_exp
	else
		echo "$word:"
	fi
fi

 

2011-01-03 Update:

奉上完整版的程序:

#!/bin/bash
# Command line look up using Google's define feature - command line dictionary
# od [-b] [-g]-i <input_file> -o <output_file> [-w <word>]
# gd - Query words using Google Dictionary
function gd
{
	typeset wd=$1
	typeset TMPFILE=tmp.gd.$wd
	typeset -i i=0
	while ((i<5))
	do
		curl -s -A 'Mozilla/4.0' "http://www.google.com/dictionary?langpair=zh-CN|en&hl=en&aq=f&q=$wd" >$TMPFILE 2>/dev/null
		if [ -s $TMPFILE ]; then
			break
		elif ((i=4)); then
			echo $wd >> failed.gd.$input
		fi
		((i=i+1))
		sleep 1
	done
	perl -i -p -e "print STDOUT /$1,/"/r/n/" if (m/($wd.*:.*)- Google.*/);" $TMPFILE
	rm -f $TMPFILE
}
# bd - Query words using Baidu Dictionary
#
function bd
{
	typeset wd=$1
	typeset TMPFILE=tmp.bd.$wd
	typeset -i i=0
	while ((i<5))
	do
		curl -s -A 'Mozilla/4.0' "http://dict.baidu.com/s?tn=dict&wd="$word | html2text > $TMPFILE 2>/dev/null
		if [ -s $TMPFILE ]; then
			break
		elif ((i=4)); then
			echo $wd >> failed.bd.$input
		fi
		((i=i+1))
		sleep 1
	done
	./censor.pl $TMPFILE $wd
	rm -f $TMPFILE
}
##############################################
#	MAIN LINE START HERE
##############################################
typeset input=
typeset output=
typeset word=
typeset dict=z"gd bd"
typeset -i word_flag=0
while getopts 'agbi:o:w:' OPT
do
        case $OPT in
        g)	dict=gd;;
        b)	dict=bd;;
        i)	input=${OPTARG};;
        o)	output=${OPTARG};;
        w)	word=${OPTARG};word_flag=1;;
        *)      echo -u2 "ERROR: Invalid argument [$OPT]"
                ;;
        esac
done
shift `expr $OPTIND - 1`
if ((word_flag==0)); then
#	perl -i.bk -p -e "s/^(/w+).*[/[//].*[/]//]//$1/;" $input # Eliminate the phonetic symbols
	WORDS=$(cat $input)
	for word in $WORDS
	do
		case $dict in
		*bd*)	echo "------------------ $word -------------------" >> $output;;
		esac
		
		for d in $dict
		do
			word_exp=$($d $word)
			if [ ${#word_exp} != 0 ]; then
				echo $word_exp >> $output
			else
				echo "$word:" >> $output
			fi
		done
	done
else
	for d in $dict
	do
		$d $word
	done
fi

 

 

#!/usr/bin/perl -w
############### censor.pl #################
# Handle the explanations got from online dictionary.
# Inputs:
#	ARGV[0] -- temparory file containning the explanations
#	ARGV[1] -- keyword
############################################
use strict;
use Encode;
my $syntax = Encode::decode('utf8', '语法标注解释 ');
my $internet = Encode::decode('utf8', '以下结果来自互联网网络释义');
my $yingyin = Encode::decode('utf8', '英音');
my $meiyin = Encode::decode('utf8', '美音');
my $baidu = Encode::decode('utf8', '此内容系百度根据您的指令自动搜索的结果');
my $write_flag=0;
open(EXP,$ARGV[0]);
while (my $nextline=<EXP>) {
	chomp($nextline);
	$nextline = Encode::decode('utf8', $nextline);
	if ($nextline =~ m/.*$syntax.*/) {
		$write_flag=1;
		$nextline =~ s/$syntax//;
	} elsif ($nextline =~ m/.*$internet.*/ || $nextline =~ m/.*$baidu.*/) {
		$write_flag=0;
	}
			
	if ($write_flag eq 1) {
		if ($nextline !~ m/.*/*/*/*/*.*/) { # Excluse lines containning ****
			# Add a space between the keyword and 英音/美音
			$nextline =~ s/$ARGV[1]([$yingyin|$meiyin])/$ARGV[1] $1/; 
			print encode("utf8",$nextline),"/r/n"; # In perl, /r/n is needed to add a new line
		}
	}
}
close(EXP);