<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">

<html>

<!--(==============================================================)-->
<!--(Document created with RoboEditor. )============================-->
<!--(==============================================================)-->

<head>

<title>Constructing URLs</title>

<!--(Meta)==========================================================-->

<meta HTTP-EQUIV=Content-Type CONTENT="text/html; charset=windows-1252">
<meta name=generator content="RoboHELP by eHelp Corporation - www.ehelp.com">
<meta name=generator-major-version content=0.1>
<meta name=generator-minor-version content=1>
<meta name=filetype content=kadov>
<meta name=filetype-version content=1>
<meta name=page-count content=1>
<meta name=layout-height content=3790>
<meta name=layout-width content=552>
<meta name=date content="08 20, 2001 4:24:15 PM">


<!--(Links)=========================================================-->

<link rel=StyleSheet href="../../default.css">



<!--(Style Sheet)===================================================-->

<style>
<!--

A:visited {
	color: #800080;
}

A:link {
	color: #0000ff;
}

-->
</style>


</head>

<!--(Body)==========================================================-->


<body>

<h1 style="font-size: large; font-weight: normal;">URLs for Dictionary 
 Lookup</h1>

<p style="font-size: 10pt;">The Dictionary Lookup Tool is a very handy 
 tool for building and refining lexicons. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->This 
 tool allows users to easily access dictionary sites on the Web and to 
 display search results within VisualText. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<p style="font-size: 10pt;">To access online dictionaries, the paths to 
 these sites must be set in <a href="../../VisualText_Interface/Main_File_Menu.htm#dictionaryLookup_pref">VisualText 
 preferences</a> located under the File Menu. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<h2>List of Commonly Used Online Dictionary Sites</h2>

<p>A list of commonly used online dictionary sites and the paths to their 
 search pages is given below. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->To 
 get access to one of these dictionaries, create an entry in the Dictionary 
 Lookup preferences under Name and copy the URL path into URL input panel. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;&nbsp;<!--kadov_tag{{</spaces>}}-->To 
 create URL paths for other dictionaries, follow the steps outlined below.</p>

<!--(Table)=========================================================-->
<table x-use-null-cells
		wrapperparagraphselector=P
		style="width: 100%;
				x-border-left: 1px table-solid;
				x-border-top: 1px table-solid;
				x-border-right: 1px table-solid;
				x-border-bottom: 1px table-solid;
				border-spacing: 0px;
				margin-top: 14pt;"
		cellspacing=0
		width=100%
		border=1>
<col style="width: 20.946%;">
<col style="width: 79.054%;">

<tr>
<td style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=20.946%>
<p style="font-weight: bold;">Online Site</td>
<td style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=79.054%>
<p style="font-weight: bold;">URL Path</td></tr>

<tr>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=20.946%>
<p style="font-size: 10pt;"><span style="font-size: 10pt;"><b style="font-weight: bold;">Wordnet</b></span></td>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=79.054%>
<p style="margin-bottom: 0; font-size: 10pt;">http://www.cogsci.princeton.edu/cgi-bin/webwn/?stage=1&amp;word=</td></tr>

<tr>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=20.946%>
<p style="margin-bottom: 0;
			font-weight: bold;
			font-size: 10pt;"><b style="font-weight: bold;">Merriam Webster</b></td>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=79.054%>
<p style="margin-bottom: 0; font-size: 10pt;">http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&amp;va=</td></tr>

<tr>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=20.946%>
<p style="margin-bottom: 0;
			font-weight: bold;
			font-size: 10pt;"><b style="font-weight: bold;">Dictionary.com</b></td>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=79.054%>
<p style="margin-bottom: 0; font-size: 10pt;">http://www.dictionary.com/cgi-bin/dict.pl?term=</td></tr>

<tr>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=20.946%>
<p style="margin-bottom: 0;
			font-weight: bold;
			font-size: 10pt;"><b style="font-weight: bold;">Google</b></td>
<td colspan=1
	rowspan=1
	style="x-cell-content-align: TOP;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	width=79.054%>
<p style="margin-bottom: 0; font-size: 10pt;">http://www.google.com/search?btnG=Google+Search&amp;lr=lang_en&amp;as_q=</td></tr>
</table>

<!--(Table)=========================================================-->
<table x-use-null-cells
		wrapperparagraphselector=P
		style="width: 90%;
				border-spacing: 0px;
				margin-top: 14pt;"
		cellspacing=0
		width=90%>

