Project

General

Profile

« Previous | Next » 

Revision 2881e8c0

Added by Andreas Müller over 11 years ago

Correct handling for multiple author teams (replace & by , )

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/agent/TeamDefaultCacheStrategy.java
23 23
 *
24 24
 */
25 25
public class TeamDefaultCacheStrategy extends StrategyBase implements INomenclaturalAuthorCacheStrategy<Team> {
26
	private static final String FINAL_TEAM_CONCATINATION = " & ";
27
	private static final String STD_TEAM_CONCATINATION = ", ";
26 28
	private static final long serialVersionUID = 8375295443642690479L;
27 29
	@SuppressWarnings("unused")
28 30
	private static final Logger logger = Logger.getLogger(TeamDefaultCacheStrategy.class);
......
55 57
	 */
56 58
	public String getNomenclaturalTitle(Team team) {
57 59
		String result = "";
60
		
58 61
		List<Person> teamMembers = team.getTeamMembers();
62
		int i = 0;
59 63
		for (Person teamMember : teamMembers){
60
			result += teamMember.getNomenclaturalTitle() + " & ";
64
			i++;
65
			String concat;
66
			if (i <= 1){
67
				concat = "";
68
			}else if (i < teamMembers.size()){
69
				concat = STD_TEAM_CONCATINATION;
70
			}else{
71
				concat = FINAL_TEAM_CONCATINATION;
72
			}
73
			result += concat + teamMember.getNomenclaturalTitle();
61 74
		}
62
		if (teamMembers.size() > 0){
63
			result = result.substring(0, result.length() - 3);
64
		}else{
75
		if (teamMembers.size() == 0){
65 76
			result = team.getTitleCache();
66 77
		}
67 78
		return result;
......
74 85
		// TODO is still dummy
75 86
		String result = "";
76 87
		List<Person> teamMembers = team.getTeamMembers();//Hibernate.initialize(teamMembers);
88
		
89
		int i = 0;
77 90
		for (Person teamMember : teamMembers){
78
			result += teamMember.getTitleCache() + " & ";
91
			i++;
92
			String concat;
93
			if (i <= 1){
94
				concat = "";
95
			}else if (i < teamMembers.size()){
96
				concat = STD_TEAM_CONCATINATION;
97
			}else{
98
				concat = FINAL_TEAM_CONCATINATION;
99
			}
100
			result += concat + teamMember.getTitleCache();
79 101
		}
80
		if (teamMembers.size() > 0){
81
			result = result.substring(0, result.length() - 3);
82
		}else{
102
		if (teamMembers.size() == 0){
83 103
			result = EMPTY_TEAM;
84 104
		}
85 105
		return result;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
1215 1215
			return null;
1216 1216
		}else if ((authorString = authorString.trim()).length() == 0){
1217 1217
			return null;
1218
		}else if (! teamSplitterPattern.matcher(authorString).find() && ! authorIsAlwaysTeam){
1218
		}else if (! finalTeamSplitterPattern.matcher(authorString).find() && ! authorIsAlwaysTeam){
1219 1219
			//1 Person
1220 1220
			Person result = Person.NewInstance();
1221 1221
			result.setNomenclaturalTitle(authorString);
......
1234 1234
	 */
1235 1235
	protected Team parsedTeam(String authorString){
1236 1236
		Team result = Team.NewInstance();
1237
		String[] authors = authorString.split(teamSplitter);
1237
		String[] authors = authorString.split(notFinalTeamSplitter);
1238 1238
		for (String author : authors){
1239 1239
			Person person = Person.NewInstance();
1240 1240
			person.setNomenclaturalTitle(author);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java
83 83
    //AuthorString
84 84
    protected static String authorPart = "(" + "(d'|D'|L'|'t\\s)?" + capitalDotWord + "('" + nonCapitalDotWord + ")?" + "|da|de(n|l|\\sla)?)" ;
85 85
    protected static String author = "(" + authorPart + "(" + fWs + "|-)" + ")+" + "(f.|fil.|secundus)?";
86
    protected static String teamSplitter = fWs + "(&)" + fWs;
87
    protected static String authorTeam = fWs + "(" + author + teamSplitter + ")*" + author + "(" + teamSplitter + "al.)?" + fWs;
86
    protected static String finalTeamSplitter = fWs + "(&)" + fWs;
87
    protected static String notFinalTeamSplitter = "(" + fWs + "," + fWs + "|" + finalTeamSplitter + ")";
88
    protected static String authorTeam = fWs + "((" + author + notFinalTeamSplitter + ")*" + author + finalTeamSplitter + ")?"  + author + "(" + finalTeamSplitter + "al.)?" + fWs;
88 89
    protected static String exString = "(ex.?)";
89 90
    protected static String authorAndExTeam = "(" + authorTeam + oWs + exString + oWs + ")?" + authorTeam;
90 91
    protected static String basStart = "\\(";
......
264 265
    
265 266
    //Pattern
266 267
    protected static Pattern oWsPattern = Pattern.compile(oWs);
267
    protected static Pattern teamSplitterPattern = Pattern.compile(teamSplitter);
268
    protected static Pattern finalTeamSplitterPattern = Pattern.compile(finalTeamSplitter);
268 269
    protected static Pattern cultivarPattern = Pattern.compile(cultivar);
269 270
    protected static Pattern cultivarMarkerPattern = Pattern.compile(cultivarMarker);
270 271
    protected static Pattern hybridPattern = Pattern.compile(hybridFull); 
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/TeamDefaultCacheStrategyTest.java
121 121
		person1.setSuffix(null);
122 122
		Assert.assertEquals("team1 nomenclatural title should be Dr1. P1FN P1LN", "Dr1. P1FN P1LN", team1.getNomenclaturalTitle());
123 123
		//peson2
124
		Assert.assertEquals("team2 nomenclatural title should be 'P2NomT & Dr1. P1FN P1LN & P3NomT'", "P2NomT & Dr1. P1FN P1LN & P3NomT", team2.getNomenclaturalTitle());
124
		Assert.assertEquals("team2 nomenclatural title should be 'P2NomT, Dr1. P1FN P1LN & P3NomT'", "P2NomT, Dr1. P1FN P1LN & P3NomT", team2.getNomenclaturalTitle());
125 125
		//person3
126 126
		Assert.assertNotNull("team3 nomenclatural title must not to be null", team3.getNomenclaturalTitle());
127 127
		Assert.assertTrue("team3 nomenclatural title must not be empty", CdmUtils.isNotEmpty(team3.getNomenclaturalTitle()));
......
140 140
		person1.setSuffix(null);
141 141
		Assert.assertEquals("team1 title cache should be Dr1. P1FN P1LN", "Dr1. P1FN P1LN", team1.getTitleCache());
142 142
		//peson2
143
		Assert.assertEquals("team2 title cache should be 'P2FN P2LN P2Suff & Dr1. P1FN P1LN & P3NomT'", "P2FN P2LN P2Suff & Dr1. P1FN P1LN & P3NomT", team2.getTitleCache());
143
		Assert.assertEquals("team2 title cache should be 'P2FN P2LN P2Suff, Dr1. P1FN P1LN & P3NomT'", "P2FN P2LN P2Suff, Dr1. P1FN P1LN & P3NomT", team2.getTitleCache());
144 144
		//person3
145 145
		Assert.assertNotNull("team3 title cache must not to be null", team3.getTitleCache());
146 146
		Assert.assertTrue("team3 title cache must not be empty", CdmUtils.isNotEmpty(team3.getTitleCache()));
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
113 113
	public final void testTaxonNameParserBotanicalNameImpl() {
114 114
		logger.warn("Not yet implemented"); // TODO
115 115
	}
116
	
117
	@Test
118
	public final void testTeamSeperation(){
119
		Rank speciesRank = Rank.SPECIES();
120
		NonViralName<?> name;
121
		
122
//		String strNameWith1AUthorAndCommaSepEditon = "Abies alba Mill., Sp. Pl., ed. 3: 455. 1987";
123
//		name = parser.parseReferencedName(strNameWith1AUthorAndCommaSepEditon, botanicCode, speciesRank);
124
//		Assert.assertFalse("No problems should exist", name.hasProblem());
125
//		Assert.assertEquals("Name should not include reference part", "Abies alba Mill.", name.getTitleCache());
126
//		Assert.assertEquals("Mill., Sp. Pl., ed. 3. 1987", name.getNomenclaturalReference().getTitleCache());
127
//		
128
//		
129
//		String strNameWith2Authors = "Abies alba L. & Mill., Sp. Pl., ed. 3: 455. 1987";
130
//		name = parser.parseReferencedName(strNameWith2Authors, botanicCode, speciesRank);
131
//		Assert.assertFalse("No problems should exist", name.hasProblem());
132
//		Assert.assertEquals("Name should not include reference part", "Abies alba L. & Mill.", name.getTitleCache());
133
//		Assert.assertEquals("Name should have authorteam with 2 authors", 2, ((Team)name.getCombinationAuthorTeam()).getTeamMembers().size());
134
//		Assert.assertEquals("L. & Mill., Sp. Pl., ed. 3. 1987", name.getNomenclaturalReference().getTitleCache());
135
		
136
		String strNameWith3Authors = "Abies alba Mess., L. & Mill., Sp. Pl., ed. 3: 455. 1987";
137
		name = parser.parseReferencedName(strNameWith3Authors, botanicCode, speciesRank);
138
		Assert.assertFalse("No problems should exist", name.hasProblem());
139
		Assert.assertEquals("Name should not include reference part", "Abies alba Mess., L. & Mill.", name.getTitleCache());
140
		Assert.assertEquals("Name should have authorteam with 2 authors", 3, ((Team)name.getCombinationAuthorTeam()).getTeamMembers().size());
141
		Assert.assertEquals("Mess., L. & Mill., Sp. Pl., ed. 3. 1987", name.getNomenclaturalReference().getTitleCache());
142
		
143
	}
116 144

  
117 145
	/**
118 146
	 * Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseSimpleName(java.lang.String, eu.etaxonomy.cdm.model.name.Rank)}.
......
651 679
		
652 680
		//null
653 681
		String strNull = null;
654
		NonViralName<?> nameNull = parser.parseReferencedName(strNull, null, Rank.SPECIES());
682
		Rank rankSpecies = Rank.SPECIES();
683
		NonViralName<?> nameNull = parser.parseReferencedName(strNull, null, rankSpecies);
655 684
		assertNull(nameNull);
656 685
				
657 686
		//Empty
658 687
		String strEmpty = "";
659
		NonViralName<?> nameEmpty = parser.parseReferencedName(strEmpty, null, Rank.SPECIES());
688
		NonViralName<?> nameEmpty = parser.parseReferencedName(strEmpty, null, rankSpecies);
660 689
		assertFalse(nameEmpty.hasProblem());
661 690
		assertEquals(strEmpty, nameEmpty.getFullTitleCache());
662 691
		assertNull(nameEmpty.getNomenclaturalMicroReference());
......
664 693
		
665 694
		//Whitespaces
666 695
		String strFullWhiteSpcaceAndDot = "Abies alba Mill.,  Sp.   Pl.  4:  455 .  1987 .";
667
		NonViralName<?> namefullWhiteSpcaceAndDot = parser.parseReferencedName(strFullWhiteSpcaceAndDot, null, Rank.SPECIES());
696
		NonViralName<?> namefullWhiteSpcaceAndDot = parser.parseReferencedName(strFullWhiteSpcaceAndDot, null, rankSpecies);
668 697
		assertFullRefStandard(namefullWhiteSpcaceAndDot);
669 698
		assertTrue(((Reference)namefullWhiteSpcaceAndDot.getNomenclaturalReference()).getType().equals(eu.etaxonomy.cdm.model.reference.ReferenceType.Book));
670 699
		assertEquals( "Abies alba Mill., Sp. Pl. 4: 455. 1987", namefullWhiteSpcaceAndDot.getFullTitleCache());
671 700

  
672 701
		//Book
673 702
		String fullReference = "Abies alba Mill., Sp. Pl. 4: 455. 1987";
674
		NonViralName<?> name1 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
703
		NonViralName<?> name1 = parser.parseReferencedName(fullReference, null, rankSpecies);
675 704
		assertFullRefStandard(name1);
676 705
		assertTrue(((Reference)name1.getNomenclaturalReference()).getType().equals(eu.etaxonomy.cdm.model.reference.ReferenceType.Book));
677 706
		assertEquals(fullReference, name1.getFullTitleCache());
......
679 708
		
680 709
		//Book Section
681 710
		fullReference = "Abies alba Mill. in Otto, Sp. Pl. 4(6): 455. 1987";
682
		NonViralName<?> name2 = parser.parseReferencedName(fullReference + ".", null, Rank.SPECIES());
711
		NonViralName<?> name2 = parser.parseReferencedName(fullReference + ".", null, rankSpecies);
683 712
		assertFullRefNameStandard(name2);
684 713
		assertEquals(fullReference, name2.getFullTitleCache());
685 714
		assertFalse(name2.hasProblem());
......
697 726
		
698 727
		//Article
699 728
		fullReference = "Abies alba Mill. in Sp. Pl. 4(6): 455. 1987";
700
		NonViralName<?> name3 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
729
		NonViralName<?> name3 = parser.parseReferencedName(fullReference, null, rankSpecies);
701 730
		assertFullRefNameStandard(name3);
702 731
		name3.setTitleCache(null);
703 732
		assertEquals(fullReference, name3.getFullTitleCache());
......
720 749
		String fullReferenceWithoutYear = "Abies alba Mill. in " + journalTitle + " 4(6): 455.";
721 750
		fullReference = fullReferenceWithoutYear + yearPart;
722 751
		String fullReferenceWithEnd = fullReference + ".";
723
		NonViralName<?> name4 = parser.parseReferencedName(fullReferenceWithEnd, null, Rank.SPECIES());
752
		NonViralName<?> name4 = parser.parseReferencedName(fullReferenceWithEnd, null, rankSpecies);
724 753
		assertFalse(name4.hasProblem());
725 754
		assertFullRefNameStandard(name4);
726 755
		assertEquals(fullReferenceWithoutYear + " " + parsedYear, name4.getFullTitleCache());
......
767 796
		
768 797
		//Special MicroRefs
769 798
		String strSpecDetail1 = "Abies alba Mill. in Sp. Pl. 4(6): [455]. 1987";
770
		NonViralName<?> nameSpecDet1 = parser.parseReferencedName(strSpecDetail1 + ".", null, Rank.SPECIES());
799
		NonViralName<?> nameSpecDet1 = parser.parseReferencedName(strSpecDetail1 + ".", null, rankSpecies);
771 800
		assertFalse(nameSpecDet1.hasProblem());
772 801
		assertEquals(strSpecDetail1, nameSpecDet1.getFullTitleCache());
773 802
		assertEquals("[455]", nameSpecDet1.getNomenclaturalMicroReference());
774 803
		
775 804
		//Special MicroRefs
776 805
		String strSpecDetail2 = "Abies alba Mill. in Sp. Pl. 4(6): couv. 2. 1987";
777
		NonViralName<?> nameSpecDet2 = parser.parseReferencedName(strSpecDetail2 + ".", null, Rank.SPECIES());
806
		NonViralName<?> nameSpecDet2 = parser.parseReferencedName(strSpecDetail2 + ".", null, rankSpecies);
778 807
		assertFalse(nameSpecDet2.hasProblem());
779 808
		assertEquals(strSpecDetail2, nameSpecDet2.getFullTitleCache());
780 809
		assertEquals("couv. 2", nameSpecDet2.getNomenclaturalMicroReference());
781 810
		
782 811
		//Special MicroRefs
783 812
		String strSpecDetail3 = "Abies alba Mill. in Sp. Pl. 4(6): fig. 455. 1987";
784
		NonViralName<?> nameSpecDet3 = parser.parseReferencedName(strSpecDetail3 + ".", null, Rank.SPECIES());
813
		NonViralName<?> nameSpecDet3 = parser.parseReferencedName(strSpecDetail3 + ".", null, rankSpecies);
785 814
		assertFalse(nameSpecDet3.hasProblem());
786 815
		assertEquals(strSpecDetail3, nameSpecDet3.getFullTitleCache());
787 816
		assertEquals("fig. 455", nameSpecDet3.getNomenclaturalMicroReference());
......
789 818
		//Special MicroRefs
790 819
		String strSpecDetail4 = "Abies alba Mill. in Sp. Pl. 4(6): fig. 455-567. 1987";
791 820
		fullReference = strSpecDetail4 + ".";
792
		NonViralName<?> nameSpecDet4 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
821
		NonViralName<?> nameSpecDet4 = parser.parseReferencedName(fullReference, null, rankSpecies);
793 822
		assertFalse(nameSpecDet4.hasProblem());
794 823
		assertEquals(strSpecDetail4, nameSpecDet4.getFullTitleCache());
795 824
		assertEquals("fig. 455-567", nameSpecDet4.getNomenclaturalMicroReference());
......
798 827
		//Special MicroRefs
799 828
		String strSpecDetail5 = "Abies alba Mill. in Sp. Pl. 4(6): Gard n\u00B0 4. 1987";
800 829
		fullReference = strSpecDetail5 + ".";
801
		NonViralName<?> nameSpecDet5 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
830
		NonViralName<?> nameSpecDet5 = parser.parseReferencedName(fullReference, null, rankSpecies);
802 831
		assertFalse(nameSpecDet5.hasProblem());
803 832
		assertEquals(strSpecDetail5, nameSpecDet5.getFullTitleCache());
804 833
		assertEquals("Gard n\u00B0 4", nameSpecDet5.getNomenclaturalMicroReference());
......
806 835
		//Special MicroRefs
807 836
		String strSpecDetail6 = "Abies alba Mill. in Sp. Pl. 4(6): 455a. 1987";
808 837
		fullReference = strSpecDetail6 + ".";
809
		NonViralName<?> nameSpecDet6 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
838
		NonViralName<?> nameSpecDet6 = parser.parseReferencedName(fullReference, null, rankSpecies);
810 839
		assertFalse(nameSpecDet6.hasProblem());
811 840
		assertEquals(strSpecDetail6, nameSpecDet6.getFullTitleCache());
812 841
		assertEquals("455a", nameSpecDet6.getNomenclaturalMicroReference());
......
814 843
		//Special MicroRefs
815 844
		String strSpecDetail7 = "Abies alba Mill. in Sp. Pl. 4(6): pp.455-457. 1987";
816 845
		fullReference = strSpecDetail7 + ".";
817
		NonViralName<?> nameSpecDet7 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
846
		NonViralName<?> nameSpecDet7 = parser.parseReferencedName(fullReference, null, rankSpecies);
818 847
		assertFalse(nameSpecDet7.hasProblem());
819 848
		assertEquals(strSpecDetail7, nameSpecDet7.getFullTitleCache());
820 849
		assertEquals("pp.455-457", nameSpecDet7.getNomenclaturalMicroReference());
821 850
		
822 851
		//Special MicroRefs
823 852
		String strSpecDetail8 = "Abies alba Mill. in Sp. Pl. 4(6): ppp.455-457. 1987";
824
		NonViralName<?> nameSpecDet8 = parser.parseReferencedName(strSpecDetail8, null, Rank.SPECIES());
853
		NonViralName<?> nameSpecDet8 = parser.parseReferencedName(strSpecDetail8, null, rankSpecies);
825 854
		assertTrue(nameSpecDet8.hasProblem());
826 855
		assertEquals(20, nameSpecDet8.getProblemStarts()); //TODO better start behind :
827 856
		assertEquals(51, nameSpecDet8.getProblemEnds());   //TODO better stop after -457
......
829 858

  
830 859
		//Special MicroRefs
831 860
		String strSpecDetail9 = "Abies alba Mill. in Sp. Pl. 4(6): pp. 455 - 457. 1987";
832
		NonViralName<?> nameSpecDet9 = parser.parseReferencedName(strSpecDetail9, null, Rank.SPECIES());
861
		NonViralName<?> nameSpecDet9 = parser.parseReferencedName(strSpecDetail9, null, rankSpecies);
833 862
		assertFalse(nameSpecDet9.hasProblem());
834 863
		assertEquals(strSpecDetail9, nameSpecDet9.getFullTitleCache());
835 864
		assertEquals("pp. 455 - 457", nameSpecDet9.getNomenclaturalMicroReference());
836 865

  
837 866
		//Special MicroRefs
838 867
		String strSpecDetail10 = "Abies alba Mill. in Sp. Pl. 4(6): p 455. 1987";
839
		NonViralName<?> nameSpecDet10 = parser.parseReferencedName(strSpecDetail10, null, Rank.SPECIES());
868
		NonViralName<?> nameSpecDet10 = parser.parseReferencedName(strSpecDetail10, null, rankSpecies);
840 869
		assertFalse(nameSpecDet10.hasProblem());
841 870
		assertEquals(strSpecDetail10, nameSpecDet10.getFullTitleCache());
842 871
		assertEquals("p 455", nameSpecDet10.getNomenclaturalMicroReference());
843 872
		
844 873
		//Special MicroRefs
845 874
		String strSpecDetail11 = "Abies alba Mill. in Sp. Pl. 4(6): p. 455 - 457. 1987";
846
		NonViralName<?> nameSpecDet11 = parser.parseReferencedName(strSpecDetail11, null, Rank.SPECIES());
875
		NonViralName<?> nameSpecDet11 = parser.parseReferencedName(strSpecDetail11, null, rankSpecies);
847 876
		assertTrue(nameSpecDet11.hasProblem());
848 877
		list = nameSpecDet11.getParsingProblems();
849 878
		assertTrue("Problem is Detail. Must be pp.", list.contains(ParserProblem.CheckDetailOrYear));
......
853 882
		
854 883
		//no volume, no edition
855 884
		String strNoVolume = "Abies alba Mill., Sp. Pl.: 455. 1987";
856
		NonViralName<?> nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
885
		NonViralName<?> nameNoVolume = parser.parseReferencedName(strNoVolume, null, rankSpecies);
857 886
		assertFalse(nameNoVolume.hasProblem());
858 887
		assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
859 888
		assertEquals(null, ((IVolumeReference)(nameNoVolume.getNomenclaturalReference())).getVolume());
......
861 890

  
862 891
		//volume, no edition
863 892
		strNoVolume = "Abies alba Mill., Sp. Pl. 2: 455. 1987";
864
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
893
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, rankSpecies);
865 894
		assertFalse(nameNoVolume.hasProblem());
866 895
		assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
867 896
		assertEquals("2", ((IVolumeReference)(nameNoVolume.getNomenclaturalReference())).getVolume());
......
869 898

  
870 899
		//no volume, edition
871 900
		strNoVolume = "Abies alba Mill., Sp. Pl., ed. 3: 455. 1987";
872
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
901
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, rankSpecies);
873 902
		assertFalse(nameNoVolume.hasProblem());
874 903
		assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
875 904
		assertEquals(null, ((IVolumeReference)(nameNoVolume.getNomenclaturalReference())).getVolume());
......
877 906
		
878 907
		//volume, edition
879 908
		strNoVolume = "Abies alba Mill., Sp. Pl. ed. 3, 4(5): 455. 1987";
880
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
909
		nameNoVolume = parser.parseReferencedName(strNoVolume, null, rankSpecies);
881 910
		assertFalse(nameNoVolume.hasProblem());
882 911
		assertEquals(strNoVolume.replace(" ed.", ", ed."), nameNoVolume.getFullTitleCache());
883 912
		assertEquals("4(5)", ((IVolumeReference)(nameNoVolume.getNomenclaturalReference())).getVolume());
884 913
		assertEquals("3", ((IBook)(nameNoVolume.getNomenclaturalReference())).getEdition());
885 914
		
886 915
		String strUnparsableInRef = "Abies alba Mill. in -er46: 455. 1987";
887
		NonViralName<?> nameUnparsableInRef = parser.parseReferencedName(strUnparsableInRef, null, Rank.SPECIES());
916
		NonViralName<?> nameUnparsableInRef = parser.parseReferencedName(strUnparsableInRef, null, rankSpecies);
888 917
		assertTrue(nameUnparsableInRef.hasProblem());
889 918
		list = nameUnparsableInRef.getParsingProblems();
890 919
		assertTrue("Unparsable title", list.contains(ParserProblem.UnparsableReferenceTitle));
......
895 924
		
896 925
		//volume, edition
897 926
		String strNoSeparator = "Abies alba Mill. Sp. Pl. ed. 3, 4(5): 455. 1987";
898
		NonViralName<?> nameNoSeparator = parser.parseReferencedName(strNoSeparator, NomenclaturalCode.ICBN, Rank.SPECIES());
927
		NonViralName<?> nameNoSeparator = parser.parseReferencedName(strNoSeparator, NomenclaturalCode.ICBN, rankSpecies);
899 928
		assertTrue(nameNoSeparator.hasProblem());
900 929
		list = nameNoSeparator.getParsingProblems();
901 930
		assertTrue("Problem is missing name-reference separator", list.contains(ParserProblem.NameReferenceSeparation));
......
904 933
		assertEquals(47, nameNoSeparator.getProblemEnds());   //TODO better stop before :
905 934
		
906 935
		String strUnparsableInRef2 = "Hieracium pepsicum L., My Bookkkk 1. 1903";
907
		NonViralName<?> nameUnparsableInRef2 = parser.parseReferencedName(strUnparsableInRef2, null, Rank.SPECIES());
936
		NonViralName<?> nameUnparsableInRef2 = parser.parseReferencedName(strUnparsableInRef2, null, rankSpecies);
908 937
		assertTrue(nameUnparsableInRef2.hasProblem());
909 938
		list = nameUnparsableInRef2.getParsingProblems();
910 939
		assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
......
1061 1090
	
1062 1091
	
1063 1092
	
1093
	
1094
	
1064 1095
	/**
1065 1096
	 * @param testParsable
1066 1097
	 * @param icbn

Also available in: Unified diff