Project

General

Profile

Revision 88710aed

ID88710aedb055b88f2c6adad58224357fd99ac5c8
Parent a1ab6a74
Child e6883603

Added by Andreas Müller over 1 year ago

ref #7800 improve parsing of details and reference titles

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java
129 129
    //details
130 130
    //TODO still not all parsed
131 131

  
132

  
133
    protected static String simpleRoman = "([IVXLC]+|[ivxlc]+)";
134

  
132 135
    protected static String nr2 = "\\d{1,2}";
133 136
    protected static String nr4 = "\\d{1,4}";
134 137
    protected static String nr5 = "\\d{1,5}";
135 138

  
136 139

  
137 140
    protected static String pPage = nr5 + "[a-zA-Z]?";
138
    protected static String pStrNo = "n\u00B0" + fWs + "(" + nr4 + ")";
141
    protected static String pStrNo = "("+capitalWord + oWs + ")?n[o\u00B0]?\\.?" + fWs + "(" + nr4 + ")";
139 142

  
140 143
    protected static String pBracketNr = "\\[" + nr4 + "\\]";
141 144
    protected static String pFolBracket = "\\[fol\\." + fWs + "\\d{1,2}(-\\d{1,2})?\\]";  //maybe merge with pTabFigPlate (see below)
142 145

  
143 146

  
144 147
    protected static String pRangeSep = "[-\u2013]";
145
    protected static String pRangeSepCo = "[-\u2013,]";
148
    protected static String pRangeSepCo = "[-\u2013,/]";
146 149

  
147 150
    protected static String pTabFigPlateStart = "([tT](abs?)?|[fF](igs?)?|[pP]l?s?)(\\.|\\s|$)";   //$ for only 'f'
148
    protected static String pAbcNr = "[a-zA-Z\u00DF]";
149
    protected static String pTabFigPlateNumber = "(" + nr4 + "|" + pAbcNr + "|" + nr4 + fWs + pAbcNr + ")" + "("+ pRangeSepCo + fWs + pAbcNr + ")?";
150
    protected static String pTabFigPlateNumbers = "(" + pTabFigPlateNumber + "(" + pRangeSepCo + fWs + pTabFigPlateNumber + ")?)";
151
    protected static String pAbcNr = "([a-zA-Z\u00DF]|bis)";
152
    protected static String pTabFigPlateNumber = "(" + nr4 + "|" + pAbcNr + "|" + nr4 + fWs + pAbcNr + "|" + simpleRoman + ")("+ pRangeSepCo + fWs + pAbcNr + ")?";
153
    protected static String pTabFigPlateNumbers = "(" + pTabFigPlateNumber + "(" + pRangeSepCo + fWs + pTabFigPlateNumber + ")?|s.n.)";
151 154

  
152 155
    protected static String pTabFigPlate = pTabFigPlateStart + fWs + pTabFigPlateNumbers + "?";
153 156
    protected static String pTabFigPl = pTabFigPlate;
......
169 172
    //TODO
170 173
    // protected static String pSpecialDetail = "(in err|in tab|sine pag|add\\. & emend|Emend|""\\d{3}"" \\[\\d{3}\\])";
171 174
 // protected static String pSpecialDetail = "(in err|in tab|sine pag|add\\. & emend|Emend|""\\d{3}"" \\[\\d{3}\\])";
172
    protected static String pSpecialDetail = "(in err|in tab|sine pag|add\\.|s.p.?)";
173

  
174

  
175
//    Const romI = "[Ii]{0,3}"
176
//    	Const romX = "[Xx]{0,3}"
177
//    	Const romC = "[Cc]{0,3}"
178
//    	Const romM = "[Mm]{0,3}"
179
//    ' roman numbers
180
//    ' !! includes empty string: ""
181
//    romOne = "([Vv]?" & romI & or_ & "(IV|iv)" & or_ & "(IX|ix)" & ")"
182
//    romTen = "([Ll]?" & romX & or_ & "(XL|xl)" & or_ & "(XC|xc)" & ")"
183
//    romHun = "([Dd]?" & romC & or_ & "(CD|cd)" & or_ & "(CM|cm)" & ")"
184
//    romNr = "(?=[MDCLXVImdclxvi])(((" & romM & ")?" & romHun & ")?" & romTen & ")?" & romOne
185
    protected static String simpleRoman = "([IVXLC]+|[ivxlc]+)";
