本文整理汇总了Java中org.gbif.api.model.checklistbank.ParsedName.setSpecificEpithet方法的典型用法代码示例。如果您正苦于以下问题:Java ParsedName.setSpecificEpithet方法的具体用法?Java ParsedName.setSpecificEpithet怎么用?Java ParsedName.setSpecificEpithet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gbif.api.model.checklistbank.ParsedName
的用法示例。
在下文中一共展示了ParsedName.setSpecificEpithet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCompareUnparsedAuthor
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
@Test
public void testCompareUnparsedAuthor() throws Exception {
ParsedName p1 = new ParsedName();
p1.setScientificName("Platanus x hispanica Mill. ex Münch., 1770");
p1.setGenusOrAbove("Platanus");
p1.setSpecificEpithet("hispanica");
p1.setNotho(NamePart.SPECIFIC);
p1.setParsed(false);
ParsedName p2 = new ParsedName();
p2.setScientificName("Platanus hispanica Mill. ex Münch.");
p2.setGenusOrAbove("Platanus");
p2.setSpecificEpithet("hispanica");
p2.setNotho(NamePart.SPECIFIC);
p2.setAuthorship("Mill. ex Münch.");
p2.setParsed(true);
assertEquals(Equality.EQUAL, comp.compare(p1, p2));
}
示例2: buildScientificName
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
/**
* Assembles the most complete scientific name based on full and individual name parts.
* @param scientificName the full scientific name
* @param genericName see GbifTerm.genericName
* @param genus see DwcTerm.genus
* @param specificEpithet see DwcTerm.specificEpithet
* @param infraspecificEpithet see DwcTerm.infraspecificEpithet
*/
public static String buildScientificName(String scientificName, String authorship, String genericName, String genus,
String specificEpithet, String infraspecificEpithet) {
String sciname = ClassificationUtils.clean(scientificName);
if (sciname == null) {
// handle case when the scientific name is null and only given as atomized fields: genus & speciesEpitheton
ParsedName pn = new ParsedName();
if (!StringUtils.isBlank(genericName)) {
pn.setGenusOrAbove(genericName);
} else {
pn.setGenusOrAbove(genus);
}
pn.setSpecificEpithet(specificEpithet);
pn.setInfraSpecificEpithet(infraspecificEpithet);
pn.setAuthorship(authorship);
sciname = pn.canonicalNameComplete();
} else if (!Strings.isNullOrEmpty(authorship) && !sciname.toLowerCase().contains(authorship.toLowerCase())) {
sciname = sciname + " " + authorship;
}
return sciname;
}
示例3: testInterpretGenus
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
@Test
public void testInterpretGenus() throws Exception {
ParsedName pn = new ParsedName();
pn.setGenusOrAbove("P.");
pn.setSpecificEpithet("concolor");
NubMatchingServiceImpl.interpretGenus(pn, "Puma");
assertEquals("Puma concolor", pn.canonicalName());
pn.setGenusOrAbove("P.");
NubMatchingServiceImpl.interpretGenus(pn, "Felis");
assertEquals("P. concolor", pn.canonicalName());
}
示例4: roundtrip
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
@Test
public void roundtrip() throws Exception {
ParsedName pn = new ParsedName();
pn.setType(NameType.SCIENTIFIC);
pn.setParsedPartially(true);
pn.setGenusOrAbove("Abies");
pn.setSpecificEpithet("alba");
pn.setInfraSpecificEpithet("alpina");
pn.setRank(Rank.INFRASUBSPECIFIC_NAME);
pn.setBracketYear("123");
pn.setYear("1987");
pn.setAuthorship("Markus");
pn.setBracketAuthorship("Peter");
pn.setNotho(NamePart.SPECIFIC);
pn.setRemarks("no remarks");
pn.setNomStatus("nom.illeg.");
pn.setInfraGeneric("Pineta");
pn.setCultivarEpithet("Green Hell");
pn.setSensu("Berendsohn 1999");
pn.setStrain("train");
pn.setScientificName(pn.fullName());
mapper.create(pn);
ParsedName pn2 = mapper.getByName(pn.getScientificName(), pn.getRank());
assertEquals(pn, pn2);
}
示例5: scientificName
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
@Test
public void scientificName() throws Exception {
final String UNPARSED_NAME = "A real unparsed name X73a";
ParsedName n = new ParsedName();
n.setType(NameType.SCIENTIFIC);
n.setScientificName(UNPARSED_NAME);
n.setGenusOrAbove("Abies");
n.setAuthorship("L.");
n.setYear("1888");
n.setBracketAuthorship("Carl.");
n.setRank(Rank.GENUS);
assertAllButVirus("Abies (Carl.) L., 1888", n);
n.setRank(Rank.SPECIES);
assertAllButVirus("Abies spec.", n);
n.setSpecificEpithet("alba");
assertAllButVirus("Abies alba (Carl.) L., 1888", n);
n.setRank(Rank.SUBSPECIES);
assertAllButVirus("Abies alba subsp.", n);
n.setInfraSpecificEpithet("alpina");
final String expectedWithRank = "Abies alba subsp. alpina (Carl.) L., 1888";
assertAllAndZoo("Abies alba alpina (Carl.) L., 1888", expectedWithRank, n);
assertEquals("Abies alba alpina (Carl.) L., 1888", NameFormatter.scientificName(n, Kingdom.ANIMALIA));
assertEquals(expectedWithRank, NameFormatter.scientificName(n, Kingdom.PLANTAE));
n.setType(NameType.HYBRID);
assertEquals(expectedWithRank, NameFormatter.scientificName(n, NomenclaturalCode.BOTANICAL));
n.setType(NameType.VIRUS);
assertEquals(expectedWithRank, NameFormatter.scientificName(n, NomenclaturalCode.BOTANICAL));
n.setParsed(false);
assertEquals(UNPARSED_NAME, NameFormatter.scientificName(n, NomenclaturalCode.BOTANICAL));
n.setParsed(true);
n.setRank(Rank.INFRASPECIFIC_NAME);
assertAllButVirus("Abies alba alpina (Carl.) L., 1888", n);
assertEquals(UNPARSED_NAME, NameFormatter.scientificName(n, Kingdom.VIRUSES));
}
示例6: testCreateOrGet
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
@Test
public void testCreateOrGet() throws Exception {
ParsedName pn = new ParsedName();
pn.setScientificName("Abies alba Mill.");
pn.setGenusOrAbove("Abies");
pn.setAuthorship("Mill.");
pn.setSpecificEpithet("alba");
pn.setType(NameType.SCIENTIFIC);
assertNull(pn.getKey());
ParsedName pn2 = service.createOrGet(pn, true);
assertNotNull(pn2.getKey());
assertEquals("Abies alba Mill.", pn2.getScientificName());
assertEquals("Abies alba", pn2.canonicalName());
assertEquals("Abies", pn2.getGenusOrAbove());
assertEquals("alba", pn2.getSpecificEpithet());
assertEquals("Mill.", pn2.getAuthorship());
pn = service.createOrGet(parse("Abies alba Mill."), true);
assertEquals("Abies alba Mill.", pn.getScientificName());
assertEquals("Abies alba", pn.canonicalName());
assertEquals("Abies", pn.getGenusOrAbove());
assertEquals("alba", pn.getSpecificEpithet());
assertEquals("Mill.", pn.getAuthorship());
pn = service.createOrGet(parse("Abies sp."), true);
assertEquals("Abies sp.", pn.getScientificName());
assertEquals("Abies spec.", pn.canonicalName());
assertEquals("Abies", pn.getGenusOrAbove());
assertEquals(Rank.SPECIES, pn.getRank());
assertNull(pn.getSpecificEpithet());
pn = service.createOrGet(parse("×Abies Mill."), true);
assertEquals("×Abies Mill.", pn.getScientificName());
assertEquals("Abies", pn.canonicalName());
assertEquals("Abies", pn.getGenusOrAbove());
assertNull(pn.getRank());
assertNull(pn.getSpecificEpithet());
assertEquals(NamePart.GENERIC, pn.getNotho());
pn = service.createOrGet(parse("? hostilis Gravenhorst, 1829"), true);
assertEquals("? hostilis Gravenhorst, 1829", pn.getScientificName());
assertEquals("? hostilis", pn.canonicalName());
assertEquals("?", pn.getGenusOrAbove());
assertEquals(Rank.SPECIES, pn.getRank());
assertEquals("hostilis", pn.getSpecificEpithet());
}
示例7: testRegularImport
import org.gbif.api.model.checklistbank.ParsedName; //导入方法依赖的package包/类
/**
* pro parte usages are synced differently and not tested here
*/
@Test
public void testRegularImport() throws ExecutionException, InterruptedException {
ParsedName pn = new ParsedName();
pn.setGenusOrAbove("Abies");
pn.setSpecificEpithet("alba");
pn.setAuthorship("Mill.");
pn.setScientificName(pn.fullName());
pn.setType(NameType.SCIENTIFIC);
NameUsage u = new NameUsage();
u.setKey(USAGE_ID);
u.setScientificName(pn.getScientificName());
u.setCanonicalName(pn.canonicalName());
u.setNameType(pn.getType());
u.setAuthorship(pn.getAuthorship());
u.setRank(Rank.SPECIES);
u.setDatasetKey(Constants.NUB_DATASET_KEY);
u.setOrigin(Origin.SOURCE);
u.getIssues().add(NameUsageIssue.CONFLICTING_BASIONYM_COMBINATION);
u.getIssues().add(NameUsageIssue.ACCEPTED_NAME_MISSING);
UsageExtensions ext = new UsageExtensions();
VerbatimNameUsage v = new VerbatimNameUsage();
NameUsageMetrics m = new NameUsageMetrics();
DummyData data = new DummyData(u, pn, ext, v, m);
Future<?> f = service.sync(u.getDatasetKey(), data, Lists.newArrayList(1));
f.get();
NameUsageService usageService = getInstance(NameUsageService.class);
NameUsage u2 = usageService.get(USAGE_ID, null);
u2.setLastInterpreted(null);
// name key is newly assigned
u.setNameKey(u2.getNameKey());
u.setNameKey(u2.getNameKey());
assertNotNull(u.getNameKey());
assertFalse(u2.getIssues().isEmpty());
assertEquals(u, u2);
}