This question is based on @StevenB.Segletes' patch for titlecaps
found here: Reformatting a Paragraph Consisting Entirely of Capital Letters
Consider the code:
\documentclass[12pt]{article}
\usepackage{titlecaps,xpatch}
\usepackage{newpxtext} % for bold small caps
\def\explowerchar#1{%
\ifcase\numexpr`#1-`A\relax
a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or
n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
#1\fi
}
\makeatletter
\xpatchcmd{\title@string}{\@thestring#2}{\@thestring\explowerchar{#2}}{}{}
\makeatother
\begin{document}
\thispagestyle{empty}
This is a paragraph in which the first letter of each word is lower case beginning with the second word of each sentence. Applying the algorithm, the same paragraph is produced with every word capitalized.
\vspace{15pt}
\noindent \textbf{\scshape{After Applying the Algorithm:}}
\vspace{10pt}
\titlecap{This is a paragraph in which the first letter of each word is lower case beginning with the second word of each sentence. Applying the algorithm, the same paragraph is produced with every word capitalized.}
\end{document}
which produces
QUESTION: How may the patched algorithm be modified in order to prevent capitalization of words such as "is," "a," "on," "the," "of," "with" that are not the first word of a sentence?
Thank you.