175
    protected static String pSpecialDetail = "(in err|in tab|sine pag|add\\.|s.p.?|errata)";
186 176

  
187
    protected static String pRomNr = "ljfweffaflas"; //TODO rom number have to be tested first
188 177

  
189 178
//    "(,\\s*" + pTabFigPl + ")?" +
190 179
    protected static String pDetailAlternatives = "(" + pPages + "|" + pPageSpecial + "|" + pStrNo + "|" + pBracketNr +
191
    			"|" + pTabFigPl + "(,\\s*" + pTabFigPl + ")?" + "|" + pTabSpecial + "|" + pFolBracket + "|" + pCouv + "|" + pRomNr + "|" +
180
    			"|" + pTabFigPl + "(,\\s*" + pTabFigPl + ")?" + "|" + pTabSpecial + "|" + pFolBracket + "|" + pCouv + "|" +
192 181
    			pSpecialGardDict + "|" + pSpecialDetail + "|" + pPagesTabFig + "|" + simpleRoman +  ")";
193 182

  
194 183
    protected static String detail = pDetailAlternatives;
195 184

  
196 185
    //reference
197
    protected static String volume = nr4 + "[A-Za-z]?" + fWs + "(\\("+ nr4 + "[A-Za-z]?"  + "([-\u2013]" + nr4 + ")?\\)|[-\u2013]"+nr4+")?" + "(\\(((Suppl|Beibl|App|Beil|Misc|Vorabdr)\\.(\\s*\\d{1,4})?|Heft\\s*\\d{1,4})\\))?";
186
    protected static String volume =     nr4 + "[A-Za-z]?" + fWs + "(\\("+ nr4 + "[A-Za-z]?"  + "([-\u2013]" + nr4 + ")?\\)|[-\u2013]"+nr4+")?" + "(\\(((\\d{1,2},\\s*)?(Suppl|Beibl|App|Beil|Misc|Vorabdr|Erg)\\.(\\s*\\d{1,4})?|Heft\\s*\\d{1,4})\\))?";
187
    protected static String volume_old = nr4 + "[A-Za-z]?" + fWs + "(\\("+ nr4 + "[A-Za-z]?"  + "([-\u2013]" + nr4 + ")?\\)|[-\u2013]"+nr4+")?" + "(\\(((d{1,2}\\s*)?(Suppl|Beibl|App|Beil|Misc|Vorabdr|Erg)\\.(\\s*\\d{1,4})?|Heft\\s*\\d{1,4})\\))?";
198 188
    //this line caused problem https://dev.e-taxonomy.eu/trac/ticket/1556 in its original form: "([\u005E:\\.]" + fWs + ")";
199
    protected static String anySepChar = "([\u005E:a-zA-Z]" + fWs + ")"; //all characters except for the detail separator, a stricter version would be [,\\-\\&] and some other characters
189
    protected static String anySepChar = "([\u005E:a-zA-Z]" + fWs + "|" +oWs + "&" + oWs + ")"; //all characters except for the detail separator, a stricter version would be [,\\-\\&] and some other characters
200 190
//  protected static String anySepChar = "([,\\-\\&\\.\\+\\']" + fWs + ")";
191
    protected static String quotations = "\""+capitalDotWord + "(" + oWs + capitalDotWord +")*\"";
201 192

  
202 193
    protected static int authorSeparatorMaxPosition = 3;  //author may have a maximum of 2 words
203
    protected static String pTitleWordSeparator = "(\\."+ fWs+"|" + oWs + "|\\.?[-\u2013])";
204
    protected static String pSeriesPart = ",?" + fWs + "([sS][e\u00E9]r("+oWs+"|\\."+fWs+")(\\d{1,2}|[A-Z])|[na]\\.s\\.),?";
