{"id":11533,"date":"2015-01-15T05:08:15","date_gmt":"2015-01-14T18:08:15","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11533"},"modified":"2015-01-15T05:08:15","modified_gmt":"2015-01-14T18:08:15","slug":"english-word-association-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-association-game-primer-tutorial\/","title":{"rendered":"English Word Association Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"English Word Association Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.jpg\" title=\"English Word Association Game Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">English Word Association Game Primer Tutorial<\/p><\/div>\n<p>With yesterday&#8217;s <a target=_blank title='Yahoo YQL Web Service JSON Thesaurus Tutorial' href='#yywsjtt'>Yahoo YQL Web Service JSON Thesaurus Tutorial<\/a>, using Yahoo Web Services called YQL, as shown below, building on previous ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>, we effectively signed off on the <span title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\">final<\/span> <i>(supplementing recent <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11513' title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\">PHP\/CSS Sentence Auxiliary Verb Game Tutorial<\/a> showing CSS #[elementID]:before { <a target=_blank title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/sel_before.asp'>content: [prefixContent];<\/a> } and #[elementID]:after { <a target=_blank title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_gen_content.asp'>content: [suffixContent];<\/a> } functionality presented on the day before yesterday)<\/i> impediment to writing an English Word Association game a teacher of <a target=_blank title='ESL information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/English_as_a_second_or_foreign_language'>ESL<\/a> could use for the teaching of <a target=_blank title='Vocabulary information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Vocabulary'>vocabulary<\/a> for an advanced student learning English as their second language (or maybe their first?!).   The YQL name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial builds on the logic of the thesaurus tutorial of yesterday to use a YQL web service into data emanating from its links to the <a target=_blank title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/'>altervista<\/a> thesaurus web service database with Yahoo YQL website &#8230; thanks.  For the altervista thesaurus database usage it is best to request a key for your web service queries.  You fill in a word (or two, or three) of interest to search for like-minded words.<\/p>\n<p>And what is a thesaurus?   Recap on yesterday, perhaps, by reading what Wikipedia says <a target=_blank title='Thesaurus information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Thesaurus'>here<\/a> but, basically, it can be thought of as a repository of a language&#8217;s list of words of a similar meaning to the word of your interest.   It is a great tool for people learning a language foreign to them, especially regarding their vocabulary.<\/p>\n<p>With word association, as you might imagine, a thesaurus comes in handy for the words associated with the original word and its chosen followers, but we need functionality like for <a target=_blank title='PHP\/Javascript Words Within Words Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=6490'>PHP\/Javascript Words Within Words Game Tutorial<\/a> to get that initial <i>&#8220;seed&#8221;<\/i> word chosen from a dictionary.<\/p>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=_blank title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php_GETME\">word_association.php<\/a> (and then there is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\" title=\"Click picture\">PHP live run<\/a>).<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>Again we use PHP and we hope this is not frustrating those readers who have no PHP installed?  It is easy to install PHP web server language (and Apache web server with MySql database) locally for Windows or Mac and would recommend, respectively,   <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1078' title='EasyPHP Windows Framework for PHP\/MySql Tutorial'>EasyPHP Windows Framework for PHP\/MySql Tutorial<\/a> and <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=532' title='MAMP Mac Framework for PHP\/MySql Tutorial'>MAMP Mac Framework for PHP\/MySql Tutorial<\/a> for (install) advice here.<\/p>\n<hr \/>\n<p id='yywsjtt'>Previous relevant <a target=_blank title='Yahoo YQL Web Service JSON Thesaurus Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11246'>Yahoo YQL Web Service JSON Thesaurus Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Thesaurus Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Thesaurus.jpg\" title=\"Yahoo YQL Web Service JSON Thesaurus Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Thesaurus Tutorial<\/p><\/div>\n<p>Here is a tutorial that might be re-introducing you to the Yahoo Web Services called YQL, building on previous ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the <a target=_blank title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/'>altervista<\/a> thesaurus web service database with Yahoo YQL website &#8230; thanks.  For the altervista thesaurus database usage it is best to request a key for your web service queries.  You fill in a word (or two, or three) of interest to search for like-minded words.<\/p>\n<p>And what is a thesaurus?   Read what Wikipedia says <a target=_blank title='Thesaurus information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Thesaurus'>here<\/a> but, basically, it can be thought of as a repository of a language&#8217;s list of words of a similar meaning to the word of your interest.   It is a great tool for people learning a language foreign to them, especially regarding their vocabulary.<\/p>\n<p>The two big PHP functions of use (as distinct from an Ajax approach, requiring no PHP &#8230; read on) for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended, but for today&#8217;s tutorial we do not use it, and take the opportunity to show you a solution using <a target=_blank title='Ajax information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Ajax_%28programming%29'>Ajax<\/a> that requires no PHP &#8230;  link to some downloadable Ajax inspired HTML programming source code which you may want to rename to <a target=_blank title='yql_thesaurus.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html-GETME\">Ajax_yql_thesaurus.html<\/a> which changes from the HTML supervising PHP approach as per <a target=_blank title='Ajax_yql_thesaurus.html changes' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html-GETME\">Ajax_yql_thesaurus.html<\/a> (and then there is an <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html\" title=\"Click picture\">Ajax live run<\/a>)<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+thesaurus+where+key%3D%22test_only%22+and+word%3D%22peace%22+and+language%3D%22en_US%22' title='YQL thesaurus help'>YQL thesaurus help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='yql_thesaurus.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.html_GETME\">yql_thesaurus.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='yql_thesaurus.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.php_GETME\">yql_thesaurus.php<\/a> (and then there is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.html\" title=\"Click picture\">PHP live run<\/a>).<\/p>\n<p>We thank the following free online dictionaries &#8230;<\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.thefreedictionary.com\/\">English<\/a><\/li>\n<li><a target=_blank title=\"French\" href=\"http:\/\/www.systranet.com\/dictionary\/\">French<\/a><\/li>\n<li><a target=_blank title=\"German\" href=\"http:\/\/www.dict.cc\/\">German<\/a><\/li>\n<li><a target=_blank title=\"Italian\" href=\"http:\/\/www.wordreference.com\/iten\/\">Italian<\/a><\/li>\n<li><a target=_blank title=\"Spanish\" href=\"http:\/\/www.wordreference.com\/es\/en\/translation.asp\">Spanish<\/a><\/li>\n<\/ul>\n<p>Stay tuned for an interesting blog posting tomorrow which combines the new thesaurus functionality of today&#8217;s contribution, along with the functionality <i>&#8220;smarts&#8221;<\/i> of yesterday&#8217;s <a target=_blank title='PHP\/CSS Sentence Auxiliary Verb Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11513'>PHP\/CSS Sentence Auxiliary Verb Game Tutorial<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11246' onclick='var dv=document.getElementById(\"d11246\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=dictionary\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11246' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11533' onclick='var dv=document.getElementById(\"d11533\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=thesaurus\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11533' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>With yesterday&#8217;s Yahoo YQL Web Service JSON Thesaurus Tutorial, using Yahoo Web Services called YQL, as shown below, building on previous ones here at this blog, we effectively signed off on the final (supplementing recent PHP\/CSS Sentence Auxiliary Verb Game &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-association-game-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13,15,37],"tags":[85,281,326,327,372,396,576,652,707,714,744,827,932,997,1269,1317,1319,1452,1454,1487,1491,1494],"class_list":["post-11533","post","type-post","status-publish","format-standard","hentry","category-elearning","category-esl","category-games","category-tutorials","tag-apache","tag-css","tag-dictionary","tag-did-you-know","tag-easyphp","tag-esl","tag-html","tag-javascript","tag-linux","tag-local-web-server","tag-mamp","tag-mysql","tag-php","tag-programming","tag-thesaurus","tag-tutorail","tag-tutorial","tag-word","tag-word-games","tag-yahoo","tag-yahoo-yql","tag-yql"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/11533"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=11533"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/11533\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=11533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=11533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=11533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}