Project

General

Profile

« Previous | Next » 

Revision c16ec678

Added by Andreas Müller about 9 years ago

Fix unparsed sections and subsections #4764

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
679 679

  
680 680
	private Reference<?> parseBookSection(String reference){
681 681
		Reference<?> result = ReferenceFactory.newBookSection();
682
		
682

  
683 683
		Pattern authorPattern = Pattern.compile("^" + authorTeam + referenceAuthorSeparator);
684 684
		Matcher authorMatcher = authorPattern.matcher(reference);
685 685
		boolean find = authorMatcher.find();
......
687 687
			String authorString = authorMatcher.group(0).trim();
688 688
			String bookString = reference.substring(authorString.length()).trim();
689 689
			authorString = authorString.substring(0, authorString.length() -1);
690
			
690

  
691 691
			TeamOrPersonBase<?> authorTeam = author(authorString);
692 692
			IBook inBook = parseBook(bookString);
693 693
			inBook.setAuthorship(authorTeam);
......
794 794
			 //infra genus
795 795
			 else if (infraGenusPattern.matcher(fullNameString).matches()){
796 796
				Rank infraGenericRank;
797

  
798

  
797 799
				if ("[unranked]".equals(epi[1])){
798 800
					infraGenericRank = Rank.INFRAGENERICTAXON();
799 801
				}else{
800
					infraGenericRank = Rank.getRankByIdInVoc(epi[1]);
802
					infraGenericRank = Rank.getRankByIdInVoc(epi[1], nameToBeFilledOrig.getNomenclaturalCode());
801 803
				}
802 804
				nameToBeFilled.setRank(infraGenericRank);
803 805
				nameToBeFilled.setGenusOrUninomial(epi[0]);
......
941 943
		    if (!nameToBeFilled.isHybridFormula()){
942 944
		        Set<HybridRelationship> hybridChildRelations = new HashSet<HybridRelationship>();
943 945
		        hybridChildRelations.addAll(nameToBeFilled.getHybridChildRelations());
944
		        
946

  
945 947
		        for (HybridRelationship hybridRelationship: hybridChildRelations){
946 948
		        	nameToBeFilled.removeHybridRelationship(hybridRelationship);
947 949
		        }

Also available in: Unified diff