in reply to
A few grammar checks for strings
Many of the words in the so-called $prepositions list are NOT prepositions so the var name is poorly chosen; the more so since your code also faults the words' use at the end of a sentence. But (oops, I started a sentence with a preposition. Uh, no, it's a conjunction. That's still contrary to some of the so-called "best standards" but.... ah well.) let's look first at some of those words used first in a sentence:
- About 30% of all code is garbage.
- Beyond the hills lies the ocean.
- Following the calves were the wolves.
The last can be faulted for not using clearer construction, but passes muster for any strict test of grammar. The second is easy enough to defend at poetic, at worst and the first is a legitmate use of the passive voice to stress the asserted percentage.
As to ending sentences with your "prepositions," try this:
- "The bowl is 9 inches across."