194
    protected static String pTitleWordSeparator = "(\\."+ fWs+"|" + oWs + "|\\.?[-\u2013]"+fWs+"|\\.?" + oWs + "&" + oWs + ")";
195
    protected static String pSeriesPart = ",?" + fWs + "([sS][e\u00E9]r("+oWs+"|\\."+fWs+")(\\d{1,2}|[A-Z](\\s*\\d{1,2})?)|n(ov)?\\.\\s*[sS](er)?\\.|Jerusalem Ser\\.|Pt\\.\\s*\\d{1,2}),?";  //Pt. (Part) currently handled as series part, may be handled different later
205 196

  
206 197
    protected static String referenceTitleFirstPart = "(" + apostropheWord + pTitleWordSeparator + "|" + twoCapitalDotWord + fWs + ")";
207
    protected static String referenceTitle = referenceTitleFirstPart + "*" + "("+ dotWord + "|" + uppercaseWord + "|" + pSeriesPart + ")";  //reference title may have words separated by whitespace or dot. The last word may not have a whitespace at the end. There must be at least one word
198
    protected static String referenceTitle = referenceTitleFirstPart + "*" + "("+ dotWord + "|" + uppercaseWord + "|" + quotations + "|" + pSeriesPart + ")";  //reference title may have words separated by whitespace or dot. The last word may not have a whitespace at the end. There must be at least one word
208 199
    protected static String referenceTitleWithSepCharacters = "(((" + referenceTitle +"|\\(.+\\))"  + anySepChar + ")*" + referenceTitle + ")"; //,?
209 200
    //TODO test performance ??
210 201
    protected static String referenceTitleWithSepCharactersAndBrackets = referenceTitleWithSepCharacters + fWs + "(\\(" + referenceTitleWithSepCharacters + "\\)"+fWs+ ")?(" + referenceTitleWithSepCharacters +")?"  ;
211 202

  
212
    protected static String referenceTitleWithoutAuthor = "(" + referenceTitleFirstPart + ")" + "{"+ (authorSeparatorMaxPosition -1) +",}" + dotWord +
203
    protected static String referenceTitleWithoutAuthor = "(" + referenceTitleFirstPart + "){"+ (authorSeparatorMaxPosition -1) +",}" + dotWord +
213 204
    			anySepChar + referenceTitleWithSepCharactersAndBrackets ;   //separators exist and first separator appears at position authorSeparatorMaxPosition or later
214
    protected static String referenceTitleWithPlaceBracket = referenceTitle + "(" + oWs + "\\(" + capitalWord + "(" + oWs + "(& )?" +  capitalWord + ")?" + "\\))?" ;
205
    protected static String referenceTitleWithPlaceBracket = referenceTitle + "(" + oWs + "\\(" + capitalWord + "(" + oWs + "(&\\s+)?" +  capitalWord + ")?" + "\\))?" ;
215 206

  
216 207
    protected static String editionSeparator = "(" + oWs + "|," + fWs + ")ed\\.?" + oWs;  //
217 208
    protected static String pEdition = nr2;
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
1732 1732
        nomRef = name.getNomenclaturalReference();
1733 1733
        assertEquals(ReferenceType.Book, nomRef.getType());
1734 1734
        assertEquals(name.getNomenclaturalMicroReference(), "xv");
1735

  
1736
        //n. 1
1737
        parseStr = "Olea gallica Mill., Gard. Dict. ed. 8: n. 1. 1768";
1738
        name = parser.parseReferencedName(parseStr);
1739
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1740
        nomRef = name.getNomenclaturalReference();
1741
        assertEquals(ReferenceType.Book, nomRef.getType());
1742
        assertEquals(name.getNomenclaturalMicroReference(), "n. 1");
1743

  
1744
        parseStr = "Lavandula canariensis Mill., Gard. Dict. ed. 8: Lavandula no. 4. 1768";
1745
        name = parser.parseReferencedName(parseStr);
1746
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1747
        nomRef = name.getNomenclaturalReference();
1748
        assertEquals(ReferenceType.Book, nomRef.getType());
1749
        assertEquals(name.getNomenclaturalMicroReference(), "Lavandula no. 4");
