阅读背景:

从可变长度文本文件中加权随机选择

来源:互联网 

I have a series of text files of various (and often changing) lengths. The data stored in the file is in a particular order from most common (top) to least (bottom). I want to randomly select a line from the file weighted towards the top entries - for example, if there are 322 entries in a file, line 1 would be 322 times more likely to be chosen than line 322.I have a series of text files of various (and o




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: