<commit_before>package org.emonocot.model.convert;

import org.gbif.ecat.voc.NomenclaturalStatus;
import org.springframework.core.convert.converter.Converter;

public class NomenclaturalStatusConverter implements Converter<String, NomenclaturalStatus> {

	@Override
	public NomenclaturalStatus convert(String source) {
		if(source == null || source.trim().isEmpty()) {
			return null;
		} else {
			switch(source) {
			case "abortivum":
				return NomenclaturalStatus.Nomen_Abortivum;
			case "alternativum":
				return NomenclaturalStatus.Alternative;
			case "ambigua":
			    return NomenclaturalStatus.Ambiguous;
			case "available":
				return NomenclaturalStatus.Available;
			case "combinatio":
				return NomenclaturalStatus.New_Combination;
			case "confusum":
				return NomenclaturalStatus.Confused;
			case "conservandum":
				return NomenclaturalStatus.Conserved;
			case "conservandumProp":
				return NomenclaturalStatus.Conserved_Proposed;
			case "correctum":
				break;				
			case "dubimum":
				return NomenclaturalStatus.Doubtful;
			case "illegitimum":
				return NomenclaturalStatus.Illegitimate;
			case "invalidum":
				return NomenclaturalStatus.Invalid;
			case "legitimate":
				return NomenclaturalStatus.Legitimate;<commit_msg>IN_DEVELOPMENT - bug 371: As a data-integrator, I want the WCS and other sources to send the same output format  http://build.e-monocot.org/bugzilla/show_bug.cgi?id=371<commit_after>package org.emonocot.model.convert;

import org.gbif.ecat.voc.NomenclaturalStatus;
import org.springframework.core.convert.converter.Converter;

public class NomenclaturalStatusConverter implements Converter<String, NomenclaturalStatus> {

	@Override
	public NomenclaturalStatus convert(String source) {
		if(source == null || source.trim().isEmpty()) {
			return null;
		} else {
			switch(source.toLowerCase()) {
			case "abortivum":
				return NomenclaturalStatus.Nomen_Abortivum;
			case "alternativum":
				return NomenclaturalStatus.Alternative;
			case "ambigua":
			    return NomenclaturalStatus.Ambiguous;
			case "available":
				return NomenclaturalStatus.Available;
			case "combinatio":
				return NomenclaturalStatus.New_Combination;
			case "confusum":
				return NomenclaturalStatus.Confused;
			case "conservandum":
				return NomenclaturalStatus.Conserved;
			case "conservandumProp":
				return NomenclaturalStatus.Conserved_Proposed;
			case "correctum":
				break;				
			case "dubimum":
				return NomenclaturalStatus.Doubtful;
			case "illegitimum":
				return NomenclaturalStatus.Illegitimate;
			case "invalidum":
				return NomenclaturalStatus.Invalid;
			case "legitimate":
				return NomenclaturalStatus.Legitimate;
{'fraction_non_alphanumeric': 0.08796123742079762, 'fraction_numerical': 0.0022363026462914647, 'mean_word_length': 4.650526315789474, 'pattern_counts': {'":': 26, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4049239', 'n_tokens_mistral': 1040, 'n_tokens_neox': 796, 'n_words': 168}