<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic making all possible combinations of all words from a given string(N-Grams Concept) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322103#M71232</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to get all combinations of words in preceding order available in a given string e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Suppose I have a string &amp;nbsp;like "The cow jumps over the moon"&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;and want combinations like..&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The cow&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The jumps&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The Moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow jumps&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;over the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;over moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;the moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;please help me to achieve the same..&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;I m trying the following code:&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;sen = "The cow jumps over the moon";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data test1;&lt;BR /&gt;set test;&lt;BR /&gt;length sen1 $100.;&lt;BR /&gt;sen1="";&lt;BR /&gt;retain sen1;&lt;BR /&gt;do i=0 to count(compbl(TRIM(sen))," ");&lt;BR /&gt; do j=1 to 2;&lt;BR /&gt; sen1=compbl(sen1||" "||compbl(trim(scan(compbl(TRIM(sen)),i+j," ","MO"))));&lt;BR /&gt; ngram= j;&lt;BR /&gt;r=count(TRIM(sen)," ");&lt;BR /&gt;x=count(compbl(TRIM(sen))," ");&lt;BR /&gt;output;&lt;BR /&gt; end;&lt;BR /&gt;sen1="";&lt;BR /&gt;end;&lt;BR /&gt;if ngram=2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thnx&lt;/P&gt;
&lt;P&gt;Rahul&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 11:39:35 GMT</pubDate>
    <dc:creator>Rahul_SAS</dc:creator>
    <dc:date>2017-01-03T11:39:35Z</dc:date>
    <item>
      <title>making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322103#M71232</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to get all combinations of words in preceding order available in a given string e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Suppose I have a string &amp;nbsp;like "The cow jumps over the moon"&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;and want combinations like..&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The cow&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The jumps&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;The Moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow jumps&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;cow moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps over&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;jumps moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;over the&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;over moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;the moon&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;please help me to achieve the same..&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;I m trying the following code:&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;sen = "The cow jumps over the moon";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data test1;&lt;BR /&gt;set test;&lt;BR /&gt;length sen1 $100.;&lt;BR /&gt;sen1="";&lt;BR /&gt;retain sen1;&lt;BR /&gt;do i=0 to count(compbl(TRIM(sen))," ");&lt;BR /&gt; do j=1 to 2;&lt;BR /&gt; sen1=compbl(sen1||" "||compbl(trim(scan(compbl(TRIM(sen)),i+j," ","MO"))));&lt;BR /&gt; ngram= j;&lt;BR /&gt;r=count(TRIM(sen)," ");&lt;BR /&gt;x=count(compbl(TRIM(sen))," ");&lt;BR /&gt;output;&lt;BR /&gt; end;&lt;BR /&gt;sen1="";&lt;BR /&gt;end;&lt;BR /&gt;if ngram=2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thnx&lt;/P&gt;
&lt;P&gt;Rahul&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 11:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322103#M71232</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-01-03T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322111#M71235</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data A;
  Input Text : $ Nr @@;
  Datalines;
The 1 cow 2 jumps 3 over 4 the 5 moon 6
;
&lt;BR /&gt;***2nd select did not really make sense ..*;
Proc SQL;
  Create Table B As
    Select a1.Text As Text1,a2.Text As Text2 From A a1,A a2
      Where a1.Nr lt a2.Nr ;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jan 2017 12:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322111#M71235</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2017-01-03T12:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322112#M71236</link>
      <description>&lt;P&gt;Using the data you already have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set test;&lt;/P&gt;
&lt;P&gt;nitems&amp;nbsp;= countw(sen);&lt;/P&gt;
&lt;P&gt;length combo $ 100;&lt;/P&gt;
&lt;P&gt;if nitems &amp;gt; 1;&lt;/P&gt;
&lt;P&gt;do i=1 to nitems - 1;&lt;/P&gt;
&lt;P&gt;do j=i+1 to nitems;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;combo = catx(' ', scan(sen, i), scan(sen, j));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 12:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/322112#M71236</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-03T12:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/471299#M120697</link>
      <description>&lt;P&gt;Hey dude I need your number. Your coding concept with SAS is really close to something that is pretty cool and I am willing to give you a % of the money my fully developed code is worth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4045380741&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 04:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/471299#M120697</guid>
      <dc:creator>maxweyrick</dc:creator>
      <dc:date>2018-06-19T04:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/471340#M120722</link>
      <description>&lt;P&gt;These message boards make it easy to send private messages.&amp;nbsp; But you have to enable that feature for your userid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you were talking to me, I know that I can't take on any new projects until the end of the summer.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 12:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/471340#M120722</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-06-19T12:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: making all possible combinations of all words from a given string(N-Grams Concept)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/495593#M130817</link>
      <description>&lt;P&gt;Yo dude if you make all possible combos with characters and numbers it would be worth even more as a software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 07:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/making-all-possible-combinations-of-all-words-from-a-given/m-p/495593#M130817</guid>
      <dc:creator>maxweyrick</dc:creator>
      <dc:date>2018-09-14T07:06:31Z</dc:date>
    </item>
  </channel>
</rss>

