diff --git a/dkpro-statistics-agreement/pom.xml b/dkpro-statistics-agreement/pom.xml
index 4ae5ccd..5ce7ea3 100644
--- a/dkpro-statistics-agreement/pom.xml
+++ b/dkpro-statistics-agreement/pom.xml
@@ -43,15 +43,34 @@
org.slf4j
slf4j-api
+
+ org.apache.commons
+ commons-math3
+
+
+ org.apache.commons
+ commons-lang3
+
+
org.junit.jupiter
junit-jupiter-api
test
+
+ org.junit.jupiter
+ junit-jupiter-params
+ test
+
org.assertj
assertj-core
test
+
+ org.slf4j
+ slf4j-simple
+ test
+
diff --git a/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AlignableAnnotationUnit.java b/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AlignableAnnotationUnit.java
new file mode 100644
index 0000000..93cccae
--- /dev/null
+++ b/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AlignableAnnotationUnit.java
@@ -0,0 +1,328 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Original source: https://github.com/fab-bar/TextGammaTool.git
+ */
+package org.dkpro.statistics.agreement.aligning;
+
+import static java.util.Collections.sort;
+import static java.util.Collections.unmodifiableMap;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+import org.dkpro.statistics.agreement.aligning.data.Rater;
+
+public class AlignableAnnotationUnit
+ implements IAlignableAnnotationUnit
+{
+ private static final long serialVersionUID = 8646000607502108382L;
+
+ private final Rater rater;
+ private final String type;
+ private final Map features = new HashMap();
+
+ private final long begin;
+ private final long end;
+
+ public AlignableAnnotationUnit(Rater creator, int beg, int end)
+ {
+ this(creator, null, beg, end, null);
+ }
+
+ public AlignableAnnotationUnit(Rater creator, int beg, int end, Map featureset)
+ {
+ this(creator, null, beg, end, featureset);
+ }
+
+ public AlignableAnnotationUnit(Rater aCreator, long aBegin, long aEnd,
+ Map aFeatures)
+ {
+ this(aCreator, NO_TYPE, aBegin, aEnd, null);
+ }
+
+ public AlignableAnnotationUnit(Rater aRater, String aType, long aBegin, long aEnd,
+ Map aFeatures)
+ {
+ if (aRater == null) {
+ rater = new Rater("", -1);
+ }
+ else {
+ rater = aRater;
+ }
+
+ if (aType == null) {
+ type = NO_TYPE;
+ }
+ else {
+ type = aType;
+ }
+
+ if (aBegin >= aEnd) {
+ throw new IllegalArgumentException("Begin has to be smaller than end.");
+ }
+
+ begin = aBegin;
+ end = aEnd;
+
+ if (aFeatures != null) {
+ features.putAll(aFeatures);
+ }
+ }
+
+ public Rater getRater()
+ {
+ return rater;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ @Override
+ public Object getCategory()
+ {
+ return getFeatures();
+ }
+
+ @Override
+ public long getBegin()
+ {
+ return begin;
+ }
+
+ @Override
+ public long getEnd()
+ {
+ return end;
+ }
+
+ @Override
+ public int getRaterIdx()
+ {
+ return rater.getIndex();
+ }
+
+ public Set getFeatureNames()
+ {
+ return features.keySet();
+ }
+
+ public String getFeatureValue(String attribute)
+ {
+ return features.get(attribute);
+ }
+
+ public Map getFeatures()
+ {
+ return unmodifiableMap(features);
+ }
+
+ public boolean isCoextensive(AlignableAnnotationUnit aOther)
+ {
+ return (getBegin() == aOther.getBegin()) && (getEnd() == aOther.getEnd());
+ }
+
+ public boolean overlaps(AlignableAnnotationUnit aOther)
+ {
+ return !(aOther.getEnd() <= getBegin() || aOther.getBegin() >= getEnd());
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (o == null) {
+ return false;
+ }
+ if (getClass() != o.getClass()) {
+ return false;
+ }
+
+ AlignableAnnotationUnit seg = (AlignableAnnotationUnit) o;
+ // same type?
+ if (!Objects.equals(getType(), seg.getType())) {
+ return false;
+ }
+
+ // same creator?
+ if (!Objects.equals(getRater(), seg.getRater())) {
+ return false;
+ }
+
+ // same span?
+ if (!this.isCoextensive(seg)) {
+ return false;
+ }
+
+ // same attributes?
+ if (!this.getFeatureNames().equals(seg.getFeatureNames())) {
+ return false;
+ }
+ // same attribute values?
+ for (String attribute : this.getFeatureNames()) {
+ if (!Objects.equals(this.getFeatureValue(attribute), seg.getFeatureValue(attribute))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int compareTo(IAlignableAnnotationUnit aOther)
+ {
+ if (aOther == null) {
+ return -1;
+ }
+
+ if (this.equals(aOther)) {
+ return 0;
+ }
+
+ // first: start offset
+ if (this.getBegin() < aOther.getBegin()) {
+ return -1;
+ }
+ if (this.getBegin() > aOther.getBegin()) {
+ return 1;
+ }
+
+ // second: end offset
+ if (this.getEnd() < aOther.getEnd()) {
+ return -1;
+ }
+ if (this.getEnd() > aOther.getEnd()) {
+ return 1;
+ }
+
+ if (!(aOther instanceof AlignableAnnotationUnit)) {
+ return -1;
+ }
+
+ AlignableAnnotationUnit other = (AlignableAnnotationUnit) aOther;
+
+ // sort by Type
+ if (!Objects.equals(getType(), other.getType())) {
+ if (getType() != null && other.getType() != null) {
+ return getType().compareTo(other.getType());
+ }
+ else if (getType() == null) {
+ return -1;
+ }
+ else {
+ return 1;
+ }
+ }
+
+ // sort by Creator
+ if (!Objects.equals(getRater(), other.getRater())) {
+ if (this.getRater() != null && other.getRater() != null) {
+ return this.getRater().getName().compareTo(other.getRater().getName());
+ }
+ else if (this.getRater() == null) {
+ return -1;
+ }
+ else {
+ return 1;
+ }
+ }
+
+ // sort by number of attributes
+ if (this.getFeatureNames().size() != other.getFeatureNames().size()) {
+ return Integer.compare(this.getFeatureNames().size(), other.getFeatureNames().size());
+ }
+
+ // sort by attributes names
+ List attributelistX = new ArrayList(this.getFeatureNames());
+ sort(attributelistX);
+
+ List attributelistY = new ArrayList(other.getFeatureNames());
+ sort(attributelistY);
+
+ if (!attributelistX.equals(attributelistY)) {
+ return String.join("", attributelistX).compareTo(String.join("", attributelistY));
+ }
+
+ // sort by attribute values (in order of names)
+ for (int i = 0; i < attributelistX.size(); i++) {
+ String attr = attributelistX.get(i);
+ if (!this.getFeatureValue(attr).equals(other.getFeatureValue(attr))) {
+ return this.getFeatureValue(attr).compareTo(other.getFeatureValue(attr));
+ }
+ }
+
+ // annotations are equal
+ // (but one is instantiation of subclass)
+ return 0;
+
+ }
+
+ public AlignableAnnotationUnit cloneWithDifferentLabel(String aType, String aLabel)
+ {
+ var feat = new HashMap<>(getFeatures());
+ feat.put(aType, aLabel);
+ return new AlignableAnnotationUnit(rater, aType, begin, end, feat);
+ }
+
+ public AlignableAnnotationUnit cloneWithDifferentOffsets(long aBegin, long aEnd)
+ {
+ return new AlignableAnnotationUnit(rater, type, aBegin, aEnd, features);
+
+ }
+
+ public AlignableAnnotationUnit cloneWithDifferentRater(Rater aRater)
+ {
+ return new AlignableAnnotationUnit(aRater, type, begin, end, features);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hash = 0;
+ hash += getRater().hashCode();
+ hash += getType().hashCode();
+ hash += features.hashCode();
+ hash += getBegin() + getEnd();
+
+ return hash;
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.toString(new ArrayList());
+ }
+
+ public String toString(List attributes)
+ {
+ var ret = new StringBuilder();
+ ret.append(String.valueOf(getBegin()));
+ ret.append("-");
+ ret.append(String.valueOf(getEnd()));
+ for (String attribute : attributes) {
+ ret.append("\t");
+ if (this.getFeatureValue(attribute) != null) {
+ ret.append(this.getFeatureValue(attribute));
+ }
+ else {
+ ret.append("--");
+ }
+ }
+ return ret.toString();
+ }
+}
diff --git a/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AligningAnnotationStudy.java b/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AligningAnnotationStudy.java
new file mode 100644
index 0000000..e1c022c
--- /dev/null
+++ b/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/aligning/AligningAnnotationStudy.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Original source: https://github.com/fab-bar/TextGammaTool.git
+ */
+package org.dkpro.statistics.agreement.aligning;
+
+import static java.util.Arrays.asList;
+import static java.util.Collections.unmodifiableCollection;
+import static java.util.Collections.unmodifiableList;
+import static java.util.Collections.unmodifiableSet;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.dkpro.statistics.agreement.aligning.data.Rater;
+
+/**
+ * a set of units created by a given set of annotators; all units are linked to the same (implicit)
+ * continuum
+ */
+public class AligningAnnotationStudy
+ implements IAligningAnnotationStudy
+{
+ private static final long serialVersionUID = 1892754946013211747L;
+
+ private final Set raters = new TreeSet();
+ private final Set units = new TreeSet();
+ private final Set