1750

  
1751
        parseStr = "Aceras anthropomorphum (Pers.) Sm. in Rees, Cycl. 39(1): Aceras n. 2. 1818";
1752
        name = parser.parseReferencedName(parseStr);
1753
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1754
        nomRef = name.getNomenclaturalReference();
1755
        assertEquals(ReferenceType.BookSection, nomRef.getType());
1756
        assertEquals(name.getNomenclaturalMicroReference(), "Aceras n. 2");
1757

  
1758
        parseStr = "Chlorolepis Nutt. in Trans. Amer. Philos. Soc., n.s., 7: errata. 1841";
1759
        name = parser.parseReferencedName(parseStr);
1760
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1761
        nomRef = name.getNomenclaturalReference();
1762
        assertEquals(ReferenceType.Article, nomRef.getType());
1763
        assertEquals(name.getNomenclaturalMicroReference(), "errata");
1764

  
1765
        parseStr = "Yermoloffia B\u00e9l., Voy. Indes Or.: t. s.n.. 1846";
1766
        name = parser.parseReferencedName(parseStr);
1767
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1768
        nomRef = name.getNomenclaturalReference();
1769
        assertEquals(ReferenceType.Book, nomRef.getType());
1770
        assertEquals(name.getNomenclaturalMicroReference(), "t. s.n.");
1771

  
1772
        parseStr = "Gagea mauritanica Durieu, Expl. Sci. Alg\u00e9rie, Atlas: t. 45bis, f. 4. 1850";
1773
        name = parser.parseReferencedName(parseStr);
1774
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1775
        nomRef = name.getNomenclaturalReference();
1776
        assertEquals(ReferenceType.Book, nomRef.getType());
1777
        assertEquals(name.getNomenclaturalMicroReference(), "t. 45bis, f. 4");
1778

  
1779
        parseStr = "Orchis latifolia f. blyttii Rchb. f. in Reichenbach, Icon. Fl. Germ. Helv. 13-14: 60, t. 59, f. III. 1851";
1780
        name = parser.parseReferencedName(parseStr);
1781
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1782
        nomRef = name.getNomenclaturalReference();
1783
        assertEquals(ReferenceType.BookSection, nomRef.getType());
1784
        assertEquals(name.getNomenclaturalMicroReference(), "60, t. 59, f. III");
1785

  
1786
        parseStr = "Ephedra alata var. decaisnei Stapf in Denkschr. Kaiserl. Akad. Wiss., Wien. Math.-Naturwiss. Kl. 56(2): t. 1/1. 1889";
1787
        name = parser.parseReferencedName(parseStr);
1788
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1789
        nomRef = name.getNomenclaturalReference();
1790
        assertEquals(ReferenceType.Article, nomRef.getType());
1791
        assertEquals(name.getNomenclaturalMicroReference(), "t. 1/1");
1735 1792
    }
1736 1793

  
1737 1794
    @Test
......
1797 1854
        assertNull(nomRef.getEdition());
1798 1855
        assertEquals("54B", nomRef.getVolume());
1799 1856

  
1857

  
1858
        //1, Erg.
1859
        Pattern seriesPattern = Pattern.compile(NonViralNameParserImplRegExBase.volume);
1860
        Matcher matcher = seriesPattern.matcher("12(1, Erg.)");
1861
        Assert.assertTrue("12(1, Erg.) should match", matcher.matches());
1862

  
1863
        parseStr = "Scilla amethystina Vis. in Flora Abt Awer Ser 12(1, Erg.): 11. 1829";
1864
        name = parser.parseReferencedName(parseStr);
1865
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1866
        nomRef = name.getNomenclaturalReference();
1867
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1868
        assertEquals(ReferenceType.Article, nomRef.getType());
1869
        assertNull(nomRef.getEdition());
1870
        assertEquals("12(1, Erg.)", nomRef.getVolume());
1871

  
1872

  
1800 1873
//        Epipactis helleborine subsp. ohwii (Fukuy.) H. J. Su in Fl. Taiwan, ed. 2, 5: 861. 2000
1801 1874
    }
1802 1875

  
......
1814 1887
        assertEquals("36(1)", nomRef.getVolume());
