(String label, int tokens, int window, int count)
| 520 | } |
| 521 | |
| 522 | private static String formatLine(String label, int tokens, int window, int count) { |
| 523 | double pct = window > 0 ? (double) tokens / window * 100 : 0; |
| 524 | String countLabel = count >= 0 ? String.format(" [%d 条]", count) : ""; |
| 525 | return String.format(" %-18s %8s (%4.1f%%)%s%n", |
| 526 | label + ":", formatTokens(tokens), pct, countLabel); |
| 527 | } |
| 528 | |
| 529 | private static String progressBar(double ratio, int width) { |
| 530 | ratio = Math.max(0, Math.min(1, ratio)); |
no test coverage detected