⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calcdist

📁 Trolltech公司发布的图形界面操作系统。可在qt-embedded-2.3.10平台上编译为嵌入式图形界面操作系统。
💻
字号:
#!/usr/bin/perl# Usage:  cat dictionaries | grep -v '[^a-z]' | calcdist n score##   Given a lot of words, find an appropriate distribution#   into n tiles with tile values proportional to the square root#   of the ratio of score to the tile's frequency.$n = shift;$score = shift;while (<>) {    chomp;    for $c ( split "", $_ ) {	$freq{$c}++;	$t++;    }}for $c ( sort { $freq{$a} <=> $freq{$b} } keys %freq ) {    #print "$c: $freq{$c}\n";    $need = int($freq{$c}*$n/$t+0.5) || 1;    $value = int(sqrt($score/($freq{$c}*$n/$t))+0.5) || 1;    $t -= $freq{$c};    $n -= $need;    print "$need $c $value\n";}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -