Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
pull_request:
branches: [ "main", "release/**" ]

permissions:
contents: read

jobs:
build:
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ private void extract(File aArchive, ArchiveInputStream aArchiveStream, File aTar
throw new IllegalStateException("Filename must not contain line break");
}

Path base = aTarget.toPath().toAbsolutePath();
Path out = base.resolve(name).toAbsolutePath();
Path base = aTarget.toPath().toAbsolutePath().normalize();
Path out = base.resolve(name).toAbsolutePath().normalize();

if (!out.startsWith(base)) {
// Ignore attempts to write outside the base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private void extract7z(ActionDescription aAction, Path aArchive, Path aTarget)
throws IOException, RarException
{
// We always extract archives into a subfolder. Figure out the name of the folder.
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath();
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath()
.normalize();

Map<String, Object> cfg = aAction.getConfiguration();
int strip = cfg.containsKey("strip") ? (int) cfg.get("strip") : 0;
Expand All @@ -131,7 +132,7 @@ private void extract7z(ActionDescription aAction, Path aArchive, Path aTarget)
}

if (filter.accept(name)) {
Path out = base.resolve(name).toAbsolutePath();
Path out = base.resolve(name).toAbsolutePath().normalize();
if (!out.startsWith(base)) {
throw new IOException(
"Archive tries to generate file outside target folder: [" + name
Expand Down Expand Up @@ -159,7 +160,8 @@ private void extractRar(ActionDescription aAction, Path aArchive, Path aTarget)
throws IOException, RarException
{
// We always extract archives into a subfolder. Figure out the name of the folder.
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath();
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath()
.normalize();

Map<String, Object> cfg = aAction.getConfiguration();
int strip = cfg.containsKey("strip") ? (int) cfg.get("strip") : 0;
Expand All @@ -181,7 +183,7 @@ private void extractRar(ActionDescription aAction, Path aArchive, Path aTarget)
}

if (filter.accept(name)) {
Path out = base.resolve(name).toAbsolutePath();
Path out = base.resolve(name).toAbsolutePath().normalize();
if (!out.startsWith(base)) {
throw new IOException(
"Archive tries to generate file outside target folder: [" + name
Expand Down Expand Up @@ -209,7 +211,8 @@ private void extract(ActionDescription aAction, Path aArchive, ArchiveInputStrea
throws IOException
{
// We always extract archives into a subfolder. Figure out the name of the folder.
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath();
Path base = aTarget.resolve(getPathWithoutFileExtension(aArchive)).toAbsolutePath()
.normalize();

Map<String, Object> cfg = aAction.getConfiguration();
int strip = cfg.containsKey("strip") ? (int) cfg.get("strip") : 0;
Expand All @@ -230,7 +233,7 @@ private void extract(ActionDescription aAction, Path aArchive, ArchiveInputStrea
}

if (filter.accept(name)) {
Path out = base.resolve(name).toAbsolutePath();
Path out = base.resolve(name).toAbsolutePath().normalize();
if (!out.startsWith(base)) {
throw new IOException(
"Archive tries to generate file outside target folder: [" + name + "]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void load(File file) throws IOException, ClassNotFoundException
freqDist = (Object2LongOpenHashMap<T>) in.readObject();
in.close();

int samples = 0;
long samples = 0;

LongIterator sampleIter = freqDist.values().iterator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.net.URI;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.file.Paths;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

Expand Down Expand Up @@ -217,8 +218,13 @@ else if (targetLocation.startsWith(JAR_PREFIX)) {
}

// Begin new entry
ZipEntry entry = new ZipEntry(
zipEntryPrefix + aRelativePath + aExtension + compression.getExtension());
String entryName = zipEntryPrefix + aRelativePath + aExtension
+ compression.getExtension();
if (Paths.get(entryName).normalize().startsWith("..")) {
throw new IOException(
"ZIP entry name [" + entryName + "] would escape archive root");
}
ZipEntry entry = new ZipEntry(entryName);
zipOutputStream.putNextEntry(entry);

// We return an OutputStream for an individual entry. When this is closed by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ public final class MimeTypes
public final static String APPLICATION_X_STANFORDNLP_NER = "application/x.org.dkpro.core.stanfordnlp.ner";
public final static String APPLICATION_X_STANFORDNLP_TAGGER = "application/x.org.dkpro.core.stanfordnlp.tagger";

// LingPipe model types
public final static String APPLICATION_X_LINGPIPE_NER = "application/x.org.dkpro.core.lingpipe.ner";

// ArkTweet model types
public final static String APPLICATION_X_ARKTWEET_TAGGER = "application/x.org.dkpro.core.arktweet.tagger";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ application/vnd.xmi+xml=http://w3id.org/meta-share/omtd-share/Xmi
#application/x.org.dkpro.ancora+xml
application/x.org.dkpro.bnc+xml=http://w3id.org/meta-share/omtd-share/BncFormat
application/x.org.dkpro.brat=http://w3id.org/meta-share/omtd-share/Brat
#application/x.org.dkpro.core.lingpipe.ner
#application/x.org.dkpro.core.opennlp.chunk
#application/x.org.dkpro.core.opennlp.lemma
#application/x.org.dkpro.core.opennlp.ner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public List<DecompoundedWord> rank(List<DecompoundedWord> aSplits)
/**
* Calculates the weight for a split
*/
private float calcRank(DecompoundedWord aSplit)
private double calcRank(DecompoundedWord aSplit)
{
float result = 0;
double result = 0;

for (Fragment elem : aSplit.getSplits()) {
result += -1 * Math
Expand Down
1 change: 0 additions & 1 deletion dkpro-core-gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

<modules>
<module>../dkpro-core-corenlp-gpl</module>
<module>../dkpro-core-lingpipe-gpl</module>
<module>../dkpro-core-sfst-gpl</module>
<module>../dkpro-core-io-tgrep-gpl</module>
</modules>
Expand Down
16 changes: 0 additions & 16 deletions dkpro-core-lingpipe-gpl/.license-header.txt

This file was deleted.

Loading
Loading