2018-07-05 07:37:35 +00:00
|
|
|
package data;
|
2018-07-17 14:04:26 +00:00
|
|
|
|
2018-11-05 09:30:41 +00:00
|
|
|
import java.util.ArrayList;
|
2018-07-17 14:04:26 +00:00
|
|
|
import java.util.Objects;
|
|
|
|
|
2018-07-05 07:37:35 +00:00
|
|
|
/*
|
|
|
|
Created for when words are sorted by multiple keys, i.e. not just lemmas but lemmas and msd simultaneously.
|
|
|
|
*/
|
2018-08-09 07:21:06 +00:00
|
|
|
public interface MultipleHMKeys {
|
|
|
|
String getK1();
|
2018-08-10 09:08:01 +00:00
|
|
|
default String getK2(){ return null; }
|
|
|
|
default String getK3(){ return null; }
|
|
|
|
default String getK4(){ return null; }
|
|
|
|
default String getK5(){ return null; }
|
2018-07-05 07:37:35 +00:00
|
|
|
|
2018-11-05 09:30:41 +00:00
|
|
|
default ArrayList<MultipleHMKeys> getSplittedMultipleHMKeys(){ return null; }
|
|
|
|
|
2018-11-13 12:57:49 +00:00
|
|
|
default String getMsd(Filter filter) {
|
|
|
|
String msd = "";
|
|
|
|
if (filter.getCalculateFor().equals(CalculateFor.MORPHOSYNTACTIC_SPECS)){
|
|
|
|
msd = getK1();
|
|
|
|
} else if (filter.getMultipleKeys().contains(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
|
|
|
|
int i = 0;
|
|
|
|
for (CalculateFor otherKey : filter.getMultipleKeys()) {
|
|
|
|
switch (i) {
|
|
|
|
case 0:
|
|
|
|
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
|
|
|
|
msd = getK2();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
|
|
|
|
msd = getK3();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
|
|
|
|
msd = getK4();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
|
|
|
|
msd = getK5();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msd;
|
|
|
|
}
|
|
|
|
|
2018-07-05 07:37:35 +00:00
|
|
|
@Override
|
2018-08-09 07:21:06 +00:00
|
|
|
int hashCode();
|
2018-07-05 07:37:35 +00:00
|
|
|
|
|
|
|
@Override
|
2018-08-09 07:21:06 +00:00
|
|
|
boolean equals(Object obj);
|
2018-07-05 07:37:35 +00:00
|
|
|
}
|