Skip to content

Commit

Permalink
Merge pull request #72 from dkpro/feature/71-Upgrade-to-DKPro-Core-1.…
Browse files Browse the repository at this point in the history
…11.0

#71 - Upgrade to dk pro core 1.11.0
  • Loading branch information
reckart authored Jul 14, 2019
2 parents 45c5055 + 0506c8c commit 40a261e
Show file tree
Hide file tree
Showing 125 changed files with 612 additions and 663 deletions.
8 changes: 4 additions & 4 deletions dkpro-similarity-algorithms-lexical-asl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<artifactId>dkpro-similarity-algorithms-vsm-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.api.resources-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-resources-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.api.frequency-asl
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-frequency-asl
</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.dkpro.core.api.resources.ResourceUtils;
import org.dkpro.similarity.algorithms.api.SimilarityException;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasureBase;

import de.tudarmstadt.ukp.dkpro.core.api.resources.ResourceUtils;

/**
* Character n-gram measure as described in
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@
import java.util.Map;
import java.util.Set;

import no.uib.cipr.matrix.DenseVector;
import no.uib.cipr.matrix.Vector;

import org.apache.commons.io.FileUtils;
import org.dkpro.core.api.frequency.util.FrequencyDistribution;
import org.dkpro.similarity.algorithms.api.SimilarityException;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasureBase;
import org.dkpro.similarity.algorithms.vsm.InnerVectorProduct;
import org.dkpro.similarity.algorithms.vsm.VectorNorm;

import de.tudarmstadt.ukp.dkpro.core.api.frequency.util.FrequencyDistribution;
import no.uib.cipr.matrix.DenseVector;
import no.uib.cipr.matrix.Vector;

public class CosineSimilarity
extends TextSimilarityMeasureBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
*/
package org.dkpro.similarity.algorithms.lexical.string.util.gst;

