changing out letters and adding symbols
in
Programming Questions
•
4 months ago
Hi! I'm very new at Processing, and would appreciate some help!
What I'm trying to do is to make a pronunciation-translation code. I want to find certain characters in a textfile and replace them with others. I would also like to put in certain symbols on top of the letter.
Soo.. What I want to do is change the first letters to the second ones.
O -- Å
CCH -- KK
CH -- K
CI -- TSJI
CCI -- TSJI
GLI -- JLI
U -- O
ZI -- DZI
CCE -- TSHE
CE -- TSHE
GI -- DJI
GGI -- DJI
GE -- DJE
GGE -- DJE
After that I want to place a symbol on top, with size varying on the length of the word the letters are placed in.
This is the code I have so far, so as you can see, I need some help. hehe
PFont f;
void setup(){
size(500,700);
background(255);
noStroke();
smooth();
noLoop();
// load
f= loadFont ("Lane-Narrow-20.vlw");
}
// variables
int yp=80;
void draw(){
String quote1[] = loadStrings("BM1.txt");
//Decides the font and the fill color.
textFont (f,20);
fill(0);
for (int c=0; c<quote1.length; c++) {
String[] words = split(quote1[c], ' ');
println(words);
char[] chars = quote1[c].toCharArray();
println(chars);
}
for (int i=0; i<quote1.length; i++){
text((quote1[i]),40,yp);
yp=yp+40;
}
noLoop();
}
Hope someone would like to help me, it would be much appreciated
1