[問題] n-gram在subroutine裡

看板Perl作者 (cis122)時間13年前 (2011/11/28 06:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
mysubroutine.pl中已經寫好bigram所以可以執行而output為 This is is a .... 接著要從bigram那個修改成n-gram require 'mysubroutine.pl'; $sample = "This is a sample text"; print join ("\n",&Ngrams(3, $sample)); 在sub裡面 要設定N的值 還得output出來為 This is a a sample text 不知道怎麼寫 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 74.77.107.117
文章代碼(AID): #1EqhMQ52 (Perl)
文章代碼(AID): #1EqhMQ52 (Perl)