Frequency counting and sizing
Input text is split into words, case is normalized so 'Apple' and 'apple' count as one term, and duplicates are tallied. Each unique word's tally is scaled against the highest-frequency word in the set to determine its font size, so size is always relative to the rest of your input, never an absolute scale.