`file` may not be a good name for this variable, since it is a string and not a reference to a file (at least it should be... if the caller passes in a reference to a file, that's their problem!). `text` would be a better name.

`split_string_to_array` is also not a great name since it emphasizes the internal workings of the method, rather than the data it returns. In general it's bad practice to put things like `array` or `hash` in your method and variable names. I called mine `normalized_words`, though it seems yours doesn't perform the normalization.