You have copied 99% of the text of another question. According to the FAQs, plagiarism on SE is defined as
any copying and pasting of any amount of text or code that wasn't written by you is plagiarism if you try, explicitly or implicitly, to pass it off as your own work.
Of course, this definition is too strict and impractical, but I think most will agree that 99% is too much.
Aside from that issue, your question is (emphasis added by me)
Are there any rules I could build into the software that would enable me to know where "c" is to be pronounced as "th" and where as "s"?
Similary, are there any rules I could build into the software that would enable me to know where "s" is to be pronounced as "th" and where as "s"?
This is, in my opinion, an exact duplicate of the question Distribution of Spanish speakers regarding 's' and 'c' pronunciation, which has very detailed answers with maps of how "s" and "c" are pronounced in each Spanish-speaking region. These maps answer your question fully, and there is not much more we can say. This is a language site, so we are not going to write software.
As I prefer to let the community decide on closing questions, I did not close the question or even say that it should be closed. To help you find the answer, I added a comment with a link to the duplicate question that perfectly answers the question you posed (see bold above). Your reaction to this was to ignore the provided link and put a bounty on the question.
I suppose the downvotes are either because of plagiarism or because you are not satisfied with my provided link to an answer to the questions you wrote (so it is really unclear what you actually want to know). Maybe clarifying why the linked answers do not help you would be better than setting a bounty.