\r
protected String getRanklessNameCache(NonViralName nonViralName){\r
String result = "";\r
- result = (result + (nonViralName.getGenusOrUninomial())).trim().replace("null", "-");\r
+ result = (result + (nonViralName.getGenusOrUninomial())).trim().replace("null", "");\r
result += " " + (CdmUtils.Nz(nonViralName.getSpecificEpithet())).trim();\r
result += " " + (CdmUtils.Nz(nonViralName.getInfraSpecificEpithet())).trim();\r
- result = result.trim().replace("null", "-");\r
+ result = result.trim().replace("null", "");\r
//result += " (rankless)";\r
result = addAppendedPhrase(result, nonViralName);\r
return result; \r
"e0d733a8-7777-4b27-99a3-05ab50e9f312",,"Nudum","nom. nud."\r
"f858e619-7b7f-4225-913b-880a2143ec83",,"Combination Invalid","comb. inval."\r
"a277507e-ad93-4978-9419-077eb889c951",,"Provisional","nom. provis."\r
-"bd036217-5499-4ccd-8f4c-72e06158db93",,"Valid","-"\r
+"bd036217-5499-4ccd-8f4c-72e06158db93",,"Valid","valid"\r
"a5055d80-dbba-4660-b091-a1835d59fe7c",,"Opus Utique Oppr","opus. utique oppr."\r
"92a76bd0-6ea8-493f-98e0-4be0b98c092f",,"Subnudum","nom. subnud."\r
assertTrue(false);\r
}\r
\r
-\r
+ //null\r
+ String strNull = null;\r
+ NonViralName<?> nameNull = parser.parseReferencedName(strNull, null, Rank.SPECIES());\r
+ assertNull(nameNull);\r
+ \r
+ //Empty\r
+ String strEmpty = "";\r
+ NonViralName<?> nameEmpty = parser.parseReferencedName(strEmpty, null, Rank.SPECIES());\r
+ assertFalse(nameEmpty.hasProblem());\r
+ assertEquals(strEmpty, nameEmpty.getFullTitleCache());\r
+ assertNull(nameEmpty.getNomenclaturalMicroReference());\r
+ \r
\r
//Book\r
String fullReference = "Abies alba Mill., Sp. Pl. 4: 455. 1987.";\r
assertEquals(41, nameUnparsableInRef2.getProblemEnds()); \r
\r
\r
+ String strUnparsableInRef3 = "Hieracium pespcim N., My Bookkkk 1. 1902";\r
+ NonViralName<?> nameUnparsableInRef3 = parser.parseReferencedName(strUnparsableInRef3, null, null);\r
+ assertTrue(nameUnparsableInRef3.hasProblem());\r
+ assertEquals(strUnparsableInRef3, nameUnparsableInRef3.getFullTitleCache());\r
+ assertEquals(22, nameUnparsableInRef3.getProblemStarts()); \r
+ assertEquals(40, nameUnparsableInRef3.getProblemEnds()); \r
+ \r
+ String strUnparsableInRef4 = "Hieracium pepsicum (Hsllreterto) L., My Bookkkk 1. 1903";\r
+ NonViralName<?> nameUnparsableInRef4 = parser.parseReferencedName(strUnparsableInRef4, null, null);\r
+ assertTrue(nameUnparsableInRef4.hasProblem());\r
+ assertEquals(strUnparsableInRef4, nameUnparsableInRef4.getFullTitleCache());\r
+ assertEquals(37, nameUnparsableInRef4.getProblemStarts()); \r
+ assertEquals(55, nameUnparsableInRef4.getProblemEnds()); \r
+ \r
+ String strSameName = "Hieracium pepcum (Hsllreterto) L., My Bokkk 1. 1903";\r
+ NonViralName<?> nameSameName = nameUnparsableInRef4;\r
+ parser.parseReferencedName(nameSameName, strSameName, null, true);\r
+ assertTrue(nameSameName.hasProblem());\r
+ assertEquals(strSameName, nameSameName.getFullTitleCache());\r
+ assertEquals(35, nameSameName.getProblemStarts()); \r
+ assertEquals(51, nameSameName.getProblemEnds()); \r
+ \r
+ \r
\r
}\r
\r