in reply to find words around a word in a file.
$count{$thisword}{$previousword}++; $count{$previousword}{$thisword}++;
Do this for every word. That's it. Also you have two options: Handle '.' as a distinct word and words over sentence-boundaries won't be neighbors. Or ignore '.' and words will be neighbors even if they are in different sentences
|
|---|