
:) I had to make this loop for it (but then again i am indexing it, and not seperating the names like you are, that takes a little bit more work.) The code tries to find a date in the last part of the string, and then reorder all last name, first name multiple authors (i wanted normal order) Note the "possibles", and "hopefully" there, but i think it works for all books i encountered. In fact the names i reported a while ago as defective were found in errors in this method. It isn't that there is no method, it's just extremely ... non-normalized. private final StringBuilder normalizeString = new StringBuilder(); protected String normalizeName(String authorString) { int separator = authorString.lastIndexOf(','); //normal date seperator if (separator != -1) { String possibleDate = authorString.substring(separator + 1); for (int i = 0; i < possibleDate.length(); i++) { if (Character.isDigit(possibleDate.charAt(i))) { //a date, hopefully... return exchangeNames(authorString.substring(0, separator)); } } //no date, but change the name anyway. return exchangeNames(authorString); } return authorString; } protected String exchangeNames(String authorString) { normalizeString.setLength(0); exchangeNamesAux(authorString); return normalizeString.toString(); } private void exchangeNamesAux(String authorString) { int seperator = authorString.indexOf(','); if (seperator == -1) { normalizeString.append(authorString); return; } exchangeNamesAux(authorString.substring(seperator + 2)); normalizeString.append(' ').append(authorString.substring(0, seperator)); } On Thu, Sep 17, 2009 at 10:02 PM, Jim Adcock <jimad@msn.com> wrote:
PG catalog may be a reasonable way to get Title information. As presently implemented the PG catalog is not a reasonable source of Author Firstname, Lastname information -- for multiple reasons!
_______________________________________________ gutvol-d mailing list gutvol-d@lists.pglaf.org http://lists.pglaf.org/mailman/listinfo/gutvol-d