test word checking function.