Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/java-speech-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkylion007 <dragonsrcool.aaron@gmail.com>2013-08-01 21:18:10 +0400
committerSkylion007 <dragonsrcool.aaron@gmail.com>2013-08-01 21:18:10 +0400
commit00aebc178def2382daea99cc98c17be3807d36e5 (patch)
treed8c10c9740086fca9c44349a10f6d46909c2efec
parentdeeb14b5ccca994cfa4989ae182cac8169cbbb70 (diff)
Code Cleanup
Shifted long if statement into boolean. Removed a non-unicode character from isEndingPunctuation method. Who is going to use this program for Sanskrit anyway?
-rw-r--r--src/com/darkprograms/speech/synthesiser/Synthesiser.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/darkprograms/speech/synthesiser/Synthesiser.java b/src/com/darkprograms/speech/synthesiser/Synthesiser.java
index 5dc3daf..b63a805 100644
--- a/src/com/darkprograms/speech/synthesiser/Synthesiser.java
+++ b/src/com/darkprograms/speech/synthesiser/Synthesiser.java
@@ -145,11 +145,19 @@ public class Synthesiser {
return input.length();
for(int i = 99; i>=0; i--){
char tmp = input.charAt(i);
- if( tmp == ' ' || tmp == '.' || tmp == '!' || tmp == '?' || tmp == ';' || tmp == ':' || tmp == '؟'
- || tmp == '|'){ //Ending punctuation for all languages according to Wikipedia
+ if(isEndingPunctuation(tmp){ //Ending punctuation for all languages according to Wikipedia
return i;
}
}
return -1;
}
+
+ /**
+ * Checks if char is an ending character
+ * @param The char you want check
+ * @return True if it is, false if not.
+ */
+ private boolean isEndingPunctuation(char input){
+ return tmp == ' ' || tmp == '.' || tmp == '!' || tmp == '?' || tmp == ';' || tmp == ':' || tmp == '|';
+ }
}