diff --git a/.gitignore b/.gitignore index 5c9ea6b..349db05 100755 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +src/main/resources/translation_external/ +src/main/resources/translations_backup/ diff --git a/src/main/java/alg/XML_processing.java b/src/main/java/alg/XML_processing.java index 3db0dcd..9d31002 100755 --- a/src/main/java/alg/XML_processing.java +++ b/src/main/java/alg/XML_processing.java @@ -365,7 +365,7 @@ public class XML_processing { } else if (qName.equals("c3") || qName.equals("c1") || qName.equals("c")) { String c3Content = eventReader.nextEvent().asCharacters().getData(); - if (stats.getFilter().getNgramValue() > 1 && stats.getFilter().getNotePunctuations() && + if (stats.getFilter().getNotePunctuations() && stavek.size() > 0) { stavek.add(createWord(c3Content, c3Content, "/", "", stats.getFilter())); @@ -774,7 +774,8 @@ public class XML_processing { sentence.add(createWord(word, lemma, msd, word, stats.getFilter())); inWord = false; } - if (stats.getFilter().getNgramValue() > 1 && stats.getFilter().getNotePunctuations() && inPunctuation && sentence.size() > 0) { +// if (stats.getFilter().getNgramValue() > 1 && stats.getFilter().getNotePunctuations() && inPunctuation && sentence.size() > 0) { + if (stats.getFilter().getNotePunctuations() && inPunctuation && sentence.size() > 0) { String punctuation = characters.getData(); sentence.add(createWord(punctuation, punctuation, "/", punctuation, stats.getFilter())); inPunctuation = false; @@ -1052,7 +1053,7 @@ public class XML_processing { sentence.add(createWord(word, lemma, msd, word, stats.getFilter())); inWord = false; } - if (stats.getFilter().getNgramValue() > 1 && stats.getFilter().getNotePunctuations() && inPunctuation) { + if (stats.getFilter().getNotePunctuations() && inPunctuation) { // if (stats.getFilter().getNgramValue() > 1 && stats.getFilter().getNotePunctuations() && inPunctuation && sentence.size() > 0) { String punctuation = characters.getData(); sentence.add(createWord(punctuation, punctuation, "/", punctuation, stats.getFilter())); diff --git a/src/main/java/gui/OneWordAnalysisTab.java b/src/main/java/gui/OneWordAnalysisTab.java index 3cacabc..d925534 100755 --- a/src/main/java/gui/OneWordAnalysisTab.java +++ b/src/main/java/gui/OneWordAnalysisTab.java @@ -56,6 +56,9 @@ public class OneWordAnalysisTab { @FXML public Label writeMsdAtTheEndL; + @FXML + public Label notePunctuationsL; + @FXML public Label dataLimitL; @@ -86,6 +89,9 @@ public class OneWordAnalysisTab { @FXML public ImageView writeMsdAtTheEndI; + @FXML + public ImageView notePunctuationsI; + @FXML public ImageView msdI; @@ -122,6 +128,10 @@ public class OneWordAnalysisTab { private CheckBox writeMsdAtTheEndChB; private boolean writeMsdAtTheEnd; + @FXML + private CheckBox notePunctuationsChB; + private boolean notePunctuations; + @FXML private ComboBox calculateForCB; private CalculateFor calculateFor; @@ -494,6 +504,16 @@ public class OneWordAnalysisTab { }); // writeMsdAtTheEndChB.setTooltip(new Tooltip(TOOLTIP_readDisplayTaxonomyChB)); + notePunctuations = false; + // set + notePunctuationsChB.selectedProperty().addListener((observable, oldValue, newValue) -> { + notePunctuations = newValue; + logger.info("note punctuations: ", notePunctuations); + }); + notePunctuationsChB.setSelected(false); + notePunctuationsChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readNotePunctuationsChB"))); + notePunctuationsChB.setDisable(false); + // set default values minimalOccurrencesTF.setText("1"); minimalOccurrences = 1; @@ -653,6 +673,7 @@ public class OneWordAnalysisTab { alsoVisualizeL.textProperty().bind(I18N.createStringBinding("label.alsoVisualize")); displayTaxonomyL.textProperty().bind(I18N.createStringBinding("label.displayTaxonomy")); writeMsdAtTheEndL.textProperty().bind(I18N.createStringBinding("label.writeMsdAtTheEnd")); + notePunctuationsL.textProperty().bind(I18N.createStringBinding("label.notePunctuations")); dataLimitL.textProperty().bind(I18N.createStringBinding("label.dataLimit")); msdL.textProperty().bind(I18N.createStringBinding("label.msd")); @@ -666,6 +687,7 @@ public class OneWordAnalysisTab { addTooltipToImage(alsoVisualizeI, I18N.createStringBinding("label.word.alsoVisualizeH")); addTooltipToImage(displayTaxonomyI, I18N.createStringBinding("label.word.displayTaxonomyH")); addTooltipToImage(writeMsdAtTheEndI, I18N.createStringBinding("label.word.writeMsdAtTheEndH")); + addTooltipToImage(notePunctuationsI, I18N.createStringBinding("label.wordSet.notePunctuationsH")); addTooltipToImage(msdI, I18N.createStringBinding("label.word.msdH")); addTooltipToImage(taxonomyI, I18N.createStringBinding("label.word.taxonomyH")); @@ -721,6 +743,8 @@ public class OneWordAnalysisTab { filter.setSolarFilters(solarFiltersMap); filter.setStringLength(1); filter.setMultipleKeys(alsoVisualize); +// filter.setNotePunctuations(true); + filter.setNotePunctuations(notePunctuations); // setMsd must be behind alsoVisualize filter.setMsd(msd); diff --git a/src/main/resources/gui/OneWordAnalysisTab.fxml b/src/main/resources/gui/OneWordAnalysisTab.fxml index bcb32f7..15a040e 100755 --- a/src/main/resources/gui/OneWordAnalysisTab.fxml +++ b/src/main/resources/gui/OneWordAnalysisTab.fxml @@ -54,6 +54,12 @@ +