Spanglish Shakespeare

My script is loading a Shakespeare Sonnet and changing some of the words to their Spanish equivalent. The translation as a whole is not great because translation involves much more than one-to-one switches. It just shows the complexities of language. While there are definite rules in language, the rules are different in each language. For example, in English we can have a phrase that is article adjective noun (the big house), but in spanish it is article noun adjective (la casa grande).


String lines[];

void setup() {
  size(500, 500);
  background(0);
    lines = loadStrings("http://www.michelleboisson.com/dropbox/sonnet.txt");
  
  //println("there are " + lines.length + " lines"); 
  for (int i=0; i < lines.length; i++) { 
    println(lines[i]);
  }
  println("there are "+lines.length+" lines");

  for (int i=0; i < lines.length; i++) {
    lines[i] = lines[i].replace("love", "amour");
    lines[i] = lines[i].replace("should", "tener que");
    lines[i] = lines[i].replace("sweet", "dulce");
    lines[i] = lines[i].replace("beauty", "belleza");
    lines[i] = lines[i].replace("house", "casa");
    lines[i] = lines[i].replace("none", "nunca");
    lines[i] = lines[i].replace("know", "saber");
    lines[i] = lines[i].replace("father", "padre");

  }
  for (int i=0; i < lines.length; i++) { 
    println(lines[i]);
  }
  int y=0;
  for (int i = 0; i < lines.length; i++){
    //put the next line down 18 characters
    y = y + 28;
    text(lines[i], 10, y);
  } 
  
}

void loop() {
  
 // drawHeadlines(lines);
  
}
}

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.