* Facade method: get all place and human names from a text string
* @param words
* @return
*/
public ScoredList[] getProperNames(List<String> words) {
ScoredList placeNames = new ScoredList();
ScoredList humanNames = new ScoredList();
ScoredList[] ret = new ScoredList[2];
ret[0] = humanNames; ret[1] = placeNames;
if (words == null) return ret;
for (int i=0; i<words.size(); i++) {
// 5 word human names:
if (isHumanName(words, i, 5)) {
String s = words.get(i) + " " + words.get(i+1) + " " + words.get(i+2) + " " + words.get(i+3) + " " + words.get(i+4);
humanNames.addValue(s);
i += 4;
continue;
}
// 4 word human names:
if (isHumanName(words, i, 4)) {
String s = words.get(i) + " " + words.get(i+1) + " " + words.get(i+2) + " " + words.get(i+3);
humanNames.addValue(s);
i += 3;
continue;
}
// 3 word names:
if (isPlaceName(words, i, 3)) {
String s = words.get(i) + " " + words.get(i+1) + " " + words.get(i+2);
placeNames.addValue(s);
i += 2;
continue;
}
if (isHumanName(words, i, 3)) {
String s = words.get(i) + " " + words.get(i+1) + " " + words.get(i+2);
humanNames.addValue(s);
i += 2;
continue;
}
// 2 word names:
if (isPlaceName(words, i, 2)) {
String s = words.get(i) + " " + words.get(i+1);
placeNames.addValue(s);
i += 1;
continue;
}
if (isHumanName(words, i, 2)) {
String s = words.get(i) + " " + words.get(i+1);
humanNames.addValue(s);
i += 1;
continue;
}
// 1 word names:
if (isPlaceName(words, i, 1)) {