//package warlords.backend.utilities;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
/*public*/ class NameGenerator {
private static HashMap
<String, NameGenerator
> cached
;
private ArrayList<String> syllables = new ArrayList<String>();
private int[] typicalLengths;
private NameGenerator() {}
int length = typicalLengths[rng.nextInt(typicalLengths.length)];
StringBuilder rtn = new StringBuilder();
for (int i = 0; i < length; i++) {
rtn.append(syllables.get(rng.nextInt(syllables.size())));
}
return rtn.toString();
}
java.
util.
Scanner in
= new java.
util.
Scanner(System.
in); String[] split_t
= in.
nextLine().
split(", ?"); NameGenerator gen = new NameGenerator();
gen.typicalLengths = new int[split_t.length];
for (int i = 0; i < gen.typicalLengths.length; i++) {
gen.
typicalLengths[i
] = Integer.
parseInt(split_t
[i
]); }
while (in.hasNextLine()) {
gen.syllables.add(in.nextLine());
}
for (int i = 0; i < 5; i++) {
System.
out.
println(gen.
newName()); }
}
}