Project

General

Profile

Revision ecb38d0c

IDecb38d0cd3d2e98cd8e38e5334bd34e8004a1fa1
Parent 69c95165
Child 78ae2e04

Added by Andreas Müller over 2 years ago

ref #6965 remove space between initials and name in nomencl. person title

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 = true;
68 69

  
69 70
	public static NonViralNameParserImpl NewInstance(){
70 71
		return new NonViralNameParserImpl();
......
1361 1362

  
1362 1363

  
1363 1364
	/**
1364
	 * Parses an authorTeam String and returns the team.
1365
	 * !!! TODO (atomization not yet implemented)
1365
	 * Parses an author (person or team) string and returns the Person or Team.
1366 1366
	 * @param authorString String representing the author
1367
	 * @return an Team
1367
	 * @return a person or team
1368 1368
	 */
1369 1369
	public TeamOrPersonBase<?> author (String authorString){
1370 1370
		if (authorString == null){
......
1374 1374
		}else if (! finalTeamSplitterPattern.matcher(authorString).find() && ! authorIsAlwaysTeam){
1375 1375
			//1 Person
1376 1376
			Person result = Person.NewInstance();
1377
			authorString = normalizeNomenclaturalPersonString(authorString);
1377 1378
			result.setNomenclaturalTitle(authorString);
1378 1379
			return result;
1379 1380
		}else{
......
1383 1384
	}
1384 1385

  
1385 1386
	/**
1386
	 * Parses an authorString (reprsenting a team into the single authors and add
1387
	 * Parses an authorString (representing a team into the single authors and add
1387 1388
	 * them to the return Team.
1388 1389
	 * @param authorString
1389 1390
	 * @return Team
......
1397 1398
			    result.setHasMoreMembers(true);
1398 1399
			}else{
1399 1400
			    Person person = Person.NewInstance();
1400
			    person.setNomenclaturalTitle(author);
1401
			    author = normalizeNomenclaturalPersonString(author);
1402
	            person.setNomenclaturalTitle(author);
1401 1403
			    result.addTeamMember(person);
1402 1404
			}
1403 1405
		}
......
1405 1407
	}
1406 1408

  
1407 1409

  
1408
//	// Parsing of the given full name that has been identified as a cultivar already somwhere else.
1410
/**
1411
     * @param author
1412
     * @return
1413
     */
1414
    private String normalizeNomenclaturalPersonString(String author) {
1415
        if (removeSpaceAfterDot){
1416
            author = author.replaceAll("\\.\\s", ".");
1417
        }
1418
        return author;
1419
    }
1420

  
1421
    //	// Parsing of the given full name that has been identified as a cultivar already somwhere else.
1409 1422
//	// The ... cv. ... syntax is not covered here as it is not according the rules for naming cultivars.
1410 1423
	public IBotanicalName parseCultivar(String fullName) throws StringNotParsableException{
1411 1424
		ICultivarPlantName result = null;
......
1511 1524
		//nom status handled in nom status parser, otherwise we loose additional information like reference etc.
1512 1525
		//hybrid relationships handled in hybrid formula and at end of fullNameParser
1513 1526
	}
1527

  
1528
    /**
1529
     * @return the removeSpaceAfterDot
1530
     */
1531
    public boolean isRemoveSpaceAfterDot() {
1532
        return removeSpaceAfterDot;
1533
    }
1514 1534
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)