Letter frequency: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 3,669: | Line 3,669: | ||
=={{header|SenseTalk}}== |
=={{header|SenseTalk}}== |
||
<lang sensetalk> |
<lang sensetalk> |
||
put file "~/Documents/addresses.csv" into source |
|||
repeat with each character of source |
|||
if it is a controlChar then next repeat -- skip control characters |
|||
if it is a lowercase then put "." after it -- make keys distinct |
|||
add 1 to counts.(it) |
|||
end repeat |
|||
repeat with each (theChar, count) in counts |
|||
put char 1 of theChar & " —> " & count |
|||
end repeat |
|||
</lang> |
</lang> |
||
Output: |
|||
<pre> |
|||
—> 2862 |
|||
" —> 11180 |
|||
# —> 109 |
|||
& —> 58 |
|||
, —> 5646 |
|||
- —> 2009 |
|||
. —> 1629 |
|||
/ —> 1000 |
|||
0 —> 1496 |
|||
1 —> 1665 |
|||
2 —> 1487 |
|||
3 —> 1481 |
|||
4 —> 1405 |
|||
5 —> 1416 |
|||
6 —> 1260 |
|||
7 —> 1499 |
|||
8 —> 1323 |
|||
9 —> 1349 |
|||
: —> 500 |
|||
@ —> 500 |
|||
_ —> 127 |
|||
A —> 558 |
|||
a —> 4082 |
|||
B —> 290 |
|||
b —> 455 |
|||
C —> 572 |
|||
c —> 2387 |
|||
D —> 273 |
|||
d —> 1230 |
|||
E —> 265 |
|||
e —> 4493 |
|||
F —> 177 |
|||
f —> 392 |
|||
G —> 146 |
|||
g —> 911 |
|||
H —> 239 |
|||
h —> 1699 |
|||
I —> 235 |
|||
i —> 2935 |
|||
J —> 212 |
|||
j —> 147 |
|||
K —> 131 |
|||
k —> 646 |
|||
L —> 302 |
|||
l —> 2602 |
|||
M —> 428 |
|||
m —> 1912 |
|||
N —> 319 |
|||
n —> 3237 |
|||
O —> 136 |
|||
o —> 4018 |
|||
P —> 294 |
|||
p —> 1141 |
|||
Q —> 6 |
|||
q —> 228 |
|||
R —> 288 |
|||
r —> 3124 |
|||
S —> 600 |
|||
s —> 2229 |
|||
T —> 196 |
|||
t —> 3328 |
|||
U —> 21 |
|||
u —> 899 |
|||
V —> 65 |
|||
v —> 508 |
|||
W —> 222 |
|||
w —> 1937 |
|||
X —> 34 |
|||
x —> 153 |
|||
Y —> 99 |
|||
y —> 858 |
|||
Z —> 14 |
|||
z —> 145 |
|||
</pre> |
|||
=={{header|Sidef}}== |
=={{header|Sidef}}== |