<tr>
<td style="background-color: #FFFFD5;
			x-cell-content-align: TOP;
			width: 100%;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	bgcolor=#FFFFD5>
<p style="margin-bottom: 0;"><span style="font-weight: bold;"><font style="color: #000000;"
	color=#000000>Note</span>: The Google path returns pages for English 
 only.</font></td></tr>
</table>

<p style="font-size: 10pt;">Once set, the dictionaries can be accessed 
 from the main <a href="../../VisualText_Interface/Main_Tools_Menu.htm">Tools 
 Menu</a>, and from the Tools menu in both the <a href="../../Text_Tab_Popup.htm">Text 
 Tab Popup Menu</a> and the <a href="../../VisualText_Interface/Popups/Text_File_Popup.htm">Text 
 File Popup Menu</a>. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Dictionaries 
 can also be accessed from the <a href="../../VisualText_Interface/Tools/Attribute_Editor.htm">Attribute 
 Editor</a>. </p>

<h2 style="font-weight: normal;"><b style="font-weight: normal;">Constructing 
 Simple URLs</b></h2>

<p style="font-size: 10pt;">Constructing the URL for an online dictionary 
 requires some knowledge of CGIs, HTML and FORMS. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->If 
 you are familiar with these topics, constructing the URL path for an online 
 source is fairly routine. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->You 
 may want to familiarize yourself with these topics before trying to construct 
 a URL path.</p>

<p style="font-size: 10pt;">To construct the URL path that can be used 
 by Dictionary Lookup, you need to do three things:</p>

<ol>
	
	<li class=kadov-p
		style="/*begin!kadov{{*/ font-size: 10pt; font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><font style="font-size: 10pt;"
							size=2><span style="font-size: 10pt;">Discover 
 the CGI path of the online source;</span></font></li>
	
	<li class=kadov-p
		style="/*begin!kadov{{*/ font-size: 10pt; font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><font style="font-size: 10pt;"
							size=2><span style="font-size: 10pt;">Discover 
 the names of the variables that need to accompany the CGI to do the lookups;</span></font></li>
	
	<li class=kadov-p
		style="/*begin!kadov{{*/ font-size: 10pt; font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><font style="font-size: 10pt;"
							size=2><span style="font-size: 10pt;">Put the 
 word variable at the end of the URL you are constructing.</span></font></li>
</ol>

