v0.3.4: even more titlecase improvements
This commit is contained in:
parent
384b32bc12
commit
778ea640af
|
@ -153,7 +153,7 @@ public class Messages {
|
||||||
private static final HashSet<String> noCaps = new HashSet<>(
|
private static final HashSet<String> noCaps = new HashSet<>(
|
||||||
Arrays.asList(new String[]{
|
Arrays.asList(new String[]{
|
||||||
//English
|
//English
|
||||||
"a", "of", "by", "to", "the"
|
"a", "of", "by", "to", "the", "x"
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ public class Messages {
|
||||||
String result = "";
|
String result = "";
|
||||||
//split by any unicode space character
|
//split by any unicode space character
|
||||||
for (String word : str.split("(?<=\\p{Zs})")){
|
for (String word : str.split("(?<=\\p{Zs})")){
|
||||||
if (noCaps.contains(word.trim().toLowerCase().replaceAll(":", ""))){
|
if (noCaps.contains(word.trim().toLowerCase().replaceAll(":|[0-9]", ""))){
|
||||||
result += word;
|
result += word;
|
||||||
} else {
|
} else {
|
||||||
result += capitalize(word);
|
result += capitalize(word);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user