mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 19:14:30 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -5,36 +5,36 @@ import java.util.Random;
|
||||
//used exclusively by the Spanish surname dictionary - because the capitalization is a little bit different
|
||||
public class MarkovDictionarySPA extends MarkovDictionary {
|
||||
|
||||
public MarkovDictionarySPA(String dictionary, int seqlen, Random rng) {
|
||||
super(dictionary, seqlen, rng);
|
||||
}
|
||||
public MarkovDictionarySPA(String dictionary, int seqlen, Random rng) {
|
||||
super(dictionary, seqlen, rng);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPost(String str) {
|
||||
return getCapitalizedSPA(str);
|
||||
}
|
||||
@Override
|
||||
public String getPost(String str) {
|
||||
return getCapitalizedSPA(str);
|
||||
}
|
||||
|
||||
public String getCapitalizedSPA(String str) {
|
||||
// for spanish capitalization
|
||||
public String getCapitalizedSPA(String str) {
|
||||
// for spanish capitalization
|
||||
|
||||
String[] parts = str.split("#");
|
||||
String[] parts = str.split("#");
|
||||
|
||||
StringBuilder build = new StringBuilder("");
|
||||
StringBuilder build = new StringBuilder("");
|
||||
|
||||
for (int p = 0; p < parts.length; p++) {
|
||||
// capitalize this part, but only if it's not "de", "del", "la" or "los"
|
||||
if (!parts[p].equals("de") && !parts[p].equals("del") && !parts[p].equals("la")
|
||||
&& !parts[p].equals("los")) {
|
||||
parts[p] = getCapitalized(parts[p]);
|
||||
}
|
||||
for (int p = 0; p < parts.length; p++) {
|
||||
// capitalize this part, but only if it's not "de", "del", "la" or "los"
|
||||
if (!parts[p].equals("de") && !parts[p].equals("del") && !parts[p].equals("la")
|
||||
&& !parts[p].equals("los")) {
|
||||
parts[p] = getCapitalized(parts[p]);
|
||||
}
|
||||
|
||||
if (p > 0) // don't add spaces before the first part
|
||||
build.append(" ");
|
||||
if (p > 0) // don't add spaces before the first part
|
||||
build.append(" ");
|
||||
|
||||
build.append(parts[p]);
|
||||
}
|
||||
build.append(parts[p]);
|
||||
}
|
||||
|
||||
return build.toString();
|
||||
}
|
||||
return build.toString();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user