//don't parse if name can't be separated
nameToBeFilled.addParsingProblem(ParserProblem.NameReferenceSeparation);
- nameToBeFilled.setTitleCache(fullReferenceString,true);
- nameToBeFilled.setFullTitleCache(fullReferenceString,true);
+ nameToBeFilled.setTitleCache(fullReferenceString, true);
+ nameToBeFilled.setFullTitleCache(fullReferenceString, true);
// FIXME Quick fix, otherwise search would not deliver results for unparsable names
- nameToBeFilled.setNameCache(fullReferenceString,true);
+ nameToBeFilled.setNameCache(fullReferenceString, true);
// END
nameToBeFilled.setProblemStarts(start);
nameToBeFilled.setProblemEnds(fullReferenceString.length());
//parse title and author
ref = parseReferenceTitle(strReference, yearPart, isInReference);
if (ref.hasProblem()){
+ //we need to protect both caches otherwise the titleCache is incorrectly build from atomized parts
ref.setTitleCache( (isInReference ? "in ":"") + originalStrReference, true);
ref.setAbbrevTitleCache( (isInReference ? "in ":"") + originalStrReference, true);
}
* @param strReference
* @return
*/
- private INomenclaturalReference makeDetailYearUnparsable(NonViralName<?> nameToBeFilled, String strReference) {
- INomenclaturalReference ref;
- //ref = Generic.NewInstance();
+ private Reference makeDetailYearUnparsable(NonViralName<?> nameToBeFilled, String strReference) {
+ Reference ref;
ref = ReferenceFactory.newGeneric();
- ref.setTitleCache(strReference,true);
+ ref.setTitleCache(strReference, true);
+ ref.setAbbrevTitleCache(strReference, true);
ref.setProblemEnds(strReference.length());
ref.addParsingProblem(ParserProblem.CheckDetailOrYear);
nameToBeFilled.addParsingProblem(ParserProblem.CheckDetailOrYear);
}
private void makeUnparsableRefTitle(INomenclaturalReference result, String reference){
- result.setTitleCache(reference,true);
- result.setAbbrevTitleCache(reference,true);
+ //need to set both to protected otherwise titleCache is created from atomized parts
+ result.setTitleCache(reference, true);
+ result.setAbbrevTitleCache(reference, true);
result.addParsingProblem(ParserProblem.UnparsableReferenceTitle);
}
IBook result = ReferenceFactory.newBook();
reference = makeEdition(result, reference);
reference = makeVolume(result, reference);
- result.setTitle(reference);
+ result.setAbbrevTitle(reference);
return result;
}
Reference result = ReferenceFactory.newArticle();
reference = makeVolume(result, reference);
Reference inJournal = ReferenceFactory.newJournal();
- inJournal.setTitle(reference);
+ inJournal.setAbbrevTitle(reference);
result.setInReference(inJournal);
return result;
}
}else{
logger.warn("Unexpected non matching book section author part");
//TODO do we want to record a 'problem' here?
- result.setTitleCache(reference,true);
+ result.setTitleCache(reference, true);
+ result.setAbbrevTitleCache(reference, true);
}
return result;
authorString = fullNameString.substring(epi[0].length()+ 1 + epi[1].length() +1 + epi[2].length() + 1 + epi[3].length());
}else{
nameToBeFilled.addParsingProblem(ParserProblem.OldInfraSpeciesNotSupported);
- nameToBeFilled.setTitleCache(fullNameString,true);
+ nameToBeFilled.setTitleCache(fullNameString, true);
// FIXME Quick fix, otherwise search would not deilver results for unparsable names
nameToBeFilled.setNameCache(fullNameString,true);
// END
//none
else{
nameToBeFilled.addParsingProblem(ParserProblem.UnparsableNamePart);
- nameToBeFilled.setTitleCache(fullNameString,true);
+ nameToBeFilled.setTitleCache(fullNameString, true);
// FIXME Quick fix, otherwise search would not deilver results for unparsable names
nameToBeFilled.setNameCache(fullNameString, true);
// END
return;
} catch (UnknownCdmTypeException e) {
nameToBeFilled.addParsingProblem(ParserProblem.RankNotSupported);
- nameToBeFilled.setTitleCache(fullNameString,true);
+ nameToBeFilled.setTitleCache(fullNameString, true);
// FIXME Quick fix, otherwise search would not deilver results for unparsable names
nameToBeFilled.setNameCache(fullNameString,true);
// END