protected static int authorSeparatorMaxPosition = 3; //author may have a maximum of 2 words
protected static String pTitleWordSeparator = "(\\."+ fWs+"|" + oWs + "|\\.?[-\u2013]"+oWs+"|\\.?" + oWs + "&(?!\\s*al\\.)" + oWs + ")";
- protected static String pSeriesPart = fWs + ",?" + fWs + "(([sS][e\u00E9]r|сер)("+oWs+"|\\."+fWs+")(\\d{1,2}|[A-Z](\\s*\\d{1,2})?)|n(ov)?\\.\\s*[sS](er)?\\.|Jerusalem Ser\\.|(Pt|Sect)\\.\\s*\\d{1,2}),?"; //Pt. (Part) and Sect. (Section) currently handled as series part, which is part of title, may be handled different later
+ protected static String notReallySeriesPart = "(Pt|Sect|Abt)\\.\\s*\\d{1,2}";//Pt. (Part) and Sect. (Section) and Abt. currently handled as series part, which is part of title, may be handled different later
+ protected static String pSeriesPart = fWs + ",?" + fWs + "(([sS][e\u00E9]r|сер)("+oWs+"|\\."+fWs+")(\\d{1,2}|[A-Z](\\s*\\d{1,2})?)|n(ov)?\\.\\s*[sS](er)?\\.|Jerusalem Ser\\.|" + notReallySeriesPart +"),?";
protected static String authorPrefix = "(Da(lla)?|Van|La|De)" + oWs; //should not include words allowed in first part of reference title
protected static String firstTitleWord = "(?!"+authorPrefix+")" + word + "('\\p{javaLowerCase}*|\\.?[-\u2013]"+dotWord+")?"; //word with optional apostrophe in between
matcher = seriesPattern.matcher("nov. Ser.");
Assert.assertTrue("", matcher.matches());
+
+ //not really series "Abt. 2"
+ String nameStr = "Hydrogonium consanguineum Hilp. in Beih. Bot. Centralbl., Abt. 2, 50(3): 626. 1933";
+ TaxonName name = parser.parseReferencedName(nameStr);
+ Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
+ Reference ref = name.getNomenclaturalReference();
+ Assert.assertEquals(ReferenceType.Article, ref.getType());
+ Reference inRef = ref.getInReference();
+ //TODO handling of Abt. not fully correct, should better go into title
+ Assert.assertEquals("Beih. Bot. Centralbl., Abt. 2", inRef.getAbbrevTitle());
+ Assert.assertEquals(null, ref.getSeriesPart());
+ Assert.assertEquals("50(3)", ref.getVolume());
+ Assert.assertEquals(nameStr, name.getFullTitleCache());
+ String detail = name.getNomenclaturalMicroReference();
+ Assert.assertEquals("626", detail);
}
@Test
assertEquals(ReferenceType.BookSection, nomRef.getType());
assertEquals( "Strid & Kit Tan", nomRef.getInReference().getAuthorship().getNomenclaturalTitleCache());
assertEquals( "Mount. Fl. Greece", nomRef.getInReference().getAbbrevTitle());
+
+
+ //, Ser. B, Div. 2, Bot. from E+M mosses import
+ nameStr = "Schistidium subconfertum (Broth.) Deguchi in J. Sci. Hiroshima Univ., Ser. B, Div. 2, Bot. 16: 240. 1979";
+ name = parser.parseReferencedName(nameStr);
+ Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
+ Reference ref = name.getNomenclaturalReference();
+ Assert.assertEquals(ReferenceType.Article, ref.getType());
+ Reference inRef = ref.getInReference();
+ Assert.assertEquals("J. Sci. Hiroshima Univ., Ser. B, Div. 2, Bot.", inRef.getAbbrevTitle());
+ Assert.assertEquals(null, ref.getSeriesPart());
+ Assert.assertEquals("60", ref.getVolume());
+ Assert.assertEquals(nameStr, name.getFullTitleCache());
+ String detail = name.getNomenclaturalMicroReference();
+ Assert.assertEquals("240", detail);
}
//this is a slot for testing new string, once the Strings tested here work move the according test