{"id":863,"date":"2018-03-11T05:16:39","date_gmt":"2018-03-11T05:16:39","guid":{"rendered":"http:\/\/www.rangakrish.com\/?p=863"},"modified":"2018-03-12T10:05:56","modified_gmt":"2018-03-12T10:05:56","slug":"kangaroo-words","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2018\/03\/11\/kangaroo-words\/","title":{"rendered":"Kangaroo Words"},"content":{"rendered":"<p>According to <a href=\"https:\/\/en.wikipedia.org\/wiki\/Kangaroo_word\" target=\"_blank\" rel=\"noopener\">Wikipedia<\/a>, <strong><em>&#8220;A kangaroo word is a word that contains letters of another word, in order, with the same meaning. For example: the word &#8216;masculine&#8217; contains the word &#8216;male&#8217;, which is a synonym of the first word; similarly, the word &#8216;observe&#8217; contains its synonym &#8216;see&#8217;.&#8221;<\/em><\/strong><\/p>\n<p>Interesting idea. The key point to note is that the contained word must have similar meaning; it cannot be any arbitrary word. <em><strong>iLexicon<\/strong><\/em> has special annotations for such <em><strong>kangaroo<\/strong><\/em> words, and that is the focus of today&#8217;s post.<\/p>\n<p>Let us first check if <em><strong>iLexicon<\/strong><\/em> knows that <em><strong>masculine<\/strong><\/em> is a kangaroo word.<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(10): (kangaroo-get-contained-words &#8220;masculine&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;male&#8221;)<\/span><\/p>\n<p>The function <b><i>kangaroo-get-contained-words<\/i><\/b> takes a word and returns one or more words with similar meaning, if the given word is a kangaroo word. If the given word is not a kangaroo word, the function returns nil.<\/p>\n<p>What about the other example mentioned in Wikipedia: <b><i>observe<\/i><\/b>?<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(11): (kangaroo-get-contained-words &#8220;observe&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;see&#8221;)<\/span><\/p>\n<p>Let us try to give a word that is not a kangaroo word and check:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(12): (kangaroo-get-contained-words &#8220;zone&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">nil<\/span><\/p>\n<p>If you notice, the word <b><i>zone <\/i><\/b>contains another word within it: <b><i>one<\/i><\/b>, but that is not a synonym for <b><i>zone<\/i><\/b>. Hence it is not a kangaroo word.<\/p>\n<p>As you have seen in earlier posts, \u00a0<b><i>iLexicon <\/i><\/b>contains several interesting filters. Let us combine a couple of them with kangaroo word identification.<\/p>\n<p>The following retrieves 8-letter kangaroo words that are also onomatopoeic:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(13): (get-matching-words :kangaroo t :num-letters 8 :onomatopoeia 1)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;splatter&#8221; &#8220;splutter&#8221;)<\/span><\/p>\n<p>That is interesting! But how do we check if these words are kangaroo words?<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(14): (kangaroo-get-contained-words &#8220;splatter&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;spatter&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(15): (kangaroo-get-contained-words &#8220;splutter&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;utter&#8221; &#8220;sputter&#8221;)<\/span><\/p>\n<p>We can confirm that <em><strong>splatter<\/strong><\/em> and <em><strong>spatter<\/strong><\/em> are synonyms, and so are <em><strong>splutter<\/strong><\/em> and <em><strong>sputter<\/strong><\/em>. <b><i>iLexicon <\/i><\/b>includes <em><strong>utter<\/strong><\/em> as a sub-word of <em><strong>splutter<\/strong><\/em> because of close similarity, even though they are not exact synonyms.<\/p>\n<p>Here are a few more kangaroo words:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">cg-user(16): (loop for word in &#8216;(&#8220;diskette&#8221; &#8220;distressed&#8221; &#8220;dosage&#8221; &#8220;drugget&#8221; &#8220;fatigue&#8221;)<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">\u00a0 \u00a0 \u00a0 do (print (kangaroo-get-contained-words word)))<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;disk&#8221;)\u00a0<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;stressed&#8221;)\u00a0<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;dose&#8221;)\u00a0<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;rug&#8221;)\u00a0<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #008000;\">(&#8220;fag&#8221;)\u00a0<\/span><\/p>\n<p>These (and many more) kangaroo words are marked as such in <b><i>iLexicon <\/i><\/b>because they appear to be an interesting category of words. As of now, I cannot think of any special context or application where they can be directly used. I am sure something interesting will come up in future, and <b><i>iLexicon <\/i><\/b>will be great value addition at that point!<\/p>\n<p>Have a great weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>According to Wikipedia, &#8220;A kangaroo word is a word that contains letters of another word, in order, with the same meaning. For example: the word &#8216;masculine&#8217; contains the word &#8216;male&#8217;, which is a synonym of the first word; similarly, the word &#8216;observe&#8217; contains its synonym &#8216;see&#8217;.&#8221; Interesting idea. The key point to note is that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18,107,17],"tags":[130,137],"class_list":["post-863","post","type-post","status-publish","format-standard","hentry","category-lisp","category-natural-language-processing","category-programming","tag-ilexicon","tag-kangaroo-word"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-dV","jetpack-related-posts":[{"id":1711,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/09\/01\/poetry-in-prolog-part-2\/","url_meta":{"origin":863,"position":0},"title":"Poetry in Prolog: Part-2","author":"admin","date":"September 1, 2019","format":false,"excerpt":"In an earlier post, I showed how Prolog can be used to generate poetry, making use of my \"iLexicon\". I want to continue the discussion today by giving another example, this time based on the theme of sounds emitted by various animals and birds. As hinted in my previous articles,\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"The DCG Grammar","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/code.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1727,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/09\/15\/exploring-word-patterns\/","url_meta":{"origin":863,"position":1},"title":"Exploring Word Patterns","author":"admin","date":"September 15, 2019","format":false,"excerpt":"Working with word patterns can be an exciting (and challenging) creative activity. Such patterns come into picture while playing word games, solving word puzzles or even writing poetry. It is precisely to facilitate such tasks that I am building my \"iLexicon\" system.\u00a0 One popular word game goes like this: The\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"Prolog Predicates for Word Pair Generation","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/Code.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/Code.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/09\/Code.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":846,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/02\/11\/onomatopoeia-palindrome-and-semordnilap\/","url_meta":{"origin":863,"position":2},"title":"Onomatopoeia, Palindrome and Semordnilap","author":"admin","date":"February 11, 2018","format":false,"excerpt":"I had earlier\u00a0briefly talked about the Ilexicon project that I have been working on for some time now. The goal is to build an intelligent dictionary\u00a0that will come in handy while implementing NLP applications such as recognizers and generators. In today's post, I want to demonstrate some cool features available\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":856,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/02\/25\/sentiments-and-emotions-in-ilexicon\/","url_meta":{"origin":863,"position":3},"title":"Sentiments and Emotions in iLexicon","author":"admin","date":"February 25, 2018","format":false,"excerpt":"Detecting sentiments and emotions in a piece of text are frequently performed activities in Text analysis. There are some API services available for this. For example, meaningcloud.com \u00a0has an API for detecting sentiments in the text submitted to it. Another API service provider is aylien.com . Emotion detection for text\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2315,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/14\/litedb-a-nosql-database-for-net\/","url_meta":{"origin":863,"position":4},"title":"LiteDB: A NoSQL Database for .NET","author":"admin","date":"February 14, 2021","format":false,"excerpt":"I have been looking around for a compact embedded NoSQL database library for .NET, to use as the back-end of my \"iLexicon\" system. \"iLexicon\" is written in Lisp and Prolog (I have written a few articles\u00a0on it before). At present, the entire dictionary component (containing over 300,000 word entries) is\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.rangakrish.com\/index.php\/category\/programming\/"},"img":{"alt_text":"Using Package Manager to Install LiteDB","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager-300x98.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager-300x98.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/Package-Manager-300x98.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1410,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/01\/27\/generating-poetry-using-ilanggen\/","url_meta":{"origin":863,"position":5},"title":"Generating Poetry Using iLangGen","author":"admin","date":"January 27, 2019","format":false,"excerpt":"In an earlier article, I wrote about using iLangGen to generate natural language text. iLangGen is a powerful text generation library that I have been working on over the years. Today, I would like to show how we can use that library to generate \"poetry\". Be warned, however, that the\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Sample Output 2","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/01\/Output2.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=863"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/863\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}