Project

General

Profile

Revision b0e33417

IDb0e33417efb4b9cd585c7380645e71bd9ea264b5
Parent 1665d3a3
Child 2985a328

Added by unknown over 1 year ago

ref #7094 revert remove space between initials and name in nomencl. person title as default

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
65 65
	final static boolean MAKE_NOT_EMPTY = false;
66 66

  
67 67
	private final boolean authorIsAlwaysTeam = false;
68
	private final boolean removeSpaceAfterDot = false;
68
	private boolean removeSpaceAfterDot = false;
69 69

  
70
	public static NonViralNameParserImpl NewInstance(){
70
    public static NonViralNameParserImpl NewInstance(){
71 71
		return new NonViralNameParserImpl();
72 72
	}
73 73

  
......
1525 1525
		//hybrid relationships handled in hybrid formula and at end of fullNameParser
1526 1526
	}
1527 1527

  
1528

  
1528 1529
    /**
1529
     * @return the removeSpaceAfterDot
1530
     * If <code>true</code> author names are parsed such that spaces after the abbreviated
1531
     * firstname are removed (IPNI style). see #7094
1530 1532
     */
1531 1533
    public boolean isRemoveSpaceAfterDot() {
1532 1534
        return removeSpaceAfterDot;
1533 1535
    }
1536
    /**
1537
     * @see #isRemoveSpaceAfterDot()
1538
     */
1539
    public void setRemoveSpaceAfterDot(boolean removeSpaceAfterDot) {
1540
        this.removeSpaceAfterDot = removeSpaceAfterDot;
1541
    }
1534 1542
}
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategyTest.java
171 171
		name = TaxonNameFactory.NewBotanicalInstance(null);
172 172
		NonViralNameParserImpl.NewInstance().parseFullName(name, "Cichorium glandulosum Boiss. \u0026 A. Huet", null, true);
173 173
		Taxon taxon = Taxon.NewInstance(name, sec);
174
		//remove space since #7094
175
		assertEquals("Cichorium glandulosum Boiss. \u0026 A.Huet sec. Sp.Pl.", taxon.getTitleCache());
174
		assertEquals("Cichorium glandulosum Boiss. \u0026 A. Huet sec. Sp.Pl.", taxon.getTitleCache());
176 175
	}
177 176

  
178 177
    @Test
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonShortSecCacheStrategyTest.java
51 51
	 */
52 52
	@BeforeClass
53 53
	public static void setUpBeforeClass() throws Exception {
54
	    shortStrategy = new TaxonBaseShortSecCacheStrategy<TaxonBase>();
54
	    shortStrategy = new TaxonBaseShortSecCacheStrategy<>();
55 55
	}
56 56

  
57 57
	/**
......
117 117
		name = TaxonNameFactory.NewBotanicalInstance(null);
118 118
		NonViralNameParserImpl.NewInstance().parseFullName(name, "Cichorium glandulosum Boiss. \u0026 A. Huet", null, true);
119 119
		Taxon taxon = Taxon.NewInstance(name, sec);
120
		//remove space since #7094
121
		assertEquals("Cichorium glandulosum Boiss. \u0026 A.Huet sec. Sp.Pl.", taxon.getTitleCache());
120
		assertEquals("Cichorium glandulosum Boiss. \u0026 A. Huet sec. Sp.Pl.", taxon.getTitleCache());
122 121
	}
123 122

  
124 123
    @Test
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
370 370
        name = parser.parseFullName(fullNameString);
371 371
        assertFalse(name.hasProblem());
372 372
        assertNotNull(name.getCombinationAuthorship());
373
        //removing space since #7094
374
        assertEquals("H.Keng", name.getCombinationAuthorship().getNomenclaturalTitle());
373
        assertEquals("H. Keng", name.getCombinationAuthorship().getNomenclaturalTitle());
375 374

  
376 375
        //name without combination  author  , only to check if above fix for #5618 works correctly
377 376
        fullNameString = "Gordonia moaensis (Vict.)";
......
566 565
        assertTrue("Name must have binom hybrid bit set", name1.isBinomHybrid());
567 566
        assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid());
568 567
        assertFalse("Name must not be protected", name1.isProtectedTitleCache());
569
        //remove space since #7094
570
        assertEquals(nameStr.replace("E. Kl", "E.Kl"), name1.getTitleCache()); //we expect the cache strategy to create the same result
568
        assertEquals(nameStr, name1.getTitleCache()); //we expect the cache strategy to create the same result
571 569

  
572 570
        name1 = parser.parseReferencedName(nameStr);
573 571
        assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid());
574 572
        assertTrue("Name must have binom hybrid bit set", name1.isBinomHybrid());
575 573
        assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid());
576 574
        assertFalse("Name must not be protected", name1.isProtectedTitleCache());
575
        assertEquals(nameStr, name1.getTitleCache()); //we expect the cache strategy to create the same result
576

  
577 577
        //remove space since #7094
578
        parser.setRemoveSpaceAfterDot(true);
579
        name1 = parser.parseReferencedName(nameStr);
578 580
        assertEquals(nameStr.replace("E. Kl", "E.Kl"), name1.getTitleCache()); //we expect the cache strategy to create the same result
581
        parser.setRemoveSpaceAfterDot(false);
579 582

  
580 583
    }
581 584

  
......
2034 2037
                + " in Mem. NY. Bot. Gard. 22: 75. 1972");
2035 2038
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
2036 2039
        combinationAuthor = name.getCombinationAuthorship();
2037
        //remove space since #7094
2038
        assertEquals( "W.R.Anderson", combinationAuthor.getNomenclaturalTitle());
2040
        assertEquals( "W.R. Anderson", combinationAuthor.getNomenclaturalTitle());
2039 2041
        nomRef = (Reference)name.getNomenclaturalReference();
2040 2042
        assertEquals(ReferenceType.Article, nomRef.getType());
2041 2043
        assertEquals("22", nomRef.getVolume());
......
2129 2131
                + " in Phytologia 26 (6): 488-489, f. 1973");
2130 2132
        Assert.assertFalse("Name should be parsable", name.isProtectedTitleCache());
2131 2133
        combinationAuthor = name.getCombinationAuthorship();
2132
        //remove space since #7094
2133
        assertEquals( "L.O.Williams", combinationAuthor.getNomenclaturalTitle());
2134
        assertEquals( "L.O. Williams", combinationAuthor.getNomenclaturalTitle());
2134 2135
        nomRef = (Reference)name.getNomenclaturalReference();
2135 2136
        assertEquals(ReferenceType.Article, nomRef.getType());
2136 2137
        assertEquals("26 (6)", nomRef.getVolume());

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)