Checking start and end of text for word frequency.