From 6581322e9a2e697889105c9aefc9cf514ecc5524 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 08:24:25 +0200 Subject: [PATCH 1/8] [Upd] Update to the latest Spring Boot, new versions of Spark. --- build.gradle | 44 +++++++++---------- core/build.gradle | 21 +++++---- .../textanalysis/config/LemmatizerConfig.java | 21 +++++---- .../rest/handler/RestExceptionHandler.java | 2 +- .../service/RemoteOntologyService.java | 41 ++++++++--------- gradle/wrapper/gradle-wrapper.properties | 2 +- header.txt | 32 +++++++------- .../annotace/keywordextractor/KerService.java | 29 ++++++------ .../lemmatizer/MorphoDitaServiceOnline.java | 16 +++---- lemmatizer-spark/build.gradle | 16 ++++--- .../annotace/lemmatizer/SparkLemmatizer.java | 9 +++- .../lemmatizer/SparkLemmatizerTest.java | 2 +- settings.gradle | 18 +++++--- 13 files changed, 136 insertions(+), 117 deletions(-) diff --git a/build.gradle b/build.gradle index 5179c1f..298b50c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,45 +1,40 @@ plugins { - id "org.springframework.boot" version "2.7.10" apply false - id "io.spring.dependency-management" version "1.0.11.RELEASE" apply false - id "com.github.hierynomus.license" version "0.16.1" + id "org.springframework.boot" version "4.1.0" apply false + id "io.spring.dependency-management" version "1.1.7" apply false + id "com.diffplug.spotless" version "7.0.4" apply false } -group "cz.cvut.kbss" -description "Text analysis for Czech language and annotation recommendation service" -version "0.0.1" +group = "cz.cvut.kbss" +description = "Text analysis for Czech language and annotation recommendation service" +version = "0.0.1" def revision = "git rev-list --count HEAD".execute().text.trim() def hash = "git rev-parse --short HEAD".execute().text.trim() version = "0.0.1.r${revision}.${hash}" -ext { - junitVersion = "5.9.2" -} - subprojects { apply plugin: "java" apply plugin: "java-library" - apply plugin: "com.github.hierynomus.license" + apply plugin: "com.diffplug.spotless" compileJava { - sourceCompatibility = "11" - targetCompatibility = "11" + sourceCompatibility = "21" + targetCompatibility = "21" } test { useJUnitPlatform() } - license { - header = rootProject.file("header.txt") - excludes(["**/*.txt", "**/*.yml", "**/*.html", "**/*.xml", "**/*.ttl"]) - mapping { - java = "SLASHSTAR_STYLE" + spotless { + java { + target "src/**/*.java" + licenseHeaderFile rootProject.file("header.txt"), "package " } } - group parent.group - version parent.version + group = parent.group + version = parent.version repositories { mavenCentral() @@ -50,13 +45,14 @@ subprojects { } dependencies { - implementation "org.slf4j:slf4j-api:1.7.36" - implementation "ch.qos.logback:logback-classic:1.2.11" - compileOnly "org.projectlombok:lombok:1.18.20" + implementation "org.slf4j:slf4j-api:2.0.17" + implementation "ch.qos.logback:logback-classic:1.5.34" + compileOnly "org.projectlombok:lombok:1.18.32" - annotationProcessor "org.projectlombok:lombok:1.18.20" + annotationProcessor "org.projectlombok:lombok:1.18.32" testImplementation(libs.junit.api) testRuntimeOnly(libs.junit.engine) + testRuntimeOnly(libs.junit.platform.launcher) } } diff --git a/core/build.gradle b/core/build.gradle index a1665d9..495411c 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,11 +1,13 @@ apply plugin: "org.springframework.boot" apply plugin: "io.spring.dependency-management" -description "Text analysis for Czech language and annotation recommendation service" +description = "Text analysis for Czech language and annotation recommendation service" + +def applicationVersion = project.version processResources { filesMatching("application.yml") { - expand(["version": project.version]) + expand(["version": applicationVersion]) } } @@ -16,23 +18,26 @@ dependencies { implementation project(":lemmatizer-morphodita") implementation(libs.spring.boot.web) - implementation("org.jsoup:jsoup:1.15.4") + implementation("org.jsoup:jsoup:1.18.1") implementation(libs.jackson.annotations) - implementation("org.apache.jena:apache-jena-libs:3.17.0") + implementation("org.apache.jena:jena-arq:6.0.0") - testImplementation("org.apache.commons:commons-lang3:3.12.0") - testImplementation("org.mockito:mockito-junit-jupiter:4.0.0") + testImplementation("org.apache.commons:commons-lang3:3.20.0") testImplementation("org.springframework.boot:spring-boot-starter-test") } +test { + jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED" +} + allprojects { configurations.configureEach { resolutionStrategy { dependencySubstitution { - substitute module("org.codehaus.janino:janino") using module("org.codehaus.janino:janino:3.0.16") - substitute module("org.codehaus.janino:commons-compiler") using module("org.codehaus.janino:commons-compiler:3.0.16") + substitute module("org.codehaus.janino:janino") using module("org.codehaus.janino:janino:3.1.9") + substitute module("org.codehaus.janino:commons-compiler") using module("org.codehaus.janino:commons-compiler:3.1.9") } } } diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java b/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java index 9660ea7..e38f75f 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java @@ -25,10 +25,10 @@ import cz.cvut.kbss.textanalysis.lemmatizer.LemmatizerApi; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestClient; @Configuration @Slf4j @@ -39,17 +39,20 @@ public class LemmatizerConfig { @Bean public LemmatizerApi lemmatizer(ApplicationContext context) { - switch (lemmatizer) { - case "morphodita-jni": + return switch (lemmatizer) { + case "morphodita-jni" -> { log.info("Instantiating MorphoDiTa JNI lemmatizer."); - return new MorphoDitaServiceJNI(context.getBean(MorphoditaConf.class)); - case "morphodita-online": + yield new MorphoDitaServiceJNI(context.getBean(MorphoditaConf.class)); + } + case "morphodita-online" -> { log.info("Instantiating MorhoDiTa online lemmatizer."); - return new MorphoDitaServiceOnline(context.getBean(RestTemplateBuilder.class), context.getBean( + yield new MorphoDitaServiceOnline(RestClient.builder(), context.getBean( MorphoditaConf.class)); - default: + } + default -> { log.info("Instantiating Apache Spark lemmatizer."); - return new SparkLemmatizer(context.getBean(SparkConf.class)); - } + yield new SparkLemmatizer(context.getBean(SparkConf.class)); + } + }; } } diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java index 1cb6149..7a059aa 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * Exception handlers for REST controllers. diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java index 0594ea6..5fa10b1 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java @@ -19,16 +19,6 @@ import cz.cvut.kbss.textanalysis.lemmatizer.LemmatizerApi; import lombok.extern.slf4j.Slf4j; -import org.apache.http.HttpEntity; -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.util.EntityUtils; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.util.FileUtils; @@ -37,7 +27,12 @@ import java.io.IOException; import java.io.StringReader; +import java.net.Authenticator; +import java.net.PasswordAuthentication; import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; @Service @@ -50,23 +45,25 @@ public RemoteOntologyService(final LemmatizerApi lemmatizer) { } public Model readOntology(final URI uri, final String userName, final String password) { - final HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + final HttpClient.Builder httpClientBuilder = HttpClient.newBuilder(); if (userName != null) { - final CredentialsProvider provider = new BasicCredentialsProvider(); - provider.setCredentials( - AuthScope.ANY, - new UsernamePasswordCredentials(userName, password) - ); - httpClientBuilder.setDefaultCredentialsProvider(provider); + httpClientBuilder.authenticator(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(userName, password.toCharArray()); + } + }); } final Model model = ModelFactory.createDefaultModel(); - try (final CloseableHttpClient client = httpClientBuilder.build()) { - final CloseableHttpResponse response = client.execute(new HttpGet(uri)); - final HttpEntity entity = response.getEntity(); - final String entityString = EntityUtils.toString(entity); - model.read(new StringReader(entityString), null, FileUtils.langTurtle); + try (final HttpClient client = httpClientBuilder.build()) { + final HttpRequest request = HttpRequest.newBuilder(uri).GET().build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + model.read(new StringReader(response.body()), null, FileUtils.langTurtle); } catch (IOException e) { log.error("Error getting the ontology: ", e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + log.error("Error getting the ontology: ", e); } return model; } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59bc51a..9937dae 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/header.txt b/header.txt index 15ef652..465f415 100644 --- a/header.txt +++ b/header.txt @@ -1,15 +1,17 @@ -Annotace -Copyright (C) 2024 Czech Technical University in Prague - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . +/* + * Annotace + * Copyright (C) $YEAR Czech Technical University in Prague + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ diff --git a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java index 94e52ef..67af93d 100644 --- a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java +++ b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java @@ -20,34 +20,31 @@ import cz.cvut.kbss.annotace.configuration.KerConf; import cz.cvut.kbss.textanalysis.keywordextractor.KeywordExtractorAPI; import cz.cvut.kbss.textanalysis.keywordextractor.model.KeywordExtractorResult; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Paths; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; -import org.springframework.http.*; +import org.springframework.http.MediaType; import org.springframework.stereotype.Service; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; +import org.springframework.web.client.RestClient; import java.io.File; import java.nio.file.Files; +import java.nio.file.Paths; @Service @Slf4j public class KerService implements KeywordExtractorAPI { - private final RestTemplate restTemplate; + private final RestClient restClient; private final KerConf config; @Autowired - public KerService(RestTemplateBuilder restClientBuilder, KerConf config) { - this.restTemplate = restClientBuilder.build(); + public KerService(KerConf config) { + this.restClient = RestClient.builder().build(); this.config = config; } @@ -58,18 +55,18 @@ public KeywordExtractorResult process(final String chunks) { final File file; try { file = File.createTempFile("ker-input",""); - Files.write(Paths.get(file.toURI()), chunks.getBytes(StandardCharsets.UTF_8)); + Files.writeString(Paths.get(file.toURI()), chunks); Resource fileResource = new FileSystemResource(file); - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.MULTIPART_FORM_DATA); - MultiValueMap body = new LinkedMultiValueMap<>(); body.add("file", fileResource); - HttpEntity> requestEntity = new HttpEntity<>(body, headers); - - KeywordExtractorResult response = this.restTemplate.postForObject(kerUrl, requestEntity, KeywordExtractorResult.class); + KeywordExtractorResult response = this.restClient.post() + .uri(kerUrl) + .contentType(MediaType.MULTIPART_FORM_DATA) + .body(body) + .retrieve() + .body(KeywordExtractorResult.class); log.debug("Keywords: " + response.getKeywords()); return response; } catch (Exception e) { diff --git a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java index db11e89..468e58a 100644 --- a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java +++ b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java @@ -20,26 +20,26 @@ import cz.cvut.kbss.annotace.configuration.MorphoditaConf; import cz.cvut.kbss.textanalysis.lemmatizer.LemmatizerApi; import cz.cvut.kbss.textanalysis.lemmatizer.model.LemmatizerResult; -import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.web.client.RestClient; import java.util.List; public class MorphoDitaServiceOnline implements LemmatizerApi { - private final RestTemplateBuilder restTemplateBuilder; + private final RestClient restClient; private final MorphoditaConf conf; - public MorphoDitaServiceOnline(RestTemplateBuilder restTemplateBuilder, MorphoditaConf conf) { - this.restTemplateBuilder = restTemplateBuilder; + public MorphoDitaServiceOnline(RestClient.Builder restClientBuilder, MorphoditaConf conf) { + this.restClient = restClientBuilder.build(); this.conf = conf; } public LemmatizerResult process(String s, String lang) { - final LemmatizerResult morphoDitaResult = restTemplateBuilder.build().getForObject( - conf.getService() + - "/tag?data=" + s + "&output=json", - LemmatizerResult.class); + final LemmatizerResult morphoDitaResult = restClient.get() + .uri(conf.getService() + "/tag?data=" + s + "&output=json") + .retrieve() + .body(LemmatizerResult.class); morphoDitaResult.setLemmatizer(this.getClass().getName()); return morphoDitaResult; diff --git a/lemmatizer-spark/build.gradle b/lemmatizer-spark/build.gradle index 2e3cb07..11cb31a 100644 --- a/lemmatizer-spark/build.gradle +++ b/lemmatizer-spark/build.gradle @@ -6,12 +6,18 @@ dependencies { implementation(libs.spring.boot.web) implementation(libs.jackson.databind) - implementation("com.johnsnowlabs.nlp:spark-nlp_2.12:4.3.2") - implementation("org.apache.spark:spark-mllib_2.12:3.3.2") { + implementation("javax.servlet:javax.servlet-api:4.0.1") + + implementation("com.johnsnowlabs.nlp:spark-nlp_2.12:6.4.1") { + exclude group: "org.projectlombok", module: "lombok" + } + implementation("org.apache.spark:spark-mllib_2.12:3.5.8") { exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl" } - testImplementation(libs.spring.boot.test) { - exclude group: "org.junit.vintage", module: "junit-vintage-engine" - } + testImplementation(libs.spring.boot.test) +} + +test { + jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED" } \ No newline at end of file diff --git a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java index 118f764..80ef5a5 100644 --- a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java +++ b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java @@ -38,6 +38,8 @@ import org.apache.spark.ml.PipelineStage; import org.apache.spark.sql.Encoders; import org.apache.spark.sql.SparkSession; +import scala.Predef; +import scala.collection.JavaConverters; import java.util.ArrayList; import java.util.Arrays; @@ -54,7 +56,10 @@ public class SparkLemmatizer implements LemmatizerApi { private final Map pipelines = new HashMap<>(); public SparkLemmatizer(SparkConf conf) { - spark = SparkNLP.start(false, false, false, "2G", "", "", "", scala.collection.immutable.Map$.MODULE$.empty()); + final Map sparkConf = Map.of("spark.ui.enabled", "false"); + final scala.collection.immutable.Map scalaSparkConf = + JavaConverters.mapAsScalaMapConverter(sparkConf).asScala().toMap(Predef.$conforms()); + spark = SparkNLP.start(false, false, false, "2G", "", "", "", scalaSparkConf); conf.getLemmatizers().forEach((language, sparkObject) -> { try { log.info("Creating pipeline for lang {}", language); @@ -133,7 +138,7 @@ public LemmatizerResult process(final String text, final String lang) { } final JavaAnnotation aLemma = (JavaAnnotation) map.get("lemmas").get(i); - r.setLemma(aLemma.result().replace("\u2018", "").replace("\u2019", "")); + r.setLemma(aLemma.result().replace("‘", "").replace("’", "")); // TODO implement negated properly. r.setNegated(false); diff --git a/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java b/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java index 8f095f2..7f61330 100644 --- a/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java +++ b/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java @@ -59,7 +59,7 @@ void checkEnglish() { private void test(final Iterator correctLemmas, final LemmatizerResult result) { Assertions.assertAll( - result.getResult().get(0).stream().map(r -> () -> + result.getResult().getFirst().stream().map(r -> () -> Assertions.assertEquals(correctLemmas.next(), r.getLemma())) ); } diff --git a/settings.gradle b/settings.gradle index c526f68..3c08fd5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + rootProject.name = 'annotace' include 'core' include 'api' @@ -12,17 +19,18 @@ include 'dist' dependencyResolutionManagement { versionCatalogs { libs { - version("springboot", "2.7.10") - version("jackson", "2.14.2") - version("junit", "5.9.2") + version("springboot", "4.1.0") + version("jackson", "2.22.0") + version("junit", "6.0.3") library("spring.boot.web", "org.springframework.boot", "spring-boot-starter-web").versionRef("springboot") - library("jackson.annotations", "com.fasterxml.jackson.core", "jackson-annotations").versionRef("jackson") + library("jackson.annotations", "com.fasterxml.jackson.core:jackson-annotations:2.22") library("jackson.databind", "com.fasterxml.jackson.core", "jackson-databind").versionRef("jackson") - library("spring.aspects", "org.springframework:spring-aspects:5.3.26") + library("spring.aspects", "org.springframework:spring-aspects:7.0.8") library("spring.boot.test", "org.springframework.boot", "spring-boot-starter-test").versionRef("springboot") library("junit.api", "org.junit.jupiter", "junit-jupiter-api").versionRef("junit") library("junit.engine", "org.junit.jupiter", "junit-jupiter-engine").versionRef("junit") library("junit.params", "org.junit.jupiter", "junit-jupiter-params").versionRef("junit") + library("junit.platform.launcher", "org.junit.platform", "junit-platform-launcher").version("6.0.3") } } } From 1b1c104c826a6db4b1daec6829afe7b8c1d505af Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 11:02:00 +0200 Subject: [PATCH 2/8] [Chore] Update license headers. --- .../cz/cvut/kbss/textanalysis/exception/AnnotaceException.java | 2 +- .../textanalysis/exception/UnsupportedLanguageException.java | 2 +- .../kbss/textanalysis/keywordextractor/KeywordExtractorAPI.java | 2 +- .../keywordextractor/model/KeywordExtractorResult.java | 2 +- .../cz/cvut/kbss/textanalysis/lemmatizer/LemmatizerApi.java | 2 +- .../kbss/textanalysis/lemmatizer/model/LemmatizerResult.java | 2 +- .../kbss/textanalysis/lemmatizer/model/SingleLemmaResult.java | 2 +- core/src/main/java/cz/cvut/kbss/textanalysis/App.java | 2 +- core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java | 2 +- core/src/main/java/cz/cvut/kbss/textanalysis/Stopwords.java | 2 +- .../java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java | 2 +- .../java/cz/cvut/kbss/textanalysis/dto/TextAnalysisInput.java | 2 +- core/src/main/java/cz/cvut/kbss/textanalysis/model/Phrase.java | 2 +- .../main/java/cz/cvut/kbss/textanalysis/model/QueryResult.java | 2 +- core/src/main/java/cz/cvut/kbss/textanalysis/model/Word.java | 2 +- .../java/cz/cvut/kbss/textanalysis/rest/AnnotateController.java | 2 +- .../java/cz/cvut/kbss/textanalysis/rest/handler/ErrorInfo.java | 2 +- .../kbss/textanalysis/rest/handler/RestExceptionHandler.java | 2 +- .../cvut/kbss/textanalysis/service/AbstractOntologyService.java | 2 +- .../cz/cvut/kbss/textanalysis/service/AnnotationException.java | 2 +- .../cz/cvut/kbss/textanalysis/service/AnnotationService.java | 2 +- .../cvut/kbss/textanalysis/service/ChunkAnnotationService.java | 2 +- .../cvut/kbss/textanalysis/service/HtmlAnnotationService.java | 2 +- .../java/cz/cvut/kbss/textanalysis/service/OntologyService.java | 2 +- .../cvut/kbss/textanalysis/service/RemoteOntologyService.java | 2 +- .../cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java | 2 +- .../kbss/service/textanalysis/AnnotationIntegrationTest.java | 2 +- .../cz/cvut/kbss/service/textanalysis/FileOntologyService.java | 2 +- .../kbss/service/textanalysis/ServiceTestConfiguration.java | 2 +- .../cz/cvut/kbss/service/textanalysis/TestChunkFactory.java | 2 +- .../cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java | 2 +- .../kbss/service/textanalysis/html2rdfa/HTMLParserTest.java | 2 +- header.txt | 2 +- .../main/java/cz/cvut/kbss/annotace/configuration/KerConf.java | 2 +- .../java/cz/cvut/kbss/annotace/keywordextractor/KerService.java | 2 +- .../cz/cvut/kbss/annotace/configuration/MorphoditaConf.java | 2 +- .../cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceJNI.java | 2 +- .../cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java | 2 +- .../java/cz/cvut/kbss/annotace/MorphoditaServiceJNITest.java | 2 +- .../java/cz/cvut/kbss/annotace/configuration/SparkConf.java | 2 +- .../java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java | 2 +- .../cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java | 2 +- .../cz/cvut/kbss/annotace/lemmatizer/LemmatizationTests.java | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/exception/AnnotaceException.java b/api/src/main/java/cz/cvut/kbss/textanalysis/exception/AnnotaceException.java index 8a92e52..0a8a4fb 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/exception/AnnotaceException.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/exception/AnnotaceException.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/exception/UnsupportedLanguageException.java b/api/src/main/java/cz/cvut/kbss/textanalysis/exception/UnsupportedLanguageException.java index 14256b4..560bb25 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/exception/UnsupportedLanguageException.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/exception/UnsupportedLanguageException.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/KeywordExtractorAPI.java b/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/KeywordExtractorAPI.java index 50a3468..0d747f1 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/KeywordExtractorAPI.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/KeywordExtractorAPI.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/model/KeywordExtractorResult.java b/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/model/KeywordExtractorResult.java index 9f72614..3782075 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/model/KeywordExtractorResult.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/keywordextractor/model/KeywordExtractorResult.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/LemmatizerApi.java b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/LemmatizerApi.java index b9f8a91..ea5e1e7 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/LemmatizerApi.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/LemmatizerApi.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/LemmatizerResult.java b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/LemmatizerResult.java index 9012832..ffe17c4 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/LemmatizerResult.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/LemmatizerResult.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/SingleLemmaResult.java b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/SingleLemmaResult.java index 8febf5d..a2cc925 100644 --- a/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/SingleLemmaResult.java +++ b/api/src/main/java/cz/cvut/kbss/textanalysis/lemmatizer/model/SingleLemmaResult.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/App.java b/core/src/main/java/cz/cvut/kbss/textanalysis/App.java index ec3ab62..b418ea4 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/App.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/App.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java b/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java index a6f5a82..3878439 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/Stopwords.java b/core/src/main/java/cz/cvut/kbss/textanalysis/Stopwords.java index d3706f3..5ca92ad 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/Stopwords.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/Stopwords.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java b/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java index e38f75f..4abe6c7 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/config/LemmatizerConfig.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/dto/TextAnalysisInput.java b/core/src/main/java/cz/cvut/kbss/textanalysis/dto/TextAnalysisInput.java index daf568e..645dcec 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/dto/TextAnalysisInput.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/dto/TextAnalysisInput.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/model/Phrase.java b/core/src/main/java/cz/cvut/kbss/textanalysis/model/Phrase.java index 2ba6288..0d20bf4 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/model/Phrase.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/model/Phrase.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/model/QueryResult.java b/core/src/main/java/cz/cvut/kbss/textanalysis/model/QueryResult.java index f17635a..dce0bba 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/model/QueryResult.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/model/QueryResult.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/model/Word.java b/core/src/main/java/cz/cvut/kbss/textanalysis/model/Word.java index d677020..b4ae166 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/model/Word.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/model/Word.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/AnnotateController.java b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/AnnotateController.java index 0ecca4c..42b4158 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/AnnotateController.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/AnnotateController.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/ErrorInfo.java b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/ErrorInfo.java index 26f0ac4..eeab26d 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/ErrorInfo.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/ErrorInfo.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java index 7a059aa..ff92f4a 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/rest/handler/RestExceptionHandler.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AbstractOntologyService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AbstractOntologyService.java index 2bace39..78d18ba 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AbstractOntologyService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AbstractOntologyService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationException.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationException.java index b0aec7a..0ed462b 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationException.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationException.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationService.java index 681195f..c78ecf9 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/AnnotationService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/ChunkAnnotationService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/ChunkAnnotationService.java index dcec260..e718204 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/ChunkAnnotationService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/ChunkAnnotationService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/HtmlAnnotationService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/HtmlAnnotationService.java index 09bc3b1..439c310 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/HtmlAnnotationService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/HtmlAnnotationService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/OntologyService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/OntologyService.java index 6d4e886..f2e5513 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/OntologyService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/OntologyService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java index 5fa10b1..6e60fdf 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/RemoteOntologyService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java index 415b2ae..e5e349d 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/AnnotationIntegrationTest.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/AnnotationIntegrationTest.java index 82d28a0..bea09d2 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/AnnotationIntegrationTest.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/AnnotationIntegrationTest.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/FileOntologyService.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/FileOntologyService.java index 549950b..b1d8c29 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/FileOntologyService.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/FileOntologyService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/ServiceTestConfiguration.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/ServiceTestConfiguration.java index 71d0667..4193d16 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/ServiceTestConfiguration.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/ServiceTestConfiguration.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/TestChunkFactory.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/TestChunkFactory.java index 728c102..37cd4ba 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/TestChunkFactory.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/TestChunkFactory.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java index b04d04e..831cd40 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java index ed30c6d..500f85d 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/header.txt b/header.txt index 465f415..3838fbe 100644 --- a/header.txt +++ b/header.txt @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) $YEAR Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/configuration/KerConf.java b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/configuration/KerConf.java index 122d02b..2ca630e 100644 --- a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/configuration/KerConf.java +++ b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/configuration/KerConf.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java index 67af93d..185f4c4 100644 --- a/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java +++ b/keywordextractor-ker/src/main/java/cz/cvut/kbss/annotace/keywordextractor/KerService.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/configuration/MorphoditaConf.java b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/configuration/MorphoditaConf.java index 7e2b5b7..af3bbc4 100644 --- a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/configuration/MorphoditaConf.java +++ b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/configuration/MorphoditaConf.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceJNI.java b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceJNI.java index dd6e57e..2df0997 100644 --- a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceJNI.java +++ b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceJNI.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java index 468e58a..b321a31 100644 --- a/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java +++ b/lemmatizer-morphodita/src/main/java/cz/cvut/kbss/annotace/lemmatizer/MorphoDitaServiceOnline.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-morphodita/src/test/java/cz/cvut/kbss/annotace/MorphoditaServiceJNITest.java b/lemmatizer-morphodita/src/test/java/cz/cvut/kbss/annotace/MorphoditaServiceJNITest.java index 67e5471..b964c0d 100644 --- a/lemmatizer-morphodita/src/test/java/cz/cvut/kbss/annotace/MorphoditaServiceJNITest.java +++ b/lemmatizer-morphodita/src/test/java/cz/cvut/kbss/annotace/MorphoditaServiceJNITest.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/configuration/SparkConf.java b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/configuration/SparkConf.java index 584bca7..ed7c919 100644 --- a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/configuration/SparkConf.java +++ b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/configuration/SparkConf.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java index 80ef5a5..53d7949 100644 --- a/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java +++ b/lemmatizer-spark/src/main/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizer.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java b/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java index 7f61330..8750bd0 100644 --- a/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java +++ b/lemmatizer-spark/src/test/java/cz/cvut/kbss/annotace/lemmatizer/SparkLemmatizerTest.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/lemmatizer-tests/src/test/java/cz/cvut/kbss/annotace/lemmatizer/LemmatizationTests.java b/lemmatizer-tests/src/test/java/cz/cvut/kbss/annotace/lemmatizer/LemmatizationTests.java index 348c205..080a97b 100644 --- a/lemmatizer-tests/src/test/java/cz/cvut/kbss/annotace/lemmatizer/LemmatizationTests.java +++ b/lemmatizer-tests/src/test/java/cz/cvut/kbss/annotace/lemmatizer/LemmatizationTests.java @@ -1,6 +1,6 @@ /* * Annotace - * Copyright (C) 2024 Czech Technical University in Prague + * Copyright (C) 2026 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 754960915d9bafbe933a60d0bf9e2c9609d75df8 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 13:26:10 +0200 Subject: [PATCH 3/8] [Upd] Update docker image builds and GH actions. --- .github/workflows/before-push-to-main.yml | 9 +++++---- .github/workflows/on-push-to-main.yml | 2 +- Dockerfile | 7 ++++--- Dockerfile-morphodita | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/before-push-to-main.yml b/.github/workflows/before-push-to-main.yml index dae9111..1bc8f5c 100644 --- a/.github/workflows/before-push-to-main.yml +++ b/.github/workflows/before-push-to-main.yml @@ -12,12 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@v6 + - name: Set up JDK + uses: actions/setup-java@v5 with: - java-version: '11' + java-version: '25' distribution: 'adopt' + cache: 'gradle' - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml index f71e3c1..ba9bd8a 100644 --- a/.github/workflows/on-push-to-main.yml +++ b/.github/workflows/on-push-to-main.yml @@ -11,7 +11,7 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/Dockerfile b/Dockerfile index 4d06ced..8803c7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ -FROM gradle:8.0.2-jdk11-alpine AS build +FROM gradle:9.5.1-jdk25-alpine AS build RUN mkdir annotace WORKDIR /annotace COPY . . RUN gradle bootJar -x test -FROM eclipse-temurin:11-jdk-alpine AS runtime +FROM eclipse-temurin:25-jdk-alpine AS runtime COPY --from=build /annotace/core/build/libs/*.jar / RUN mv annotace*.jar annotace.jar EXPOSE 8080 -ENTRYPOINT ["java","-jar","/annotace.jar"] \ No newline at end of file +ENV JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED java.base/java.nio=ALL-UNNAMED java.base/java.util=ALL-UNNAMED java.base/java.lang=ALL-UNNAMED java.base/java.lang.invoke=ALL-UNNAMED" +ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/annotace.jar"] \ No newline at end of file diff --git a/Dockerfile-morphodita b/Dockerfile-morphodita index cc33ece..9a69426 100644 --- a/Dockerfile-morphodita +++ b/Dockerfile-morphodita @@ -10,14 +10,14 @@ COPY $MORPHODITA_ZIP /morphodita WORKDIR /morphodita RUN unzip *.zip -FROM gradle:8.0.2-jdk11-alpine AS build +FROM gradle:9.5.1-jdk25-alpine AS build ARG MORPHODITA_ZIP_SO RUN mkdir annotace WORKDIR /annotace COPY . . RUN gradle clean bootJar -x test -FROM eclipse-temurin:11-jdk-alpine AS runtime +FROM eclipse-temurin:25-jdk-alpine AS runtime ARG MORPHODITA_ZIP_SO # Work around an issue with missing library on Alpine Linux - https://www.svlada.com/fun-times-with-gcc-musl-alpine-linux/ RUN apk add --update --no-cache libc6-compat @@ -26,4 +26,4 @@ RUN mv *.jar annotace.jar COPY --from=unzip /morphodita/$MORPHODITA_ZIP_SO /lib EXPOSE 8080 -ENTRYPOINT ["java","-jar","/annotace.jar"] \ No newline at end of file +ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/annotace.jar"] \ No newline at end of file From e267232f434390fa48d0f1a73f1d3bfa0a66aa2a Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 13:42:36 +0200 Subject: [PATCH 4/8] Use non-root user to run the application in container. --- Dockerfile | 16 +++++++++++++--- Dockerfile-morphodita | 15 ++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8803c7b..40394c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,19 @@ COPY . . RUN gradle bootJar -x test FROM eclipse-temurin:25-jdk-alpine AS runtime -COPY --from=build /annotace/core/build/libs/*.jar / -RUN mv annotace*.jar annotace.jar +# Run as a non-root user. Spark NLP downloads pretrained models on startup into +# its cache folder (defaults to ~/cache_pretrained), and Spark writes runtime +# artifacts (metastore_db, spark-warehouse) into the working directory, so the +# user needs a writable home and working directory. +RUN addgroup -S annotace \ + && adduser -S -G annotace -h /home/annotace annotace \ + && mkdir -p /app \ + && chown -R annotace:annotace /app /home/annotace +WORKDIR /app +COPY --from=build --chown=annotace:annotace /annotace/core/build/libs/annotace-*.jar /app/annotace.jar EXPOSE 8080 +ENV HOME=/home/annotace ENV JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED java.base/java.nio=ALL-UNNAMED java.base/java.util=ALL-UNNAMED java.base/java.lang=ALL-UNNAMED java.base/java.lang.invoke=ALL-UNNAMED" -ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/annotace.jar"] \ No newline at end of file +USER annotace +ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/app/annotace.jar"] \ No newline at end of file diff --git a/Dockerfile-morphodita b/Dockerfile-morphodita index 9a69426..cc4d667 100644 --- a/Dockerfile-morphodita +++ b/Dockerfile-morphodita @@ -20,10 +20,15 @@ RUN gradle clean bootJar -x test FROM eclipse-temurin:25-jdk-alpine AS runtime ARG MORPHODITA_ZIP_SO # Work around an issue with missing library on Alpine Linux - https://www.svlada.com/fun-times-with-gcc-musl-alpine-linux/ -RUN apk add --update --no-cache libc6-compat -COPY --from=build /annotace/core/build/libs/annotace-*.jar / -RUN mv *.jar annotace.jar -COPY --from=unzip /morphodita/$MORPHODITA_ZIP_SO /lib +RUN apk add --update --no-cache libc6-compat \ + && addgroup -S annotace \ + && adduser -S -G annotace annotace +WORKDIR /app +COPY --from=build --chown=annotace:annotace /annotace/core/build/libs/annotace-*.jar /app/annotace.jar +COPY --from=unzip /morphodita/$MORPHODITA_ZIP_SO /lib/ +# Ensure the MorphoDita native library is readable/executable by the non-root user +RUN chmod -R a+rX "/lib/$(basename "$MORPHODITA_ZIP_SO")" EXPOSE 8080 -ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/annotace.jar"] \ No newline at end of file +USER annotace +ENTRYPOINT ["java","-XX:+UseCompactObjectHeaders","-jar","/app/annotace.jar"] From 5d845f41f6dd840d792490b993728c438a136d6a Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 14:10:35 +0200 Subject: [PATCH 5/8] [0.1.0] Bump version. --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 298b50c..d4e8f49 100644 --- a/build.gradle +++ b/build.gradle @@ -6,11 +6,11 @@ plugins { group = "cz.cvut.kbss" description = "Text analysis for Czech language and annotation recommendation service" -version = "0.0.1" +version = "0.1.0" def revision = "git rev-list --count HEAD".execute().text.trim() def hash = "git rev-parse --short HEAD".execute().text.trim() -version = "0.0.1.r${revision}.${hash}" +version = "0.1.0.r${revision}.${hash}" subprojects { apply plugin: "java" From 98da5e69c6b14ef1eea0076645a58c8a0cad6db3 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 14:24:12 +0200 Subject: [PATCH 6/8] [Fix] Remove inclusion of empty/non-existent dist directory. --- settings.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index 3c08fd5..3e71847 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,8 +14,6 @@ include 'keywordextractor-ker' include 'lemmatizer-tests' -include 'dist' - dependencyResolutionManagement { versionCatalogs { libs { From df1a5d3c84a08f199dfc5813e6304c240322e6b8 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 14:29:35 +0200 Subject: [PATCH 7/8] [Fix] Switch to JDK21 Temurin for GH build. --- .github/workflows/before-push-to-main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/before-push-to-main.yml b/.github/workflows/before-push-to-main.yml index 1bc8f5c..c82c4a5 100644 --- a/.github/workflows/before-push-to-main.yml +++ b/.github/workflows/before-push-to-main.yml @@ -16,8 +16,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v5 with: - java-version: '25' - distribution: 'adopt' + java-version: '21' + distribution: 'temurin' cache: 'gradle' - name: Grant execute permission for gradlew run: chmod +x gradlew From 1a9d9b1ec851d3204380a44a5ae27f5dc9f78421 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Tue, 16 Jun 2026 14:36:55 +0200 Subject: [PATCH 8/8] [Doc] Update readme - required JDK version. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1987088..2e9cf58 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Annotace is a text analysis service used e.g. by [TermIt](https://github.com/kbs ## How to run it? -- Install Java 11 +- Install Java 21 - Run `./gradlew bootRun` (on Linux/WSL) or `gradlew.bat bootRun` on Windows ## Lemmatizers @@ -39,7 +39,7 @@ A complete command line example would be: 1. Download the MorphoDiTa [ZIP archive](https://github.com/ufal/morphodita/releases/download/v1.9.2/morphodita-1.9.2-bin.zip). 2. Set `MORPHODITA_ZIP` in `docker-compose-morphodita.yml` to path to the downloaded MorphoDiTa ZIP file. -3. Download and extract taggers (language models). Put them into a single directory. +3. Download and extract taggers (language models). Put them into a 11single directory. 4. Set `MORPHODITA_TAGGERS` in `docker-compose-morphodita.yml` to path to the taggers' directory. 5. Run `docker compose -f docker-compose-morphodita.yml up -d --build` to build and start Annotace wih MorphoDiTa.