小编Ami*_*mir的帖子

在Octave中声明函数时未定义的参数

在尝试定义我自己的随机生成器函数时,我得到未定义的变量/参数.

码:

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)

function octave

8
推荐指数
1
解决办法
3204
查看次数

在大文本文件中使用 nltk 进行句子切分

我需要用来nltk.sent_tokenize()从大文本文件中提取句子。文件大小从 1MB 到 400MB 不等,因此不可能完全加载文件,因为内存限制,我认为不可能nltk.sent_tokenize()逐行使用和读取文件。

你建议怎么做这个任务?

python tokenize nltk

0
推荐指数
1
解决办法
2308
查看次数

标签 统计

function ×1

nltk ×1

octave ×1

python ×1

tokenize ×1