#!/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
In reply to Re: need help in extending the code
by Marshall
in thread need help in extending the code
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |