Jump to content

Word frequency: Difference between revisions

no edit summary
m (→‎{{header|Phix}}: added syntax colouring the hard way)
No edit summary
Line 2,176:
 
Var L=loadfile("rosettalesmiserables.txt")
L=lcase(L)
'get deliminators
for n as long=1 to 96
Line 2,187 ⟶ 2,188:
 
string_split(L,deliminators,s())
 
For n As Long=Lbound(s) To ubound(s)'lower case
s(n)=lcase(s(n))
Next
 
quicksort(s(),lbound(s),ubound(s))
Line 2,208 ⟶ 2,205:
print "frequency","word"
print
for n as long=lbound(t) to lbound(t)+109
print t(n).l,t(n).s
next
Line 2,219 ⟶ 2,216:
<pre>
I saved and reloaded the file as ascii text.
 
frequency word
 
3667241098 the
1962419955 of
1408214939 and
1358614557 a
1354313953 to
1152411219 hein
102759648 in he
85458621 was
73257923 that
71296660 hisit
 
6360 is
time for operation 1.11089929996524099869600031525 seconds
 
time for operation 1.11089929996524 seconds
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.