jzonthemtn commented on code in PR #456:
URL: https://github.com/apache/opennlp/pull/456#discussion_r1046184927
##########
opennlp-tools/src/main/java/opennlp/tools/namefind/TokenNameFinderFactory.java:
##########
@@ -133,18 +173,36 @@ public void validateArtifactMap() throws
InvalidFormatException {
// no additional artifacts
}
+ /**
+ * @return Retrieves a {@link SequenceCodec} instance.
+ */
public SequenceCodec<String> createSequenceCodec() {
if (artifactProvider != null) {
- String sequeceCodecImplName = artifactProvider.getManifestProperty(
+ String sequenceCodecImplName = artifactProvider.getManifestProperty(
TokenNameFinderModel.SEQUENCE_CODEC_CLASS_NAME_PARAMETER);
- return instantiateSequenceCodec(sequeceCodecImplName);
+ try {
+ return instantiateSequenceCodec(sequenceCodecImplName);
+ } catch (InvalidFormatException e) {
+ // TODO Is this compensation valid here? Or: should we escalate
towards the caller?
+ System.out.println("Encountered a problem with the sequence codec '"
Review Comment:
Regarding the logging, the project has always tried to maintain a principle
of using the fewest dependencies as possible. The log4j vulnerability a few
months ago is a good example why. That can certainly be brought up again for
discussion on the mailing list, but a better logging solution that doesn't
require a new dependency would be ideal (if it even exists).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]