public NamePart[] getNameParts() throws GigiApiException {
if ("single".equals(scheme)) {
+ if (name == null || name.trim().isEmpty()) {
+ throw new GigiApiException("requires at least one character in the single name");
+ }
return new NamePart[] {
- new NamePart(NamePartType.SINGLE_NAME, name)
+ new NamePart(NamePartType.SINGLE_NAME, name.trim())
};
}
String[] fparts = split(fname);
if (toSplit == null || toSplit.trim().isEmpty()) {
return new String[0];
}
+ toSplit = toSplit.replaceAll("(?>[\\p{Z}\\s]*)([\u002d\u058a\u05be\u1806\u2010\u2011\u2012\u2013\u2014\u2015\u2e3a\u2e3b\ufe58\ufe63\uff0d])(?>[\\p{Z}\\s]*)", "-");
+ toSplit = toSplit.replaceAll("(?>[\\p{Z}\\s]+)", " ").trim();
+
return toSplit.split(" ");
}