remove _ in names
This commit is contained in:
parent
829db87c40
commit
3af7344581
1270 changed files with 0 additions and 18916 deletions
|
|
@ -1,10 +0,0 @@
|
|||
proc entropy {str} {
|
||||
set log2 [expr log(2)]
|
||||
foreach char [split $str ""] {dict incr counts $char}
|
||||
set entropy 0.0
|
||||
foreach count [dict values $counts] {
|
||||
set freq [expr {$count / double([string length $str])}]
|
||||
set entropy [expr {$entropy - $freq * log($freq)/$log2}]
|
||||
}
|
||||
return $entropy
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue