{"id":389,"date":"2010-02-04T17:16:21","date_gmt":"2010-02-04T23:16:21","guid":{"rendered":"http:\/\/www.tamarziv.com\/itp\/?p=389"},"modified":"2010-02-20T08:27:43","modified_gmt":"2010-02-20T14:27:43","slug":"w2-torbreck-australian","status":"publish","type":"post","link":"https:\/\/www.tamarziv.com\/itp\/w2-torbreck-australian\/","title":{"rendered":"W2-Torbreck Australian"},"content":{"rendered":"<p><strong>Torbreck Australian<\/strong><\/p>\n<blockquote><p>excellent. This deep<br \/>\ndrowning opens with a pleasant<br \/>\nwell<br \/>\ndrowning with this<br \/>\ndry and quite prolonged. This<br \/>\ndrowning the will enhance<br \/>\nthe need for more of it. I<\/p><\/blockquote>\n<p><!--more--><\/p>\n<p><strong>Description:<\/strong><br \/>\nThe program generates luscious, dry and full bodied poetry from wine reviews. It&#8217;s quite simple, and attempts to exploit the form of language used in this kind of writing and how one can quite simply push it into the realm of cheap romantic poetry. The program expects a text file, cuts the line after &#8220;is&#8221; is found and prints, if &#8220;is&#8221; is not found it searches for &#8220;wine&#8221; and replaces it with &#8220;drowning&#8221;, The resulting poem is then outputted into a text file. Source wine review is found <a href=\"http:\/\/www.kenswineguide.com\/wine.php?wine=2457\">here<\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<strong>Code:<\/strong><br \/>\n<\/br><\/br><\/p>\n<div class=\"codecolorer-container python default\" style=\"overflow:auto;white-space:nowrap;width:648px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/><\/div><\/td><td><div class=\"python codecolorer\"><span class=\"kw1\">import<\/span> <span class=\"kw3\">sys<\/span><br \/>\nsearchstr <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot; is &quot;<\/span><br \/>\nsearchstr2 <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot; wine &quot;<\/span><br \/>\n<span class=\"kw1\">for<\/span> line <span class=\"kw1\">in<\/span> <span class=\"kw3\">sys<\/span>.<span class=\"me1\">stdin<\/span>:<br \/>\n&nbsp; line <span class=\"sy0\">=<\/span> line.<span class=\"me1\">strip<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; offset <span class=\"sy0\">=<\/span> line.<span class=\"me1\">find<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot; is &quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; offset2 <span class=\"sy0\">=<\/span> line.<span class=\"me1\">find<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot; wine &quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; <span class=\"kw1\">if<\/span> searchstr <span class=\"kw1\">in<\/span> line:<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"kw1\">print<\/span> line<span class=\"br0\">&#91;<\/span>offset+<span class=\"nu0\">4<\/span>:<span class=\"br0\">&#93;<\/span><br \/>\n&nbsp; <span class=\"kw1\">elif<\/span> searchstr2 <span class=\"kw1\">in<\/span> line:<br \/>\n&nbsp; &nbsp; line <span class=\"sy0\">=<\/span> line.<span class=\"me1\">replace<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">'wine'<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">'drowning'<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">print<\/span> line<span class=\"br0\">&#91;<\/span>offset2+<span class=\"nu0\">1<\/span>:<span class=\"br0\">&#93;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<blockquote><p>excellent. This deep<br \/>\ndrowning opens with a pleasant<br \/>\nwell<br \/>\ndrowning with this<br \/>\ndry and quite prolonged. This<br \/>\ndrowning the will enhance<br \/>\nthe need for more of it. I<\/p><\/blockquote>\n<p>The program generates luscious, dry and full bodied poetry from wine reviews. The program expects a text file, cuts the line after &#8220;is&#8221; is found and prints, if &#8220;is&#8221; is not found it searches for &#8220;wine&#8221; and replaces it with &#8220;drowning&#8221;, The resulting poem is then outputted into a text file. Source wine review is found <a href=\"http:\/\/www.kenswineguide.com\/wine.php?wine=2457\">here<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-rwet","avhec_catgroup-all"],"_links":{"self":[{"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":16,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":434,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/posts\/389\/revisions\/434"}],"wp:attachment":[{"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tamarziv.com\/itp\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}