在尝试定义我自己的随机生成器函数时,我得到未定义的变量/参数.
码:
function result = myrand(n, t, p, d)
a = 200 * t + p
big_rand = a * n
result = big_rand / 10**d
return;
endfunction
mrand = myrand(5379, 0, 91, 4)
Run Code Online (Sandbox Code Playgroud)
错误:
>> myrand
error: 't' undefined near line 2 column 15
error: called from
myrand at line 2 column 7
Run Code Online (Sandbox Code Playgroud) 我需要用来nltk.sent_tokenize()从大文本文件中提取句子。文件大小从 1MB 到 400MB 不等,因此不可能完全加载文件,因为内存限制,我认为不可能nltk.sent_tokenize()逐行使用和读取文件。
你建议怎么做这个任务?