Fixed slow combination of words and lemmas presentation

This commit is contained in:
2018-07-17 16:04:26 +02:00
bovenliggende c073e12f55
commit 84d0086a66
7 gewijzigde bestanden met toevoegingen van 113 en 73 verwijderingen

Bestand weergeven

@@ -1,10 +1,13 @@
package data;
import java.util.Objects;
/*
Created for when words are sorted by multiple keys, i.e. not just lemmas but lemmas and msd simultaneously.
*/
public final class MultipleHMKeys {
private final String key, lemma, wordType, msd;
private MultipleHMKeys actual_obj;
public MultipleHMKeys(String key) {
this.key = key;
this.lemma = "";
@@ -37,12 +40,7 @@ public final class MultipleHMKeys {
@Override
public int hashCode() {
// if(key2 == null){
// return key1.hashCode();
// } else if (key3 == null){
// return key1.hashCode() ^ key2.hashCode();
// }
return key.hashCode() ^ lemma.hashCode() ^ wordType.hashCode() ^ msd.hashCode();
return Objects.hash(key, lemma, wordType, msd);
}
@Override

Bestand weergeven

@@ -304,6 +304,10 @@ public class StatisticsNew {
}
public Map<String, Map<MultipleHMKeys, AtomicLong>> getTaxonomyResult() {
return taxonomyResult;
}
public void updateResults(String o) {
// if not in map
AtomicLong r = result.putIfAbsent(o, new AtomicLong(1));