Project

General

Profile

Revision 8b7f15a5

ID8b7f15a55fb9e9f229d4729ee0d82b1ccec6318b
Parent 825e3afb
Child 572a0d71

Added by Andreas Müller over 3 years ago

fix #6656 autonym hybrid parsing with parseReference

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java
281 281
    protected static String oldInfraSpecies = capitalEpiWord + oWs +  nonCapitalEpiWord + oWs + oldInfraSpeciesMarker + oWs + nonCapitalEpiWord;
282 282
    protected static String autonym = capitalEpiWord + oWs + "(" + nonCapitalEpiWord +")" + oWs + fullBotanicAuthorString +  oWs + infraSpeciesMarker + oWs + "\\1";  //2-nd word and last word are the same
283 283
    //autonym pattern used within anyBotanicalFullName pattern
284
    protected static String autonym2 = capitalEpiWord + oWs + "(" + nonCapitalEpiWord +")" + oWs + fullBotanicAuthorString +  oWs + infraSpeciesMarker + oWs + "\\2";  //2-nd word and last word are the same
284
    protected static String autonym2 = capitalEpiWord + oWs + "\u00D7?(" + nonCapitalEpiWord +")" + oWs + fullBotanicAuthorString +  oWs + infraSpeciesMarker + oWs + "\\2";  //2-nd word and last word are the same
285 285

  
286 286

  
287 287
    protected static String anyBotanicName = "(" + genusOrSupraGenus + "|" + infraGenus + "|" + aggrOrGroup + "|" + species + "|" +
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
558 558
        assertFalse("Name must not be protected", name1.isProtectedTitleCache());
559 559
        assertEquals(nameStr, name1.getNameCache());  //we expect the cache strategy to create the same result
560 560

  
561
        //autonym #6656
561
        //hybrid autonym #6656
562 562
        nameStr = "Ophrys \u00D7kastelli E. Klein nothosubsp. kastelli";
563 563
        name1 = parser.parseFullName(nameStr);
564 564
        assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid());
......
567 567
        assertFalse("Name must not be protected", name1.isProtectedTitleCache());
568 568
        assertEquals(nameStr, name1.getTitleCache()); //we expect the cache strategy to create the same result
569 569

  
570
        name1 = parser.parseReferencedName(nameStr);
571
        assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid());
572
        assertTrue("Name must have binom hybrid bit set", name1.isBinomHybrid());
573
        assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid());
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

  
570 577
    }
571 578

  
572 579
    /**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)