in reply to need help in extending the code
#!/usr/bin/perl -w use strict; my $x= "it is not probably that it is the end"; my @ngram; my @wds = split(' ',$x); while (@wds>=3) { push @ngram, join(" ",@wds[0..2]); shift @wds; } print join("\n",@ngram),"\n"; __END__ it is not is not probably not probably that probably that it that it is it is the is the end
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: need help in extending the code
by sarvan (Sexton) on Jul 28, 2011 at 04:12 UTC | |
by Anonymous Monk on Jul 28, 2011 at 05:36 UTC | |
by Marshall (Canon) on Jul 28, 2011 at 04:57 UTC |
In Section
Seekers of Perl Wisdom