Project

General

Profile

« Previous | Next » 

Revision 8f68c1d1

Added by Andreas Müller about 15 years ago

bugfixing name parser (+tests)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
905 905
			authors[3]= basAuthors[1];
906 906
			years[3] = basYears[1];
907 907
		}
908
		TeamOrPersonBase<?>[] combinationAuthors = new TeamOrPersonBase[2];;
909
		Integer[] combinationYears = new Integer[2];
910
		authorsAndEx(fullAuthorString.substring(authorTeamStart), combinationAuthors, combinationYears);
911
		authors[0]= combinationAuthors[0] ;
912
		years[0] = combinationYears[0];
913
		authors[1]= combinationAuthors[1];
914
		years[1] = combinationYears[1];
908
		if (fullAuthorString.length() >= authorTeamStart){
909
			TeamOrPersonBase<?>[] combinationAuthors = new TeamOrPersonBase[2];;
910
			Integer[] combinationYears = new Integer[2];
911
			authorsAndEx(fullAuthorString.substring(authorTeamStart), combinationAuthors, combinationYears);
912
			authors[0]= combinationAuthors[0] ;
913
			years[0] = combinationYears[0];
914
			authors[1]= combinationAuthors[1];
915
			years[1] = combinationYears[1];
916
		}
915 917
	}
916 918
	
917 919
	
......
1146 1148
    static String obligateDotWord = "(" + capitalWord + "|" + nonCapitalWord + ")\\.+"; //word (capital or non-capital) with obligate '.' at the end
1147 1149
    
1148 1150
    //Words used in an epethiton for a TaxonName
1149
    static String nonCapitalEpiWord = "[a-z�\\-]+";   //TODO solve checkin Problem with Unicode character "[a-z�\\-]+";
1151
    static String nonCapitalEpiWord = "[a-z\u00EF\\-]+";
1150 1152
    static String capitalEpiWord = "[A-Z]"+ nonCapitalEpiWord;
1151 1153
     
1152 1154
    
......
1187 1189
    static String basStart = "\\(";
1188 1190
    static String basEnd = "\\)";
1189 1191
    static String botanicBasionymAuthor = basStart + "(" + authorAndExTeam + ")" + basEnd;  // '(' and ')' is for evaluation with RE.paren(x)
1190
    static String fullBotanicAuthorString = fWs + "(" + botanicBasionymAuthor +")?" + fWs + authorAndExTeam + fWs;
1192
    static String fullBotanicAuthorString = fWs + "((" + botanicBasionymAuthor +")?" + fWs + authorAndExTeam + "|" + botanicBasionymAuthor +")"+ fWs;
1191 1193
    static String facultFullBotanicAuthorString = "(" +  fullBotanicAuthorString + ")?" ; 
1192 1194
        
1193 1195
    //Zoo. Author
......
1196 1198
    static String zooAuthorAddidtion = fWs + zooAuthorYearSeperator + fWs + singleYear;
1197 1199
    static String zooAuthorTeam = authorTeam + zooAuthorAddidtion;
1198 1200
    static String zooBasionymAuthor = basStart + "(" + zooAuthorTeam + ")" + basEnd;
1199
    static String fullZooAuthorString = fWs + "(" + zooBasionymAuthor +")?" + fWs + zooAuthorTeam + fWs;
1201
    static String fullZooAuthorString = fWs + "((" + zooBasionymAuthor +")?" + fWs + zooAuthorTeam + "|" + zooBasionymAuthor +")"+ fWs;
1200 1202
    static String facultFullZooAuthorString = "(" +  fullZooAuthorString + ")?" ; 
1201 1203
 
1202 1204
    static String facultFullAuthorString2 = "(" + facultFullBotanicAuthorString + "|" + facultFullZooAuthorString + ")";
......
1212 1214
    static String nr4 = "\\d{1,4}";
1213 1215
    static String nr5 = "\\d{1,5}";
1214 1216
    
1215
    
1217
   
1216 1218
    static String pPage = nr5 + "[a-z]?";
1217
    static String pStrNo = "n" + fWs + "(" + nr4 + ")";
1219
    static String pStrNo = "n\u00B0" + fWs + "(" + nr4 + ")";
1218 1220
    
1219 1221
    static String pBracketNr = "\\[" + nr4 + "\\]";
1220 1222
    static String pFolBracket = "\\[fol\\." + fWs + "\\d{1,2}(-\\d{1,2})?\\]";
1221 1223
    
1222
    static String pStrTab = "tab\\." + fWs + nr4 + "(" + fWs + "(B||\\(\\d{1,3}\\)))?";
1224
    static String pStrTab = "tab\\." + fWs + nr4 + "(" + fWs + "(B|\u00DF|\\(\\d{1,3}\\)))?";
1223 1225
    static String pFig = "fig." + fWs + nr4 + "[a-z]?";
1224 1226
    static String pFigs = pFig + "(-" + nr4 + ")?";
1225 1227
    //static String pTabFig = pStrTab + "(," + fWs + pFigs + ")?";
......
1236 1238
    
1237 1239
    static String pTabSpecial = "tab\\." + fWs + "(ad" + fWs + "\\d{1,3}|alphab)";
1238 1240
    static String pPageSpecial = nr4 + fWs + "(in obs|, Expl\\. Tab)";
1239
    static String pSpecialGardDict = capitalWord + oWs + "n" + oWs + "\\d{1,2}";
1241
    static String pSpecialGardDict = capitalWord + oWs + "n\u00B0" + oWs + "\\d{1,2}";
1240 1242
    //TODO
1241 1243
    // static String pSpecialDetail = "(in err|in tab|sine pag|add\\. & emend|Emend|""\\d{3}"" \\[\\d{3}\\])";
1242 1244
 // static String pSpecialDetail = "(in err|in tab|sine pag|add\\. & emend|Emend|""\\d{3}"" \\[\\d{3}\\])";

Also available in: Unified diff