import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class GeneralizedSuffixTree {
// SOH - START OF HEADING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package org.dkpro.similarity.algorithms.lexical.string.util.gst;

import java.util.Collection;
import java.util.HashMap;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class Node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Map;

import org.dkpro.similarity.algorithms.api.TermSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.ngrams.CharacterNGramMeasure;
import org.junit.Test;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import static org.junit.Assert.assertEquals;

import java.util.List;

import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.ngrams.WordNGramContainmentMeasure;
import org.dkpro.similarity.algorithms.lexical.ngrams.WordNGramJaccardMeasure;
import org.junit.Test;

public class WordNGramMeasureTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import org.dkpro.similarity.algorithms.api.TermSimilarityMeasure;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.string.CosineSimilarity;
import org.junit.Test;

public class CosineSimilarityTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.junit.Assert.assertEquals;

import org.dkpro.similarity.algorithms.api.TermSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.string.GreedyStringTiling;
import org.junit.Test;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.dkpro.similarity.algorithms.api.TermSimilarityMeasure;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.string.LevenshteinComparator;
import org.junit.Test;

public class LevenshteinComparatorTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import static org.junit.Assert.assertEquals;

import org.dkpro.similarity.algorithms.lexical.string.LongestCommonSubsequenceComparator;
import org.dkpro.similarity.algorithms.lexical.string.LongestCommonSubsequenceNormComparator;
import org.junit.Test;

public class LongestCommonSubsequenceComparatorTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.junit.Assert.assertEquals;

import org.dkpro.similarity.algorithms.api.TermSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.string.LongestCommonSubstringComparator;
import org.junit.Test;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

import org.dkpro.similarity.algorithms.api.SimilarityException;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexical.string.BoundedSubstringMatchComparator;
import org.dkpro.similarity.algorithms.lexical.string.ExactStringMatchComparator;
import org.dkpro.similarity.algorithms.lexical.string.SubstringMatchComparator;
import org.junit.Test;

public class SimpleStringMatchComparatorTest {
Expand Down
28 changes: 14 additions & 14 deletions dkpro-similarity-algorithms-lexsub-gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,32 @@
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.api.segmentation-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-segmentation-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.api.resources-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-resources-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.opennlp-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-opennlp-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.opennlp-model-tagger-en-maxent</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.tokit-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-tokit-asl</artifactId>
</dependency>
<dependency>
<groupId>org.dkpro.similarity</groupId>
<artifactId>dkpro-similarity-uima-core-asl</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.api.lexmorph-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-lexmorph-asl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
Expand All @@ -78,15 +78,15 @@
<artifactId>uimafit-core</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.gate-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-gate-asl</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.opennlp-asl</artifactId>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-opennlp-asl</artifactId>
<version>${dkpro.core.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.tcas.Annotation;
import org.apache.uima.resource.ResourceInitializationException;
import org.dkpro.core.gate.GateLemmatizer;
import org.dkpro.core.opennlp.OpenNlpPosTagger;
import org.dkpro.core.tokit.BreakIteratorSegmenter;
import org.dkpro.similarity.algorithms.api.JCasTextSimilarityMeasureBase;
import org.dkpro.similarity.algorithms.api.SimilarityException;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexsub.util.BingTranslator;

import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma;
import de.tudarmstadt.ukp.dkpro.core.gate.GateLemmatizer;
import de.tudarmstadt.ukp.dkpro.core.opennlp.OpenNlpPosTagger;
import de.tudarmstadt.ukp.dkpro.core.tokit.BreakIteratorSegmenter;

/**
* Similarity measure which uses the Microsoft Bing translator to translate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.tcas.Annotation;
import org.dkpro.core.api.resources.DkproContext;
import org.dkpro.similarity.algorithms.api.JCasTextSimilarityMeasureBase;
import org.dkpro.similarity.algorithms.api.SimilarityException;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;

import de.tudarmstadt.langtech.substituter.MLSenseSubstituter;
import de.tudarmstadt.langtech.substituter.SenseSubstituter;
import de.tudarmstadt.langtech.substituter.Substitution;
import de.tudarmstadt.ukp.dkpro.core.api.resources.DkproContext;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

import java.util.Map;

import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.descriptor.ExternalResource;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexsub.BingSMTWrapper;
import org.dkpro.similarity.algorithms.lexsub.BingSMTWrapper.Language;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.io.IOException;
import java.util.Map;

import org.apache.uima.fit.descriptor.ExternalResource;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.fit.descriptor.ExternalResource;
import org.dkpro.similarity.algorithms.api.TextSimilarityMeasure;
import org.dkpro.similarity.algorithms.lexsub.TWSISubstituteWrapper;
import org.dkpro.similarity.uima.resource.JCasTextSimilarityResourceBase;
Expand Down
2 changes: 1 addition & 1 deletion dkpro-similarity-algorithms-lsr-asl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>dkpro-similarity-asl</artifactId>
<groupId>org.dkpro.similarity</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
<relativePath>../dkpro-similarity-asl</relativePath>
</parent>
<artifactId>dkpro-similarity-algorithms-lsr-asl</artifactId> <dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,24 @@
import de.tudarmstadt.ukp.dkpro.lexsemresource.exception.LexicalSemanticResourceException;

public final class JiangConrathRelatednessResource
extends LSRRelatednessResourceBase
extends LSRRelatednessResourceBase
{

@SuppressWarnings({ "rawtypes" })
@Override
public boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams)
throws ResourceInitializationException
{
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}
public boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams)
throws ResourceInitializationException
{
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}

try {
try {
measure = new JiangConrathComparator(lsr);
}
catch (LexicalSemanticResourceException e) {
throw new ResourceInitializationException(e);
}

return true;
}
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,36 @@
*
*/
public abstract class LSRRelatednessResourceBase
extends TextSimilarityResourceBase
extends TextSimilarityResourceBase
{

// Attention! Can only have String parameters in external resources.

public static final String PARAM_RESOURCE_NAME = "LsrResourceName";
@ConfigurationParameter(name = PARAM_RESOURCE_NAME, mandatory = true)
protected String lsrResourceName;

public static final String PARAM_RESOURCE_LANGUAGE = "LSRResourceLanguage";
@ConfigurationParameter(name = PARAM_RESOURCE_LANGUAGE, mandatory = true)
protected String lsrResourceLanguage;

protected LexicalSemanticResource lsr;

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams)
throws ResourceInitializationException
{
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}
public boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams)
throws ResourceInitializationException
{
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}

try {
try {
lsr = ResourceFactory.getInstance().get(lsrResourceName, lsrResourceLanguage);
}
catch (ResourceLoaderException e) {
throw new ResourceInitializationException(e);
}

return true;
}
return true;
}
}
Loading

0 comments on commit 40a261e

Please sign in to comment.