1815 1888
    }
1816 1889

  
1890
    @Test
1891
    public final void testTitleSpecials(){
1892
        //Pt. 2  (currently handled as series part, may change in future
1893
        String parseStr = "Iris pumila subsp. sintenisiiformis Prodán in Ann. Sci. Univ. Jassy, Pt. 2, Sci. Nat. 27: 89. 1941";
1894
        TaxonName name = parser.parseReferencedName(parseStr);
1895
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1896
        Reference nomRef = name.getNomenclaturalReference();
1897
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1898
        assertEquals(ReferenceType.Article, nomRef.getType());
1899
        assertEquals("Ann. Sci. Univ. Jassy, Pt. 2, Sci. Nat.", nomRef.getInReference().getAbbrevTitle());
1900
        assertNull(nomRef.getEdition());
1901
        assertEquals("27", nomRef.getVolume());
1902

  
1903
        // "- "
1904
        parseStr = "Theresia tulipilfoia (M. Bieb.) Klatt in Hamburger Garten- Blumenzeitung 16: 438. 1860";
1905
        name = parser.parseReferencedName(parseStr);
1906
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1907
        nomRef = name.getNomenclaturalReference();
1908
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1909
        assertEquals(ReferenceType.Article, nomRef.getType());
1910
        assertEquals("Hamburger Garten- Blumenzeitung", nomRef.getInReference().getAbbrevTitle());
1911
        assertNull(nomRef.getEdition());
1912
        assertEquals("16", nomRef.getVolume());
1913

  
1914
        parseStr = "Hyssopus officinalis var. pilifer Pant. in Verh. Vereins Natur- Heilk. Presburg, n.s., 2: 61. 1874";
1915
        name = parser.parseReferencedName(parseStr);
1916
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1917
        nomRef = name.getNomenclaturalReference();
1918
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1919
        assertEquals(ReferenceType.Article, nomRef.getType());
1920
        //, n.s., is not necessarily part of the title in future
1921
        assertEquals("Verh. Vereins Natur- Heilk. Presburg, n.s.,", nomRef.getInReference().getAbbrevTitle());
1922
        assertNull(nomRef.getEdition());
1923
        assertEquals("2", nomRef.getVolume());
1924

  
1925
          //Note: space in E+M, no space in IPNI; is it really a book?
1926
        parseStr = "Amaryllis dubia Houtt., Handl. Pl.- Kruidk. 12: 181. 1780";
1927
        name = parser.parseReferencedName(parseStr);
1928
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1929
        nomRef = name.getNomenclaturalReference();
1930
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1931
        assertEquals(ReferenceType.Book, nomRef.getType());
1932
        assertEquals("Handl. Pl.- Kruidk.", nomRef.getAbbrevTitle());
1933
        assertNull(nomRef.getEdition());
1934
        assertEquals("12", nomRef.getVolume());
1935

  
1936
        // "..."
1937
        parseStr = "Chamaesyce biramensis (Urb.) Alain in Contr. Ocas. Mus. Hist. Nat. Colegio \"De La Salle\" 11: 12. 1952";
1938
        name = parser.parseReferencedName(parseStr);
1939
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1940
        nomRef = name.getNomenclaturalReference();
1941
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1942
        assertEquals(ReferenceType.Article, nomRef.getType());
1943
        assertEquals("Contr. Ocas. Mus. Hist. Nat. Colegio \"De La Salle\"", nomRef.getInReference().getAbbrevTitle());
1944
        assertNull(nomRef.getEdition());
1945
        assertEquals("11", nomRef.getVolume());
1946

  
1947
        //' & '
1948
        parseStr = "Mannaphorus Raf. in Amer. Monthly Mag. & Crit. Rev. 1: 175. 1818";
1949
        name = parser.parseReferencedName(parseStr);
1950
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1951
        nomRef = name.getNomenclaturalReference();
1952
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1953
        assertEquals(ReferenceType.Article, nomRef.getType());
1954
        assertEquals("Amer. Monthly Mag. & Crit. Rev.", nomRef.getInReference().getAbbrevTitle());
1955
        assertNull(nomRef.getEdition());
1956
        assertEquals("1", nomRef.getVolume());
1957

  
1958
        //only for debugging
1959
        boolean  matches;
1960
        matches = "Flo & Amer. Fauna. Ab.".matches (NonViralNameParserImplRegExBase.referenceTitleFirstPart + "*");
1961
        Assert.assertTrue("referenceTitleFirstPart", matches);
1962

  
1963
        matches = "Fl. Amer. & Fauna. Ab. 101".matches (NonViralNameParserImplRegExBase.pSoftArticleReference);
1964
        Assert.assertTrue("pSoftArticleReference", matches);
1965
        //only for debugging end
1966

  
1967
        parseStr = "Corallorhiza trifida subsp. virescens (Drejer) Løjtnant in Fl. & Fauna (Esbjerg) 101: 71. 1996";
1968
        name = parser.parseReferencedName(parseStr);
1969
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1970
        nomRef = name.getNomenclaturalReference();
1971
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1972
        assertEquals(ReferenceType.Article, nomRef.getType());
1973
        assertEquals("Fl. & Fauna (Esbjerg)", nomRef.getInReference().getAbbrevTitle());
1974
        assertNull(nomRef.getEdition());
1975
        assertEquals("101", nomRef.getVolume());
1976

  
1977
        parseStr = "Crocus isauricus Siehe ex Bowles, Handb. Crocus & Colch.: 126. 1924";
1978
        name = parser.parseReferencedName(parseStr);
1979
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1980
        nomRef = name.getNomenclaturalReference();
1981
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1982
        assertEquals(ReferenceType.Book, nomRef.getType());
1983
        assertEquals("Handb. Crocus & Colch.", nomRef.getAbbrevTitle());
1984
        assertNull(nomRef.getEdition());
1985
        assertNull(nomRef.getVolume());
1986

  
1987
        parseStr = "Ornithogalum bifolium (L.) Neck. in Hist. & Commentat. Acad. Elect. Sci. Theod.-Palat. 2: 461. 1770";
1988
        name = parser.parseReferencedName(parseStr);
1989
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
1990
        nomRef = name.getNomenclaturalReference();
1991
        Assert.assertFalse("nom.ref. should be parsable", nomRef.isProtectedTitleCache());
1992
        assertEquals(ReferenceType.Article, nomRef.getType());
1993
        assertEquals("Hist. & Commentat. Acad. Elect. Sci. Theod.-Palat.", nomRef.getInReference().getAbbrevTitle());
1994
        assertNull(nomRef.getEdition());
1995
        assertEquals("2", nomRef.getVolume());
1996

  
1997
    }
