Fixed progress bar color changing

This commit is contained in:
2019-01-26 09:53:16 +01:00
parent a5039f542f
commit 7ce8b83d16
10 changed files with 100 additions and 63 deletions

View File

@@ -47,7 +47,7 @@ public class Corpus {
}
public void setCorpusName(String corpusName) {
System.out.println(corpusName);
// System.out.println(corpusName);
this.corpusName = corpusName;
logger.info("Corpus.set: ", corpusName);
}

View File

@@ -621,7 +621,7 @@ public class StatisticsNew {
// String sep = "";
for (String s : tax) {
if (s == null) {
if (corpus.getTaxonomy().size() == 0 || s == null) {
continue;
}
@@ -680,16 +680,20 @@ public class StatisticsNew {
long sum_fwi =0L;
long mul_fwi =1L;
for(MultipleHMKeys smallHmKey : hmKey.getSplittedMultipleHMKeys()){
// System.out.println(smallHmKey.getK1());
sum_fwi += oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
mul_fwi *= oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
}
// String t = hmKey.getK1();
// if(hmKey.getK1().equals("v Slovenija")){
// System.out.println("TEST");
// if(hmKey.getK1().equals("ja ja ja ja ja") || hmKey.getK1().equals("ne ne ne ne ne")){
// System.out.println("TEST");
//
// }
// }
for(MultipleHMKeys smallHmKey : hmKey.getSplittedMultipleHMKeys()){
// System.out.println(smallHmKey.getK1());
sum_fwi += oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
mul_fwi *= oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
}
// String t = hmKey.getK1();
if(mul_fwi < 0){
mul_fwi = Long.MAX_VALUE;
}
double O = (double)taxonomyResult.get(corpus.getTotal()).get(hmKey).longValue();
double n = (double)filter.getNgramValue();
double E = (double)mul_fwi / Math.pow(N, n - 1);

View File

@@ -104,11 +104,11 @@ public class Tax {
public static ObservableList<String> getTaxonomyForComboBox(CorpusType corpusType, HashSet<String> foundTax) {
LinkedHashMap<String, String> tax = new LinkedHashMap<>();
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) {
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY;
} else if (corpusType == CorpusType.GOS) {
tax = GOS_TAXONOMY;
} else if (corpusType == CorpusType.VERT){
} else if (corpusType == CorpusType.VERT || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2){
// if VERT only order taxonomy by alphabet
ArrayList<String> sortedFoundTaxonomy = new ArrayList<>(foundTax);
Collections.sort(sortedFoundTaxonomy);
@@ -147,7 +147,7 @@ public class Tax {
LinkedHashMap<String, String> tax = new LinkedHashMap<>();
Set<Taxonomy> foundTaxHS= new HashSet<>(foundTax);
if (corpus.getCorpusType() == CorpusType.GIGAFIDA || corpus.getCorpusType() == CorpusType.CCKRES || corpus.getCorpusType() == CorpusType.SSJ500K || corpus.getCorpusType() == CorpusType.GIGAFIDA2) {
if (corpus.getCorpusType() == CorpusType.GIGAFIDA || corpus.getCorpusType() == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY;
} else if (corpus.getCorpusType() == CorpusType.GOS) {
tax = GOS_TAXONOMY;
@@ -264,11 +264,11 @@ public class Tax {
LinkedHashMap<String, String> tax = new LinkedHashMap<>();
ArrayList<String> result = new ArrayList<>();
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) {
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY;
} else if (corpusType == CorpusType.GOS) {
tax = GOS_TAXONOMY;
} else if (corpusType == CorpusType.VERT) {
} else if (corpusType == CorpusType.VERT || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) {
for (Taxonomy t : taxonomy) {
result.add(t.toLongNameString());
}

View File

@@ -477,17 +477,13 @@ enum TaxonomyEnum {
}
}
// return new Taxonomy(tax, tax);
System.out.println("2.");
System.out.println(tax);
return null;
}
public static ArrayList<TaxonomyEnum> taxonomySelected(TaxonomyEnum disjointTaxonomy) {
ArrayList<TaxonomyEnum> r = new ArrayList<>();
System.out.println(disjointTaxonomy);
// System.out.println(disjointTaxonomy);
if(disjointTaxonomy.equals(DISKURZ)){
r.add(DISKURZ_JAVNI);
r.add(DISKURZ_INFORMATIVNO_IZOBRAZEVALNI);
@@ -700,8 +696,8 @@ enum TaxonomyEnum {
}
public static ArrayList<TaxonomyEnum> convertStringListToTaxonomyList(ObservableList<String> stringList, Corpus corpus){
System.out.println("1.");
System.out.println(stringList);
// System.out.println("1.");
// System.out.println(stringList);
ArrayList<TaxonomyEnum> taxonomyList = new ArrayList<>();
// System.out.println("INTERESTING STUFF");
@@ -720,10 +716,10 @@ enum TaxonomyEnum {
public static void modifyingTaxonomy(ArrayList<TaxonomyEnum> taxonomy, ArrayList<TaxonomyEnum> checkedItemsTaxonomy, Corpus corpus){
// get taxonomies that were selected/deselected by user
System.out.println("Print here:");
System.out.println(taxonomy);
System.out.println(checkedItemsTaxonomy);
System.out.println("-------------");
// System.out.println("Print here:");
// System.out.println(taxonomy);
// System.out.println(checkedItemsTaxonomy);
// System.out.println("-------------");
Set<TaxonomyEnum> disjointTaxonomies = new HashSet<>(checkedItemsTaxonomy);
if (taxonomy != null) {
@@ -923,7 +919,7 @@ public class Taxonomy {
}
public static ArrayList<TaxonomyEnum> taxonomyToTaxonomyEnum(ArrayList<Taxonomy> taxonomy){
System.out.println(taxonomy);
// System.out.println(taxonomy);
if (taxonomy == null) {
return null;
}
@@ -958,7 +954,7 @@ public class Taxonomy {
public static ArrayList<Taxonomy> modifyingTaxonomy(ArrayList<Taxonomy> taxonomy, ObservableList<String> checkedItems, Corpus corpus){
ArrayList<TaxonomyEnum> checkedItemsTaxonomy = TaxonomyEnum.convertStringListToTaxonomyList(checkedItems, corpus);
if (checkedItemsTaxonomy != null && corpus.getCorpusType() != CorpusType.VERT) {
if (checkedItemsTaxonomy != null && corpus.getCorpusType() != CorpusType.VERT && corpus.getCorpusType() != CorpusType.SSJ500K && corpus.getCorpusType() != CorpusType.GIGAFIDA2) {
TaxonomyEnum.modifyingTaxonomy(Taxonomy.taxonomyToTaxonomyEnum(taxonomy), checkedItemsTaxonomy, corpus);
return taxonomyEnumToTaxonomy(checkedItemsTaxonomy, corpus);
} else {