<p style="font-size: 10pt;">These steps are outlined below using the Google 
 website (http://www.google.com) as an example. </p>

<h3 style="font-weight: normal; color: #008080;"><b style="font-weight: normal;"><span 
 style="font-weight: normal;">Discover the CGI Path</span></b></h3>

<p style="font-size: 10pt;">The simplest way to discover the CGI path is 
 to do a search for a word on the desired site, and then look at the resulting 
 page's URL path found at the top of your browser. </p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p style="font-size: 10pt;">Type in the word <span 
 style="font-weight: bold;">baas</span> on the Google search page, and 
 hit the <span style="font-weight: bold;">Google Search</span> button.</p></li>
</ul>

<p><img src="Image228.gif"
		style="width: 408px;
				height: 193px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				margin-left: 18px;
				float: none;"
		width=408
		height=193
		border=0></p>

<p style="font-size: 10pt;">In the Address portion of the browser, the 
 desired URL is displayed. </p>

<p><img src="Image227.gif"
		style="width: 384px;
				height: 91px;
				margin-left: 18px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				float: none;"
		width=384
		height=91
		border=0></p>

<p style="font-size: 10pt;">The syntax for a CGI path specifies the name 
 for a CGI program just before the ? sign. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->In 
 this case, we find the CGI name to be &quot;search&quot;. </p>

<h3 style="color: #008080; font-weight: normal;">Discover Variable Names 
 to Accompany CGI</h3>

<p style="font-size: 10pt;">Variables for word lookup are specified after 
 the question mark &quot;?&quot;. <!--kadov_tag{{<spaces>}}-->&nbsp;&nbsp;<!--kadov_tag{{</spaces>}}-->Key-value 
 pairs can be found separated by the ampersand character &quot;&amp;&quot;. 
 Each key-value pair is further separated by an equal sign &quot;=&quot;. 
 </p>

<p style="font-size: 10pt;">The first key-value pair (q=baas) is our search 
 term &quot;baas&quot; and the second key-value pair (btnG=Google+Search) 
 is the Google convention used to indicate an unknown key-value pair. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<p style="font-size: 10pt;">From the URL in the Address portion of the 
 browser above, we have determined the following:</p>

<ul>
	
	<li class=kadov-p
		class=kadov-p><font style="font-size: 10pt;"
							size=2><b style="font-weight: bold; font-size: 10pt;"><span 
 style="font-size: 10pt;">URL Path</b>: http://www.google.com/ </span></font></li>
	
	<li class=kadov-p
		class=kadov-p><font style="font-size: 10pt;"
							size=2><b style="font-weight: bold; font-size: 10pt;"><span 
 style="font-size: 10pt;">CGI Path Name</b>: search </span></font></li>
	
	<li class=kadov-p
		class=kadov-p><font style="font-size: 10pt;"
							size=2><b style="font-weight: bold; font-size: 10pt;"><span 
 style="font-size: 10pt;">Word key-value pair:</b> q=bass </span></font></li>
	
	<li class=kadov-p
		class=kadov-p><font style="font-size: 10pt;"
							size=2><b style="font-weight: bold; font-size: 10pt;"><span 
 style="font-size: 10pt;">Unknown key-value pair:</b> btnG=Google+Search</span></font></li>
</ul>

<p style="font-size: 10pt;">The plus sign &quot;+&quot; in the last key-value 
 pair is a CGI convention for a &quot;space&quot; or &quot;blank&quot; 
 character.</p>

<h3 style="color: #008080; font-weight: normal;">Put Word Variable at End 
 of URL</h3>

<p style="font-size: 10pt;">To construct the URL in a format that can be 
 used by Dictionary Lookup, we need to rearrange the order of the key-value 
 pairs. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 value for the word key-value pair must be removed and it must be placed 
 at the end of path. </p>

<p style="font-size: 10pt;">In our Google example, we discovered that the 
 word key-value pair is q=bass. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 &quot;bass&quot; portion of the key-value pair must be removed, and &quot;q=&quot; 
 should be placed at the end of our URL. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 unknown key-value pair along with the CGI <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->name 
 can stay in the same position. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 resulting URL looks like this:</p>

<p style="font-size: 10pt; margin-left: 18pt;">http://www.google.com/search?btnG=Google+Search&amp;q=</p>

<!--(Table)=========================================================-->
<table x-use-null-cells
		wrapperparagraphselector=P
		style="width: 90%;
				border-spacing: 0px;
				margin-top: 14pt;"
		cellspacing=0
		width=90%>

<tr>
<td style="background-color: #FFFFD5;
			x-cell-content-align: TOP;
			width: 100%;
			padding-left: 2px;
			padding-top: 2px;
			padding-right: 2px;
			padding-bottom: 2px;"
	valign=top
	bgcolor=#FFFFD5>
<p style="margin-bottom: 0;"><span style="font-weight: bold;">Note</span>: 
 R<span style="font-size: 10pt;">emember to put the question mark after 
 the CGI Path Name and an ampersand &quot;&amp;&quot; between the key-value 
 pairs.</span></td></tr>
</table>

<p style="font-size: 10pt;">When you copy the URL into the Dictionary Lookup 
 preference and give it the name Google, Google becomes one of the dictionaries 
 listed in the list of dictionary choices, allowing you access Google directly 
 from within VisualText.</p>

<h2><b style="font-weight: normal;">Constructing Advanced URLs</b></h2>

<p style="font-size: 10pt;">To construct URLs for advanced or more complicated 
 searches such as returning only pages in English, you will have to add 
 additional information to the URL path. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->This 
 information can be extracted from the HTML and FORMS used to create the 
 webpage. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Often 
 it is necessary to use HTML and FORMS since it is difficult to extract 
 key-value pair information as we did above for simple searches.</p>

<p style="font-size: 10pt;"><span style="font-size: 10pt;">To illustrate 
 how you can extract this information, we will use the same Google example 
 and create a URL for searches that are restricted to English pages only. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->(The Google 
 search page is located at http://www.google.com)</span></p>

<h2>Google Advanced Search and CGI Path</h2>

<ol style="list-style: decimal;"
	type=1>
	
	<li style="/*begin!kadov{{*/ font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><p style="font-size: 10pt;">From the Google search 
 page, click on &quot;Advanced Search&quot;. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p></li>
	
	<li style="/*begin!kadov{{*/ font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><p style="font-size: 10pt;">Type in the word <span 
 style="font-weight: bold;">baas</span> and restrict the search to return 
 only pages written in <span style="font-weight: bold;">English</span>. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->(We have 
 also restricted the search to 10 results.)</p></li>
</ol>

<p><img src="Image229.gif"
		style="width: 442px;
				height: 141px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				margin-left: 18px;
				float: none;"
		width=442
		height=141
		border=0></p>

<ol start=3
	style="list-style: decimal;"
	type=1>
	
	<li style="/*begin!kadov{{*/ font-size: 10pt; /*}}end!kadov*/ "
		class=kadov-p><p style="font-size: 10pt;">Submit the query and 
 inspect the Address portion of the browser. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p></li>
</ol>

<p style="font-size: 10pt;">The CGI path is quite long and trying to discover 
 what key-value pairs are needed to restrict the search to English pages 
 only will be very difficult. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->To 
 find out what part of the CGI path is used to specify only English pages, 
 you can use the View Source option on the browser to inspect the HTML 
 source code.</p>

<h2>Using View Source</h2>

<p style="font-size: 10pt;">The HTML source code can be viewed for the 
 webpage by right-clicking on the webpage and selecting View Source from 
 the menu options. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->You 
 can search for the specific FORM items you are trying to restrict. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p style="font-size: 10pt;">Right-click on the browser 
 window and Select <span style="font-weight: bold;">View Source</span>. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The source 
 code for the webpage is displayed.</p></li>
</ul>

<p style="font-size: 10pt;">First, we need to verify the key name for the 
 search word. Sometimes, it will be the same as for the simple search. 
 However, depending on the CGI, the name may be different. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p style="font-size: 10pt;">Search for the FORM item, 
 <span style="font-weight: bold;">INPUT</span>. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p></li>
</ul>

<p><img src="Image230.gif"
		style="width: 433px;
				height: 31px;
				margin-left: 18px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				float: none;"
		width=433
		height=31
		border=0></p>

<p style="font-size: 10pt;">The key name for the word field is <span style="font-weight: bold;">as_q</span>. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->Recall, 
 that the key name used for the simple search is simply <span style="font-weight: bold;">q</span>. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<p style="font-size: 10pt;">Next, we need to find the SELECT form item 
 for the pulldown menu that will specify a particular language. </p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p style="font-size: 10pt;">Search for <span style="font-weight: bold;">SELECT</span>.<span 
 style="font-weight: bold;"> <!--kadov_tag{{<spaces>}}-->&nbsp;</span><!--kadov_tag{{</spaces>}}-->(The 
 first SELECT form item deals with the number of results. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->The 
 SELECT item for language is second.)</p></li>
</ul>

<p><img src="Image232.gif"
		style="width: 152px;
				height: 28px;
				margin-left: 18px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				float: none;"
		width=152
		height=28
		border=0></p>

<p style="font-size: 10pt;">The key name for the language SELECT form is 
 <span style="font-weight: bold;">lr</span>.</p>

<p style="font-size: 10pt;">To find out what key is used to specify English 
 as the desired language we must search for OPTION. <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<ul style="list-style: disc;"
	type=disc>
	
	<li class=kadov-p><p style="font-size: 10pt;">Under SELECT look for 
 <span style="font-weight: bold;">OPTION</span> value that specifies English. 
 </p></li>
</ul>

<p><img src="Image235.gif"
		style="width: 265px;
				height: 22px;
				margin-left: 18px;
				margin-right: 0px;
				margin-top: 0px;
				margin-bottom: 0px;
				float: none;"
		width=265
		height=22
		border=0></p>

<p style="font-size: 10pt;">This gives us the needed value for restricting 
 our search to English: <span style="font-weight: bold;">lang_en</span>. 
 We put this together with the SELECT key name &quot;lr&quot; and we get: 
 <b>lr=lang_en</b>.</p>

<p style="font-size: 10pt;">With these three pieces of information, advanced 
 search value, select language value, language option value, you can specify 
 a URL in Dictionary Lookup which specifies pages in English for Google. 
 <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--></p>

<p style="font-size: 10pt; margin-left: 18pt;">http://www.google.com/search?btnG=Google+Search&amp;lr=lang_en&amp;as_q=</p>

</body>

</html>
