Skip to content

Commit

Permalink
Fixed qanaryMesssage null when first approach fails
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Jun 25, 2024
1 parent 070c645 commit a22412f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion qanary-component-QB-BirthDataWikidata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-QB-BirthDataWikidata</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
<parent>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.qanarycomponent-parent</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,21 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
this.myQuestion = myQanaryQuestion.getTextualRepresentation(); // get the question as String

// STEP 1-3 have two options

QanaryMessage qanaryMessageNew = myQanaryMessage;
// first, try to use a named entity annotation because it is more precise if it
// works, then stop
myQanaryMessage = this.processForExistingNamedEntity(myQanaryMessage);
if (myQanaryMessage != null) {
qanaryMessageNew = this.processForExistingNamedEntity(myQanaryMessage);
if (qanaryMessageNew != null) {
logger.info("Found a named entity annotation. Processing finished.");
return myQanaryMessage;
return qanaryMessageNew;
}

// second, let's try to find a firstname and lastname, if that works we stop
myQanaryMessage = this.processForFirstNameAndLastName(myQanaryMessage);
if( myQanaryMessage != null ) {
logger.info("Found firstname and lastname. Processing finished.");
return myQanaryMessage;
}
// second, let's try to find a firstname and lastname, if that works we stop
qanaryMessageNew = this.processForFirstNameAndLastName(myQanaryMessage);
if( qanaryMessageNew != null ) {
logger.info("Found firstname and lastname. Processing finished.");
return qanaryMessageNew;
}

logger.warn("Nothing could be done here.");
return myQanaryMessage;
Expand Down

0 comments on commit a22412f

Please sign in to comment.