Phonetically Morphing Symbols
I have been learning Spanish lately.
People say learning Spanish is easy. I disagree. I am glad that I learned German half my life ago, otherwise I would feel at this point that I'm just not cut out to learn a "foreign" language. I find Spanish at least as difficult to master as German. Perhaps because I am a native English speaker, and English is a Germanic language (not a Latin-based, "romance" language).
At any rate, one of the roadblocks to speaking Spanish correctly is that the pronunciation, while much more internally consistent than English, differs significantly from that of my mother tongue ("h" is always silent, "J" is pronounced as "h", etc.). As an aid to visualize how Spanish text should be pronounced, I wrote a method that receives Spanish text and returns the phonetic equivalent.
The code is this:
private string getPhoneticSpanish(string spanTxt)
{
String spanishText = spanTxt;
spanishText = spanishText.Replace("cc", "ks");
spanishText = spanishText.Replace("ll", "y");
spanishText = spanishText.Replace("H", string.Empty);
spanishText = spanishText.Replace("ch", "CH");
spanishText = spanishText.Replace("h", string.Empty);
spanishText = spanishText.Replace("que", "kay");
spanishText = spanishText.Replace("e", "A");
spanishText = spanishText.Replace(" y ", " E ");
spanishText = spanishText.Replace("i", "E");
spanishText = spanishText.Replace("j", "h");
spanishText = spanishText.Replace("ñ", "ny");
spanishText = spanishText.Replace("q", "k");
spanishText = spanishText.Replace("u", "oo");
spanishText = spanishText.Replace("z", "s");
spanishText = spanishText.Replace("c", "k");
spanishText = spanishText.Replace("ke", "se");
spanishText = spanishText.Replace("ki", "si");
spanishText = spanishText.Replace("ge", "h");
spanishText = spanishText.Replace("gi", "h");
spanishText = spanishText.Replace("CH", "ch");
return spanishText;
}
...and you can call it like so:
string spanishText = "Hablo mucho. . .";
MessageBox.Show(getPhoneticSpanish(spanishText));
So, if you pass this text (from here):
Huckleberry Finn comienza donde se quedaron las cosas después de Las Aventuras de Tom Sawyer. Huck y Tom Sawyer se habían hecho ricos por todo el tesoro que descubrieron y la Viuda Douglas adoptó a Huck. Ella trata de civilizar a Huck en muchas formas diferentes, incluyendo darle ropa limpia y nueva, enseñándole acerca de Dios y la Biblia, y tratando de educarlo en cosas como la escritura y la lectura. La hermana de la Viuda Douglas, la Señorita Watson, incluso tratar de ayudar. Huck no se sienten cómodo con sus costumbres civilizadas, él sólo quiere estar con sus trapos viejos y fumar.
...this is what is returned:
It looks like some sort of haywire Finnish dialect, but it's really American English-ized Mexican Spanish.
This snippet can no doubt be improved; feel free to do so, and post your improvements back here or email them to me at b clay shannon (all one word) at att dot net
I am in the process of morphing from a software developer into a portrayer of Mark Twain. My monologue (or one-man play, entitled "The Adventures of Mark Twain: As Told By Himself" and set in 1896) features Twain giving an overview of his life up till then. The performance includes the relating of interesting experiences and humorous anecdotes from Twain's boyhood and youth, his time as a riverboat pilot, his wild and woolly adventures in the Territory of Nevada and California, and experiences as a writer and world traveler, including recollections of meetings with many of the famous and powerful of the 19th century - royalty, business magnates, fellow authors, as well as intimate glimpses into his home life (his parents, siblings, wife, and children).
Peripatetic and picaresque, I have lived in eight states; specifically, besides my native California (where I was born and where I now again reside) in chronological order: New York, Montana, Alaska, Oklahoma, Wisconsin, Idaho, and Missouri.
I am also a writer of both fiction (for which I use a nom de plume, "Blackbird Crow Raven", as a nod to my Native American heritage - I am "½ Cowboy, ½ Indian") and nonfiction, including a two-volume social and cultural history of the U.S. which covers important events from 1620-2006: http://www.lulu.com/spotlight/blackbirdcraven