Skip to content

Commit

Permalink
Merge branch 'main' into feature/5230-Make-LLM-mention-extraction-mor…
Browse files Browse the repository at this point in the history
…e-robust

* main:
  No issue: Allow access to maven central and other repos
  #5270 - Resizing a span also resizes other overlapping or stacked spans
  • Loading branch information
reckart committed Feb 2, 2025
2 parents f549ac7 + dd34577 commit e51a863
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
archive.ics.uci.edu:80
auth.docker.io:443
build.shibboleth.net:443
centralus.data.mcr.microsoft.com:443
download.eclipse.org:443
eastus.data.mcr.microsoft.com:443
github.com:443
Expand All @@ -46,6 +47,7 @@ jobs:
registry-1.docker.io:443
registry.npmjs.org:443
repo.maven.apache.org:443
repo.spring.io:443
repo1.maven.org:443
westus.data.mcr.microsoft.com:443
westus2.data.mcr.microsoft.com:443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.uima.jcas.tcas.Annotation;
import org.springframework.context.event.EventListener;

import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import de.tudarmstadt.ukp.inception.schema.api.AnnotationSchemaService;

public class TokenAttachedSpanChangeListener
Expand All @@ -39,9 +40,11 @@ public TokenAttachedSpanChangeListener(AnnotationSchemaService aSchemaService)
@EventListener
public void onSpanMovedEvent(SpanMovedEvent aEvent)
{
adjustAttachedAnnotations(aEvent);
adjustSingleTokenAnchoredAnnotations(aEvent);
adjustTokenAnchoredAnnotations(aEvent);
if (aEvent.getAnnotation() instanceof Token) {
adjustAttachedAnnotations(aEvent);
adjustSingleTokenAnchoredAnnotations(aEvent);
adjustTokenAnchoredAnnotations(aEvent);
}
}

void adjustTokenAnchoredAnnotations(SpanMovedEvent aEvent)
Expand Down
4 changes: 4 additions & 0 deletions inception/inception-imls-ollama/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
<artifactId>jdk-serializable-functional</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.io.File;
import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
Expand All @@ -40,22 +39,19 @@ public class ProjectImportExportUtils
* if an I/O error occurs.
*
*/
@SuppressWarnings({ "rawtypes" })
public static boolean isValidProjectArchive(File aZipFile) throws IOException
{

boolean isZipValidWebanno = false;
try (ZipFile zip = new ZipFile(aZipFile)) {
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
ZipEntry entry = (ZipEntry) zipEnumerate.nextElement();
if (entry.toString().replace("/", "").startsWith(EXPORTED_PROJECT)
&& entry.toString().replace("/", "").endsWith(".json")) {
isZipValidWebanno = true;
break;
try (var zip = new ZipFile(aZipFile)) {
for (var zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
var entry = (ZipEntry) zipEnumerate.nextElement();
var name = entry.getName().replace("/", "");
if (name.startsWith(EXPORTED_PROJECT) && name.endsWith(".json")) {
return true;
}
}
}
return isZipValidWebanno;

return false;
}

}

0 comments on commit e51a863

Please sign in to comment.