The function can be used if one is interested in automatically applying a code to
paragraphs in a file based on certain words specified by 'pattern'.
It first splits the whole text into pieces which depend on the separator, then matches the pattern with each pieces. When a match is found, the piece is coded to the code specified by cid. The default separator defines paragraph as unit of analysis. The separator is passed to the pattern argument of gregexpr.
This function is also useful for keyword in context (KWIC) analysis.
# NOT RUN {codingBySearch("internet",fid=1,cid=2)
codingBySearch("internet",fid=getFileIds(),cid=2)
codingBySearch("internet",fid=getFileIds(),cid=2, seperator="[.!?]")
# }