Word frequency: Difference between revisions

m
→‎version 1: added a comment.
m (→‎version 1: changed some comments, optimized a DO loop.)
m (→‎version 1: added a comment.)
Line 284:
w=0 /*will be the maximum length of count. */
wr=max( length(' rank '), length(top) ) /*find the maximum length of the rank #*/
do d=1 for words(tl); _=word(tl, d) /*process each of the words in the TL. */
if d==1 then w=max(8, length(@._)) /*use length of the first number used. */
say right(@@._, 40) right(commas(tops), wr) right(commas(@._), w)
@._=0 /*nullify this word count for next time*/