Skip to content

Commit

Permalink
Resolves #178.
Browse files Browse the repository at this point in the history
  • Loading branch information
khituras committed Jan 4, 2024
1 parent c302155 commit 7d232c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jcore-gnormplus-ae/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<version>2.6.1</version>
</parent>

<version>2.6.6</version>
<version>2.6.7-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public AbstractCas next() throws AnalysisEngineProcessException {
// Process the incoming documents batch-wise (this is why we use a multiplier here so we have access
// to whole batches). This checks if we still have processed documents or if we need to process the next
// batch.
if (bioCCasPopulator == null || bioCCasPopulator.documentsLeftInCollection() == 0) {
if (currentCollectionIndex == cachedCasData.size()) {
currentCollectionIndex = 0;
currentBiocResultCollectionIndex = 0;
final BioCCollection gnormPlusInputCollection = GNormPlusProcessing.createEmptyJulieLabBioCCollection();
Expand All @@ -83,7 +83,7 @@ public AbstractCas next() throws AnalysisEngineProcessException {
cachedCasData.clear();
while (baseMultiplierHasNext.get()) {
final JCas jCas = baseMultiplierNext.get();
boolean isDocumentHashUnchanged = false;
boolean isDocumentHashUnchanged = false;
try {
isDocumentHashUnchanged = JCasUtil.selectSingle(jCas, DBProcessingMetaData.class).getIsDocumentHashUnchanged();
} catch (IllegalArgumentException e) {
Expand Down Expand Up @@ -120,7 +120,7 @@ public AbstractCas next() throws AnalysisEngineProcessException {
} catch (XMLStreamException | IOException e) {
log.error("Could not read GNormPlus output from {}", outputFilePath);
throw new AnalysisEngineProcessException(e);
} catch (ClassNotFoundException| NoSuchMethodException e) {
} catch (ClassNotFoundException | NoSuchMethodException e) {
log.error("Could not obtain UIMA gene annotation type constructor for class {}", outputGeneTypeName);
throw new AnalysisEngineProcessException(e);
}
Expand Down Expand Up @@ -151,6 +151,9 @@ public AbstractCas next() throws AnalysisEngineProcessException {
cachedCasData.set(currentCollectionIndex, null);
++currentCollectionIndex;

if (log.isTraceEnabled())
log.trace("Created multiplier-CAS for document with ID {}", JCoReTools.getDocId(jCas));

return jCas;
} catch (AnalysisEngineProcessException e) {
log.error("Error while retrieving or processing data for/with GNormPlus", e);
Expand All @@ -160,7 +163,7 @@ public AbstractCas next() throws AnalysisEngineProcessException {

public boolean hasNext() {
try {
return bioCCasPopulator != null && bioCCasPopulator.documentsLeftInCollection() > 0 || baseMultiplierHasNext.get();
return currentCollectionIndex < cachedCasData.size() || baseMultiplierHasNext.get();
} catch (Throwable t) {
log.error("Could not determine hasNext()", t);
throw t;
Expand Down

0 comments on commit 7d232c2

Please sign in to comment.