// Path: src/main/java/org/kew/rmf/transformers/StripNonAsciiAlphabeticCharactersTransformer.java
// public class StripNonAsciiAlphabeticCharactersTransformer extends RegexTransformer {
// 
// 	public StripNonAsciiAlphabeticCharactersTransformer() {
// 		super.setPattern("[^A-Za-z]");
// 		super.setReplacement(" ");
// 	}
// }
// 
// Path: src/main/java/org/kew/rmf/transformers/Transformer.java
// public interface Transformer {
// 	/**
// 	 * Transform <code>s</code> into another String.
// 	 * @param s	The string to transform
// 	 * @return	The transformed string
// 	 * @throws TransformationException	 If there is a problem with the transformer, e.g. unable to load external resource.
// 	 */
// 	public String transform(String s) throws TransformationException;
// }


import java.util.regex.Pattern;
import org.kew.rmf.transformers.StripNonAsciiAlphabeticCharactersTransformer;
import org.kew.rmf.transformers.Transformer;
/*
 * Copyright © 2012, 2013, 2014 Royal Botanic Gardens, Kew.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package org.kew.rmf.transformers.botany;



/**
 * This transformer canonicalises epithets.
 */
public class EpithetTransformer implements Transformer {

	private StripNonAsciiAlphabeticCharactersTransformer stripNonAsciiAlphabetic;

	private Pattern ana = Pattern.compile("(?<=[^i])ana$");
	private Pattern aef = Pattern.compile("aef");
	private Pattern colus = Pattern.compile("colus$");
	private Pattern us = Pattern.compile("us$");
	private Pattern um = Pattern.compile("um$");
	private Pattern on = Pattern.compile("on$");
	private Pattern iae = Pattern.compile("iae$");
	private Pattern ei = Pattern.compile("ei$");
	private Pattern ae = Pattern.compile("ae$");
	private Pattern ii = Pattern.compile("ii$");
	private Pattern ioi = Pattern.compile("ioi$");

	public EpithetTransformer() {
// Path: src/main/java/org/kew/rmf/transformers/StripNonAsciiAlphabeticCharactersTransformer.java
// public class StripNonAsciiAlphabeticCharactersTransformer extends RegexTransformer {
// 
// 	public StripNonAsciiAlphabeticCharactersTransformer() {
// 		super.setPattern("[^A-Za-z]");
// 		super.setReplacement(" ");
// 	}
// }
// 
// Path: src/main/java/org/kew/rmf/transformers/Transformer.java
// public interface Transformer {
// 	/**
// 	 * Transform <code>s</code> into another String.
// 	 * @param s	The string to transform
// 	 * @return	The transformed string
// 	 * @throws TransformationException	 If there is a problem with the transformer, e.g. unable to load external resource.
// 	 */
// 	public String transform(String s) throws TransformationException;
// }


// Path: src/main/java/org/kew/rmf/transformers/botany/EpithetTransformer.java
import java.util.regex.Pattern;
import org.kew.rmf.transformers.StripNonAsciiAlphabeticCharactersTransformer;
import org.kew.rmf.transformers.Transformer;

/*
 * Copyright © 2012, 2013, 2014 Royal Botanic Gardens, Kew.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package org.kew.rmf.transformers.botany;



/**
 * This transformer canonicalises epithets.
 */
public class EpithetTransformer implements Transformer {

	private StripNonAsciiAlphabeticCharactersTransformer stripNonAsciiAlphabetic;

	private Pattern ana = Pattern.compile("(?<=[^i])ana$");
	private Pattern aef = Pattern.compile("aef");
	private Pattern colus = Pattern.compile("colus$");
	private Pattern us = Pattern.compile("us$");
	private Pattern um = Pattern.compile("um$");
	private Pattern on = Pattern.compile("on$");
	private Pattern iae = Pattern.compile("iae$");
	private Pattern ei = Pattern.compile("ei$");
	private Pattern ae = Pattern.compile("ae$");
	private Pattern ii = Pattern.compile("ii$");
	private Pattern ioi = Pattern.compile("ioi$");

	public EpithetTransformer() {
		stripNonAsciiAlphabetic = new StripNonAsciiAlphabeticCharactersTransformer();