On 17 May 2012 15:45, M. S. Hrishikesh <
hri...@gmail.com> wrote:
> This is English text so spaces mark words. So what I really want it given a
> string of specific words, I am trying to figure out how many words will fit
> in a frame.
Do it iteratively: start at one word, keep doubling until you
overshoot, then bisect.
E.g. for the string "The quick brown fox jumps over the lazy dog".
Try fitting "The" into the frame -> fits
Try fitting "The quick" -> fits
Try fitting "The quick brown fox" -> fits
Try fitting "The quick brown fox jumps over the lazy" -> doesn't fit
Try fitting "The quick brown fox jumps over" -> fits
Try fitting "The quick brown fox jumps over the" -> gives you the answer.
H