by andy_threos_io · 5y ago · 0 comments
edit: Also the C implementation will get in infinite loop with more than 64k words
The constraints do say that it is okay to assume lines are reasonable length. But yes, if you were making GNU wordfreq, that might not be something you want to assume. But at that point, it just depends on what you want your failure mode to be I suppose. greps for example will happily just gobble up as much memory as they can to fit a line into memory. :-)