package org.kew.shs.dedupl.transformers;

import org.apache.commons.lang.StringUtils;

/**
 * This transformer translates author strings in the form "(Author1) Author2" to "Author1"
 * @author nn00kg
 *
 */
public class StripPublishingAuthorTransformer implements Transformer{

	public String transform(String s) {
		String transformed = s;
		if (StringUtils.isNotBlank(s) && ((s.indexOf("(") != -1) && s.indexOf(")") != -1))
			transformed = s.substring(s.indexOf("(")+1,s.indexOf(")"));
		return transformed;
	}
	
	public static void main(String[] args) {
		StripPublishingAuthorTransformer t  = new StripPublishingAuthorTransformer(); 
		System.out.println(t.transform("(Author1) Author 2"));
	}
	
}

@@ -482,16 +482,44 @@
 (%22)%22));%0A
+%09%09else%0A%09%09%09transformed = %22%22;%0A
 %09%09return
@@ -717,15 +717,109 @@
 r 2%22));%0A
+%09%09System.out.println(t.transform(%22Author3%22));%0A%09%09System.out.println(t.transform(%22(Author4)%22));%0A
 %09%7D%0A%09%0A%7D%0A

Add delimited output file and new AuthorAbbreviatedMatcher