Skip to content

Commit

Permalink
文本分类数据集加载显示进度
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 16, 2017
1 parent b8a65fe commit 28a790c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ public IDataSet load(String folderPath, String charsetName, double percentage) t
e = files.length;
}

int logEvery = (int) Math.ceil((e - b) / 10000f);
for (int i = b; i < e; i++)
{
add(folder.getName(), TextProcessUtility.readTxt(files[i], charsetName));
if (i % 100 == 0)
logger.out("%.2f%%...", MathUtility.percentage(i - b, e - b));
if (i % logEvery == 0)
{
logger.out("%c[%s]...%.2f%%", 13, category, MathUtility.percentage(i - b + 1, e - b));
}
}
logger.out(" %d 篇文档\n", e - b);
}
Expand Down

0 comments on commit 28a790c

Please sign in to comment.