1817 1998

  
1818 1999

  
1819 2000
    @Test
......
1825 2006
        matcher = seriesPattern.matcher("n.s.");
1826 2007
        Assert.assertTrue("", matcher.matches());
1827 2008

  
1828
        matcher = seriesPattern.matcher("a.s.");
1829
        Assert.assertTrue("", matcher.matches());
2009
//        matcher = seriesPattern.matcher("a.s.");
2010
//        Assert.assertTrue("", matcher.matches());
1830 2011

  
1831
        //do NOT match edition
2012
        //do NOT match edition  //but there are such cases like "Vilm. Blumengärtn. ed. 3" according to TL-2
1832 2013
        matcher = seriesPattern.matcher("ed. 4");
1833 2014
        Assert.assertFalse("", matcher.matches());
1834 2015

  
1835 2016
        matcher = seriesPattern.matcher("Ser. C");
1836 2017
        Assert.assertTrue("", matcher.matches());
1837 2018

  
2019
        matcher = seriesPattern.matcher("Sér. B 1");
2020
        Assert.assertTrue("", matcher.matches());
2021

  
2022
        matcher = seriesPattern.matcher("Jerusalem Ser.");
2023
        Assert.assertTrue("", matcher.matches());
2024

  
2025
        matcher = seriesPattern.matcher("nov. Ser.");
2026
        Assert.assertTrue("", matcher.matches());
2027

  
2028

  
2029

  
1838 2030
    }
1839 2031

  
1840 2032
    /**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)