Added some style modifications.
This commit is contained in:
parent
cbfe3e6025
commit
a7f3bdb925
|
@ -637,7 +637,7 @@ public class XML_processing {
|
|||
// parser reached end of the current sentence
|
||||
if (endElement.getName().getLocalPart().equals(sentenceDelimiter)) {
|
||||
// count all UniGramOccurrences in sentence for statistics
|
||||
stats.updateUniGramOccurrences(sentence.size());
|
||||
stats.updateUniGramOccurrences(sentence.size(), currentFiletaxonomyLong);
|
||||
|
||||
// add sentence to corpus if it passes filters
|
||||
sentence = runFilters(sentence, stats.getFilter());
|
||||
|
|
|
@ -43,7 +43,7 @@ public class StatisticsNew {
|
|||
private LocalDateTime timeBeginning;
|
||||
private LocalDateTime timeEnding;
|
||||
private Map<Collocability, Map<MultipleHMKeys, Double>> collocability;
|
||||
private AtomicLong uniGramOccurrences;
|
||||
private Map<String, AtomicLong> uniGramTaxonomyOccurrences;
|
||||
|
||||
public StatisticsNew(Corpus corpus, Filter filter, boolean useDB) {
|
||||
this.corpus = corpus;
|
||||
|
@ -51,7 +51,8 @@ public class StatisticsNew {
|
|||
this.taxonomyResult = new ConcurrentHashMap<>();
|
||||
this.taxonomyResult.put("Total", new ConcurrentHashMap<>());
|
||||
this.collocability = new ConcurrentHashMap<>();
|
||||
this.uniGramOccurrences = new AtomicLong(0L);
|
||||
this.uniGramTaxonomyOccurrences = new ConcurrentHashMap<>();
|
||||
this.uniGramTaxonomyOccurrences.put("Total", new AtomicLong(0L));
|
||||
|
||||
|
||||
// create table for counting word occurrences per taxonomies
|
||||
|
@ -342,12 +343,20 @@ public class StatisticsNew {
|
|||
return Util.sortByValue(Util.atomicInt2StringAndInt(map), limit);
|
||||
}
|
||||
|
||||
public void updateUniGramOccurrences(int amount){
|
||||
uniGramOccurrences.set(uniGramOccurrences.get() + amount);
|
||||
public void updateUniGramOccurrences(int amount, ArrayList<String> taxonomy){
|
||||
uniGramTaxonomyOccurrences.get("Total").set(uniGramTaxonomyOccurrences.get("Total").longValue() + amount);
|
||||
for (String t : taxonomy){
|
||||
if (uniGramTaxonomyOccurrences.get(t) != null){
|
||||
uniGramTaxonomyOccurrences.get(t).set(uniGramTaxonomyOccurrences.get(t).longValue() + amount);
|
||||
} else {
|
||||
uniGramTaxonomyOccurrences.put(t, new AtomicLong(amount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long getUniGramOccurrences(){
|
||||
return uniGramOccurrences.longValue();
|
||||
public Map<String, AtomicLong> getUniGramOccurrences(){
|
||||
// return uniGramTaxonomyOccurrences.get("Total").longValue();
|
||||
return uniGramTaxonomyOccurrences;
|
||||
}
|
||||
|
||||
public void updateTaxonomyResults(MultipleHMKeys o, List<String> taxonomy) {
|
||||
|
@ -456,16 +465,21 @@ public class StatisticsNew {
|
|||
info.put("Korpus:", corpus.getCorpusType().toString());
|
||||
setTimeEnding();
|
||||
info.put("Datum:", timeEnding.format(DateTimeFormatter.ofPattern("dd.MM.yyyy hh:mm")));
|
||||
|
||||
// time elapsed
|
||||
long seconds = ChronoUnit.MILLIS.between(timeBeginning, timeEnding) / 1000;
|
||||
info.put("Čas izvajanja:", String.valueOf(seconds) + " s");
|
||||
|
||||
if (filter.getAl() == AnalysisLevel.STRING_LEVEL) {
|
||||
Integer ngramLevel = filter.getNgramValue();
|
||||
if (ngramLevel == 0)
|
||||
info.put("Analiza:", "Črke");
|
||||
info.put("Analiza:", "črke");
|
||||
else if (ngramLevel == 1) {
|
||||
// if suffixes or prefixes are not null print word parts
|
||||
if (filter.getSuffixLength() != null || filter.getSuffixList() != null || filter.getPrefixLength() != null || filter.getPrefixList() != null) {
|
||||
info.put("Analiza:", "Besedni deli");
|
||||
info.put("Analiza:", "besedni deli");
|
||||
} else {
|
||||
info.put("Analiza:", "Besede");
|
||||
info.put("Analiza:", "besede");
|
||||
}
|
||||
} else
|
||||
info.put("Analiza:", filter.getAl().toString());
|
||||
|
@ -473,97 +487,102 @@ public class StatisticsNew {
|
|||
info.put("Analiza:", filter.getAl().toString());
|
||||
}
|
||||
|
||||
if (filter.getAl() == AnalysisLevel.STRING_LEVEL) {
|
||||
Integer ngramLevel = filter.getNgramValue();
|
||||
|
||||
// n.gram nivo
|
||||
if (ngramLevel > 1) {
|
||||
info.put("n-gram nivo:", String.valueOf(ngramLevel));
|
||||
}
|
||||
|
||||
// skip
|
||||
if (ngramLevel > 1)
|
||||
info.put("Skip:", isNotEmpty(filter.getSkipValue()) ? filter.getSkipValue().toString() : "0");
|
||||
|
||||
// calculate for
|
||||
info.put("Izračunaj za:", filter.getCalculateFor().toString());
|
||||
|
||||
// also write
|
||||
if (filter.getMultipleKeys().size() > 0){
|
||||
|
||||
StringBuilder mk = new StringBuilder();
|
||||
for (CalculateFor s : filter.getMultipleKeys()) {
|
||||
mk.append(s.toString()).append("; ");
|
||||
}
|
||||
info.put("Izpiši tudi: ", String.join("; ", mk.substring(0, mk.length() - 2)));
|
||||
}
|
||||
|
||||
// time elapsed
|
||||
// setTimeEnding();
|
||||
long seconds = ChronoUnit.MILLIS.between(timeBeginning, timeEnding) / 1000;
|
||||
info.put("Čas izvajanja:", String.valueOf(seconds) + " s");
|
||||
|
||||
// data limitations
|
||||
if (filter.getDisplayTaxonomy()){
|
||||
info.put("Izpiši taksonomije: ", "Da");
|
||||
} else {
|
||||
info.put("Izpiši taksonomije: ", "Ne");
|
||||
}
|
||||
|
||||
// note punctuations - ngram > 1
|
||||
if(ngramLevel > 1) {
|
||||
if (filter.getNotePunctuations()) {
|
||||
info.put("Upoštevaj ločila: ", "Da");
|
||||
} else {
|
||||
info.put("Upoštevaj ločila: ", "Ne");
|
||||
}
|
||||
}
|
||||
|
||||
// also write - n - gram > 1
|
||||
if (ngramLevel > 1 && filter.getCollocability().size() > 0){
|
||||
StringBuilder mk = new StringBuilder();
|
||||
for (Collocability s : filter.getCollocability()) {
|
||||
mk.append(s.toString()).append("; ");
|
||||
}
|
||||
info.put("Kolokabilnost: ", String.join("; ", mk.substring(0, mk.length() - 2)));
|
||||
}
|
||||
|
||||
// fragmented MSD - n-gram = 1
|
||||
if (info.get("Analiza:").equals("Besede")){
|
||||
if (filter.getWriteMsdAtTheEnd()){
|
||||
info.put("Izpiši razbit MSD: ", "Da");
|
||||
} else {
|
||||
info.put("Izpiši razbit MSD: ", "Ne");
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.getSuffixLength() != null || filter.getSuffixList() != null || filter.getPrefixLength() != null || filter.getPrefixList() != null) {
|
||||
if (filter.getPrefixLength() > 0 || filter.getSuffixLength() > 0) {
|
||||
info.put("Dolžina predpone: ", String.valueOf(filter.getPrefixLength()));
|
||||
info.put("Dolžina pripone: ", String.valueOf(filter.getSuffixLength()));
|
||||
} else {
|
||||
info.put("Seznam predpon: ", String.join("; ", filter.getPrefixList()));
|
||||
info.put("Seznam pripon: ", String.join("; ", filter.getSuffixList()));
|
||||
}
|
||||
}
|
||||
|
||||
// msd
|
||||
if (!isEmpty(filter.getMsd())) {
|
||||
StringBuilder msdPattern = new StringBuilder();
|
||||
for (Pattern pattern : filter.getMsd()) {
|
||||
msdPattern.append(pattern.toString()).append(" ");
|
||||
}
|
||||
|
||||
info.put("MSD:", msdPattern.toString());
|
||||
}
|
||||
|
||||
// if (filter.getAl() == AnalysisLevel.STRING_LEVEL) {
|
||||
Integer ngramLevel = filter.getNgramValue();
|
||||
|
||||
if (ngramLevel == 0){
|
||||
info.put("Število črk:", filter.getStringLength().toString());
|
||||
}
|
||||
|
||||
// calculate for
|
||||
info.put("Izračunaj za:", filter.getCalculateFor().toString());
|
||||
|
||||
// also write
|
||||
if (filter.getMultipleKeys().size() > 0){
|
||||
|
||||
StringBuilder mk = new StringBuilder();
|
||||
for (CalculateFor s : filter.getMultipleKeys()) {
|
||||
mk.append(s.toString()).append("; ");
|
||||
}
|
||||
info.put("Izpiši tudi: ", String.join("; ", mk.substring(0, mk.length() - 2)));
|
||||
} else {
|
||||
info.put("Izpiši tudi: ", "");
|
||||
}
|
||||
|
||||
// data limitations
|
||||
if (filter.getDisplayTaxonomy()){
|
||||
info.put("Izpiši taksonomije: ", "da");
|
||||
} else {
|
||||
info.put("Izpiši taksonomije: ", "ne");
|
||||
}
|
||||
|
||||
// n.gram nivo
|
||||
if (ngramLevel > 1) {
|
||||
info.put("N-gram nivo:", String.valueOf(ngramLevel));
|
||||
}
|
||||
|
||||
// skip
|
||||
if (ngramLevel > 1)
|
||||
info.put("Preskok besed:", isNotEmpty(filter.getSkipValue()) ? filter.getSkipValue().toString() : "0");
|
||||
|
||||
// note punctuations - ngram > 1
|
||||
if(ngramLevel > 1) {
|
||||
if (filter.getNotePunctuations()) {
|
||||
info.put("Upoštevaj ločila: ", "da");
|
||||
} else {
|
||||
info.put("Upoštevaj ločila: ", "ne");
|
||||
}
|
||||
}
|
||||
|
||||
// also write - n - gram > 1
|
||||
if (ngramLevel > 1 && filter.getCollocability().size() > 0){
|
||||
StringBuilder mk = new StringBuilder();
|
||||
for (Collocability s : filter.getCollocability()) {
|
||||
mk.append(s.toString()).append("; ");
|
||||
}
|
||||
info.put("Kolokabilnost: ", String.join("; ", mk.substring(0, mk.length() - 2)));
|
||||
} else {
|
||||
info.put("Kolokabilnost: ", "");
|
||||
}
|
||||
|
||||
// fragmented MSD - n-gram = 1
|
||||
if (info.get("Analiza:").equals("besede")){
|
||||
if (filter.getWriteMsdAtTheEnd()){
|
||||
info.put("Izpiši razbit MSD: ", "da");
|
||||
} else {
|
||||
info.put("Izpiši razbit MSD: ", "ne");
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.getSuffixLength() != null || filter.getSuffixList() != null || filter.getPrefixLength() != null || filter.getPrefixList() != null) {
|
||||
if (filter.getPrefixLength() > 0 || filter.getSuffixLength() > 0) {
|
||||
info.put("Dolžina predpone: ", String.valueOf(filter.getPrefixLength()));
|
||||
info.put("Dolžina pripone: ", String.valueOf(filter.getSuffixLength()));
|
||||
} else {
|
||||
info.put("Seznam predpon: ", String.join("; ", filter.getPrefixList()));
|
||||
info.put("Seznam pripon: ", String.join("; ", filter.getSuffixList()));
|
||||
}
|
||||
}
|
||||
|
||||
// msd
|
||||
if (!isEmpty(filter.getMsd())) {
|
||||
StringBuilder msdPattern = new StringBuilder();
|
||||
for (Pattern pattern : filter.getMsd()) {
|
||||
msdPattern.append(pattern.toString()).append(" ");
|
||||
}
|
||||
|
||||
info.put("Oznaka MSD:", msdPattern.toString());
|
||||
} else {
|
||||
info.put("Oznaka MSD:", "");
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
info.put("Taksonomija: ", "");
|
||||
if (isNotEmpty(filter.getTaxonomy()) && Tax.getCorpusTypesWithTaxonomy().contains(corpus.getCorpusType())) {
|
||||
ArrayList<String> tax = Tax.getTaxonomyForInfo(corpus.getCorpusType(), filter.getTaxonomy());
|
||||
|
||||
info.put("Taksonomija: ", "");
|
||||
String sep = "";
|
||||
for (String s : tax) {
|
||||
info.put(sep = sep + " ", s);
|
||||
|
|
|
@ -10,6 +10,7 @@ import javafx.collections.ObservableList;
|
|||
import javafx.concurrent.Task;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
@ -29,6 +30,9 @@ import static gui.Messages.*;
|
|||
public class CharacterAnalysisTab {
|
||||
public final static Logger logger = LogManager.getLogger(CharacterAnalysisTab.class);
|
||||
|
||||
@FXML
|
||||
public AnchorPane characterAnalysisTab;
|
||||
|
||||
@FXML
|
||||
public Label selectedFiltersLabel;
|
||||
@FXML
|
||||
|
@ -116,6 +120,9 @@ public class CharacterAnalysisTab {
|
|||
private CorpusType currentCorpusType;
|
||||
|
||||
public void init() {
|
||||
characterAnalysisTab.getStylesheets().add("style.css");
|
||||
characterAnalysisTab.getStyleClass().add("root");
|
||||
|
||||
currentMode = MODE.LETTER;
|
||||
toggleMode(currentMode);
|
||||
|
||||
|
@ -191,6 +198,15 @@ public class CharacterAnalysisTab {
|
|||
// set
|
||||
displayTaxonomyChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
displayTaxonomy = newValue;
|
||||
if(displayTaxonomy){
|
||||
minimalTaxonomyTF.setDisable(false);
|
||||
} else {
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
}
|
||||
|
||||
logger.info("display taxonomy: ", displayTaxonomy);
|
||||
});
|
||||
displayTaxonomyChB.setTooltip(new Tooltip(TOOLTIP_readDisplayTaxonomyChB));
|
||||
|
@ -228,6 +244,8 @@ public class CharacterAnalysisTab {
|
|||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalOccurrencesTF.focusedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
if (!newValue) {
|
||||
// focus lost
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOCase;
|
||||
import org.apache.commons.io.filefilter.FileFilterUtils;
|
||||
|
@ -38,6 +39,9 @@ public class CorpusTab {
|
|||
|
||||
private Stage stage;
|
||||
|
||||
@FXML
|
||||
private AnchorPane corpusTabPane;
|
||||
|
||||
@FXML
|
||||
private Button chooseCorpusLocationB;
|
||||
private File chosenCorpusLocation;
|
||||
|
@ -89,6 +93,10 @@ public class CorpusTab {
|
|||
|
||||
|
||||
public void initialize() {
|
||||
// add CSS style
|
||||
corpusTabPane.getStylesheets().add("style.css");
|
||||
corpusTabPane.getStyleClass().add("root");
|
||||
|
||||
stage = new Stage();
|
||||
|
||||
// add listeners
|
||||
|
|
|
@ -52,6 +52,9 @@ public class FiltersForSolar {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initialize() {
|
||||
solarFiltersTabPane.getStylesheets().add("style.css");
|
||||
solarFiltersTabPane.getStyleClass().add("root");
|
||||
|
||||
selectedFilters = new HashMap<>();
|
||||
|
||||
solarRegijaCCB.getCheckModel().getCheckedItems().addListener((ListChangeListener) c -> {
|
||||
|
|
|
@ -2,6 +2,7 @@ package gui;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kordamp.ikonli.fontawesome.FontAwesome;
|
||||
|
@ -21,6 +22,8 @@ import javafx.stage.Stage;
|
|||
public class GUIController extends Application {
|
||||
public final static Logger logger = LogManager.getLogger(GUIController.class);
|
||||
|
||||
@FXML
|
||||
public AnchorPane gui;
|
||||
@FXML
|
||||
public Tab StringLevelTabNew2;
|
||||
@FXML
|
||||
|
@ -95,6 +98,10 @@ public class GUIController extends Application {
|
|||
}
|
||||
|
||||
public void initialize() {
|
||||
// add CSS style
|
||||
gui.getStylesheets().add("style.css");
|
||||
gui.getStyleClass().add("root");
|
||||
|
||||
corpus = new Corpus();
|
||||
ctController.setCorpus(corpus);
|
||||
ctController.setFilterTab(filterTab);
|
||||
|
|
|
@ -7,7 +7,9 @@ import javafx.collections.ListChangeListener;
|
|||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -27,6 +29,10 @@ import static gui.Messages.*;
|
|||
public class OneWordAnalysisTab {
|
||||
public final static Logger logger = LogManager.getLogger(OneWordAnalysisTab.class);
|
||||
|
||||
@FXML
|
||||
private AnchorPane oneWordAnalysisTabPane;
|
||||
// private ArrayList<String> alsoVisualize;
|
||||
|
||||
@FXML
|
||||
public Label selectedFiltersLabel;
|
||||
@FXML
|
||||
|
@ -109,6 +115,10 @@ public class OneWordAnalysisTab {
|
|||
private CorpusType currentCorpusType;
|
||||
|
||||
public void init() {
|
||||
// add CSS style
|
||||
oneWordAnalysisTabPane.getStylesheets().add("style.css");
|
||||
oneWordAnalysisTabPane.getStyleClass().add("root");
|
||||
|
||||
currentMode = MODE.WORD;
|
||||
toggleMode(currentMode);
|
||||
|
||||
|
@ -227,6 +237,14 @@ public class OneWordAnalysisTab {
|
|||
// set
|
||||
displayTaxonomyChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
displayTaxonomy = newValue;
|
||||
if(displayTaxonomy){
|
||||
minimalTaxonomyTF.setDisable(false);
|
||||
} else {
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
}
|
||||
logger.info("display taxonomy: ", displayTaxonomy);
|
||||
});
|
||||
displayTaxonomyChB.setTooltip(new Tooltip(TOOLTIP_readDisplayTaxonomyChB));
|
||||
|
@ -247,6 +265,8 @@ public class OneWordAnalysisTab {
|
|||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalOccurrencesTF.focusedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
if (!newValue) {
|
||||
// focus lost
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import javafx.application.HostServices;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.apache.commons.lang3.SerializationUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
@ -32,6 +33,9 @@ import javafx.scene.layout.Pane;
|
|||
public class StringAnalysisTabNew2 {
|
||||
public final static Logger logger = LogManager.getLogger(StringAnalysisTabNew2.class);
|
||||
|
||||
@FXML
|
||||
public AnchorPane stringAnalysisTabPaneNew2;
|
||||
|
||||
@FXML
|
||||
public Label selectedFiltersLabel;
|
||||
@FXML
|
||||
|
@ -143,6 +147,10 @@ public class StringAnalysisTabNew2 {
|
|||
private CorpusType currentCorpusType;
|
||||
|
||||
public void init() {
|
||||
// add CSS style
|
||||
stringAnalysisTabPaneNew2.getStylesheets().add("style.css");
|
||||
stringAnalysisTabPaneNew2.getStyleClass().add("root");
|
||||
|
||||
currentMode = MODE.WORD;
|
||||
toggleMode(currentMode);
|
||||
|
||||
|
@ -179,6 +187,8 @@ public class StringAnalysisTabNew2 {
|
|||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
notePunctuations = false;
|
||||
// set
|
||||
notePunctuationsChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
@ -191,6 +201,14 @@ public class StringAnalysisTabNew2 {
|
|||
// set
|
||||
displayTaxonomyChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
displayTaxonomy = newValue;
|
||||
if(displayTaxonomy){
|
||||
minimalTaxonomyTF.setDisable(false);
|
||||
} else {
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
}
|
||||
logger.info("display taxonomy: ", displayTaxonomy);
|
||||
});
|
||||
displayTaxonomyChB.setTooltip(new Tooltip(TOOLTIP_readDisplayTaxonomyChB));
|
||||
|
|
|
@ -8,6 +8,7 @@ import javafx.collections.ObservableList;
|
|||
import javafx.concurrent.Task;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -27,6 +28,9 @@ import static gui.Messages.*;
|
|||
public class WordLevelTab {
|
||||
public final static Logger logger = LogManager.getLogger(OneWordAnalysisTab.class);
|
||||
|
||||
@FXML
|
||||
public AnchorPane wordLevelAnalysisTabPane;
|
||||
|
||||
@FXML
|
||||
public Label selectedFiltersLabel;
|
||||
@FXML
|
||||
|
@ -125,6 +129,10 @@ public class WordLevelTab {
|
|||
private CorpusType currentCorpusType;
|
||||
|
||||
public void init() {
|
||||
// add CSS style
|
||||
wordLevelAnalysisTabPane.getStylesheets().add("style.css");
|
||||
wordLevelAnalysisTabPane.getStyleClass().add("root");
|
||||
|
||||
currentMode = MODE.WORD;
|
||||
toggleMode(currentMode);
|
||||
|
||||
|
@ -216,6 +224,7 @@ public class WordLevelTab {
|
|||
logger.info("Prefix length " + suffixLength);
|
||||
});
|
||||
|
||||
prefixListTF.setText("");
|
||||
prefixList = new ArrayList<>();
|
||||
|
||||
prefixListTF.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
@ -248,6 +257,7 @@ public class WordLevelTab {
|
|||
}
|
||||
});
|
||||
|
||||
suffixListTF.setText("");
|
||||
suffixList = new ArrayList<>();
|
||||
|
||||
suffixListTF.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
@ -350,6 +360,14 @@ public class WordLevelTab {
|
|||
// set
|
||||
displayTaxonomyChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
displayTaxonomy = newValue;
|
||||
if(displayTaxonomy){
|
||||
minimalTaxonomyTF.setDisable(false);
|
||||
} else {
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
}
|
||||
logger.info("display taxonomy: ", displayTaxonomy);
|
||||
});
|
||||
displayTaxonomyChB.setTooltip(new Tooltip(TOOLTIP_readDisplayTaxonomyChB));
|
||||
|
@ -370,6 +388,8 @@ public class WordLevelTab {
|
|||
minimalTaxonomyTF.setText("1");
|
||||
minimalTaxonomy = 1;
|
||||
|
||||
minimalTaxonomyTF.setDisable(true);
|
||||
|
||||
minimalOccurrencesTF.focusedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
if (!newValue) {
|
||||
// focus lost
|
||||
|
|
|
@ -76,15 +76,16 @@ public class Export {
|
|||
num_frequencies = Util.mapSumFrequencies(map);
|
||||
}
|
||||
|
||||
Map<String, Long> num_taxonomy_frequencies = new ConcurrentHashMap<>();
|
||||
for (String taxonomyKey : taxonomyResults.keySet()) {
|
||||
num_taxonomy_frequencies.put(taxonomyKey, (long) 0);
|
||||
for (AtomicLong value : taxonomyResults.get(taxonomyKey).values()){
|
||||
long val = num_taxonomy_frequencies.get(taxonomyKey);
|
||||
val += value.get();
|
||||
num_taxonomy_frequencies.put(taxonomyKey, val);
|
||||
}
|
||||
}
|
||||
// Map<String, Long> num_taxonomy_frequencies = new ConcurrentHashMap<>();
|
||||
// for (String taxonomyKey : taxonomyResults.keySet()) {
|
||||
// num_taxonomy_frequencies.put(taxonomyKey, (long) 0);
|
||||
// for (AtomicLong value : taxonomyResults.get(taxonomyKey).values()){
|
||||
// long val = num_taxonomy_frequencies.get(taxonomyKey);
|
||||
// val += value.get();
|
||||
// num_taxonomy_frequencies.put(taxonomyKey, val);
|
||||
// }
|
||||
// }
|
||||
Map<String, AtomicLong> num_taxonomy_frequencies = statistics.getUniGramOccurrences();
|
||||
|
||||
|
||||
//CSV file header
|
||||
|
@ -105,7 +106,7 @@ public class Export {
|
|||
}
|
||||
}
|
||||
|
||||
headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(statistics.getUniGramOccurrences()));
|
||||
headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(statistics.getUniGramOccurrences().get("Total").longValue()));
|
||||
// headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(num_frequencies));
|
||||
|
||||
for (CalculateFor otherKey : filter.getMultipleKeys()) {
|
||||
|
@ -127,7 +128,7 @@ public class Export {
|
|||
}
|
||||
|
||||
for (String key : taxonomyResults.keySet()) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key) > 0) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key).longValue() > 0) {
|
||||
FILE_HEADER_AL.add("Absolutna pogostost [" + key + "]");
|
||||
FILE_HEADER_AL.add("Delež [" + key + "]");
|
||||
FILE_HEADER_AL.add("Relativna pogostost [" + key + "]");
|
||||
|
@ -270,13 +271,13 @@ public class Export {
|
|||
dataEntry.add(formatNumberAsPercent((double) e.getValue() / num_frequencies));
|
||||
dataEntry.add(String.format("%.2f", ((double) e.getValue() * 1000000)/num_frequencies));
|
||||
for (String key : taxonomyResults.keySet()){
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key) > 0) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key).longValue() > 0) {
|
||||
AtomicLong frequency = taxonomyResults.get(key).get(e.getKey());
|
||||
dataEntry.add(frequency.toString());
|
||||
// dataEntry.add(formatNumberAsPercent((double) frequency.get() / num_taxonomy_frequencies.get(key)));
|
||||
// dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / num_taxonomy_frequencies.get(key)));
|
||||
dataEntry.add(formatNumberAsPercent((double) frequency.get() / statistics.getUniGramOccurrences()));
|
||||
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / statistics.getUniGramOccurrences()));
|
||||
dataEntry.add(formatNumberAsPercent((double) frequency.get() / num_taxonomy_frequencies.get(key).longValue()));
|
||||
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / num_taxonomy_frequencies.get(key).longValue()));
|
||||
// dataEntry.add(formatNumberAsPercent((double) frequency.get() / statistics.getUniGramOccurrences()));
|
||||
// dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / statistics.getUniGramOccurrences()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<?import javafx.collections.FXCollections?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<AnchorPane prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||
<AnchorPane fx:id="gui" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="gui.GUIController">
|
||||
<children>
|
||||
<TabPane fx:id="tabPane" prefHeight="600.0" prefWidth="800.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
|
||||
<AnchorPane prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||
<AnchorPane fx:id="corpusTabPane" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="gui.CorpusTab">
|
||||
<children>
|
||||
<Pane/>
|
||||
|
@ -18,7 +18,7 @@
|
|||
text="Preberi info iz headerjev"/>
|
||||
<Pane fx:id="setCorpusWrapperP" layoutX="10.0" layoutY="60.0" prefHeight="118.0" prefWidth="683.0">
|
||||
<children>
|
||||
<Label fx:id="chooseCorpusL" prefHeight="50.0" prefWidth="704.0" text="Label"/>
|
||||
<Label fx:id="chooseCorpusL" prefHeight="70.0" prefWidth="704.0" text="Label"/>
|
||||
<!--<CheckBox fx:id="gosUseOrthChB" layoutY="65.0" mnemonicParsing="false" text="Uporabi pogovorni zapis"/>-->
|
||||
</children>
|
||||
</Pane>
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
</ComboBox>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<Label layoutX="10.0" layoutY="210.0" prefHeight="10.0" text="* IZBIRA PREDHODNEGA FILTRA LAHKO MOČNO UPOČASNI DELOVANJE" styleClass="test"/>
|
||||
|
||||
<!-- for some reason following two ComboBoxes have to be below paneWords -->
|
||||
<Label layoutX="10.0" layoutY="20.0" prefHeight="25.0" text="Izračunaj za" />
|
||||
<ComboBox fx:id="calculateForCB" layoutX="185.0" layoutY="20.0" minWidth="180.0" prefWidth="180.0" promptText="izberi" visibleRowCount="5">
|
||||
|
@ -57,6 +60,8 @@
|
|||
<Label layoutX="10.0" layoutY="100.0" prefHeight="25.0" text="Izpiši taksonomije" />
|
||||
<CheckBox fx:id="displayTaxonomyChB" layoutX="263.0" layoutY="105.0" selected="false" />
|
||||
|
||||
<Label layoutX="10.0" layoutY="130.0" prefHeight="10.0" text="* IZBIRA PREDHODNEGA FILTRA LAHKO MOČNO UPOČASNI DELOVANJE" styleClass="test"/>
|
||||
|
||||
<Label layoutX="10.0" layoutY="140.0" prefHeight="25.0" text="N-gram nivo" />
|
||||
<ComboBox fx:id="ngramValueCB" layoutX="185.0" layoutY="140.0" prefHeight="25.0" prefWidth="180.0" promptText="izberi" visibleRowCount="5">
|
||||
<items>
|
||||
|
|
Loading…
Reference in New Issue
Block a user