added comments
parent
bfc9a1e43c
commit
8aab5ca993
|
@ -11,7 +11,7 @@ public class FileLoader {
|
|||
public FileLoader() {
|
||||
this.inputFile = null;
|
||||
}
|
||||
//KI erstellte Methode
|
||||
//KI erstellte Methode mit anpassungen
|
||||
public File loadFileGUI() {
|
||||
try {
|
||||
JFileChooser fileChooser = new JFileChooser();
|
||||
|
@ -30,6 +30,7 @@ public class FileLoader {
|
|||
}
|
||||
}
|
||||
|
||||
//Methode sucht das Datei Format für spätere Verwendung
|
||||
public String getFileFormat(File file) {
|
||||
String fileName = file.getName();
|
||||
String fileFormat = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1) : "";
|
||||
|
|
|
@ -23,18 +23,19 @@ public class TextProcessing {
|
|||
private boolean stemming;
|
||||
private int maxWords;
|
||||
|
||||
public boolean isStemming() {
|
||||
return stemming;
|
||||
}
|
||||
|
||||
public int getMaxWords() {
|
||||
return maxWords;
|
||||
}
|
||||
|
||||
public void setStemming(boolean stemming) {
|
||||
this.stemming = stemming;
|
||||
}
|
||||
|
||||
// für spätere verwendung mit umfangreichen anpassungen
|
||||
// public boolean isStemming() {
|
||||
// return stemming;
|
||||
// }
|
||||
//
|
||||
// public int getMaxWords() {
|
||||
// return maxWords;
|
||||
// }
|
||||
//
|
||||
// public void setStemming(boolean stemming) {
|
||||
// this.stemming = stemming;
|
||||
// }
|
||||
//
|
||||
public void setMaxWords(int maxWords) {
|
||||
this.maxWords = maxWords;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Map;
|
|||
|
||||
public class WordCloudCreator {
|
||||
|
||||
//Ki erstellte Methode aus Zeitgründen und Krankheitsgründen
|
||||
//Ki erstellte Methode wegen Zeitgründen und Krankheitsgründen, dennoch anpassungen in großen Maße waren notwendig
|
||||
public void insertWordsIntoTemplate(Map<String, Integer> wordMap) {
|
||||
File templateFile = new File("wordcloud.html"); // Template in project directory
|
||||
File outputFile = new File("output.html"); // Output in project directory
|
||||
|
|
|
@ -60,19 +60,17 @@ public class WordCloudManager {
|
|||
System.out.println(stopwordList);
|
||||
}
|
||||
|
||||
|
||||
public void stemming(String approval) {
|
||||
if(approval.equals("yes")) {
|
||||
processing.setStemming(true);
|
||||
}
|
||||
}
|
||||
// für spätere Verwendung mit umfangreichen Änderungen im Code
|
||||
// public void stemming(String approval) {
|
||||
// if(approval.equals("yes")) {
|
||||
// processing.setStemming(true);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void maxWordsInList(int number) {
|
||||
processing.setMaxWords(number);
|
||||
}
|
||||
|
||||
|
||||
// ab hier noch nicht fertig.
|
||||
public void tokenizingText() {
|
||||
wordMap = (HashMap<String, Integer>) processing.tokenizingFile(processing.fileToTextString(filePath, fileFormat)
|
||||
, !stopwordList.isEmpty() ? stopwordList : null);
|
||||
|
@ -80,8 +78,6 @@ public class WordCloudManager {
|
|||
}
|
||||
|
||||
public void cutWordsList() {
|
||||
|
||||
|
||||
wordMap = (HashMap<String, Integer>) processing.maxShowWords(processing.sortList(wordMap));
|
||||
processing.sortList(wordMap);
|
||||
System.out.println(wordMap.keySet() + "\n" + wordMap.values());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tui;
|
||||
|
||||
public class Main {
|
||||
//startet die GUI
|
||||
public static void main(String[]args){
|
||||
new TUI();
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ public class TUI {
|
|||
}
|
||||
|
||||
public void tui() {
|
||||
|
||||
|
||||
while(isRunning) {
|
||||
System.out.println("Welcome to Word Cloud.\nType number in the following Menu to access your targeted Option.\nMenu:\n\n(0) Load File\n(1) URL Path" +
|
||||
"\n(2) Exit");
|
||||
|
@ -80,8 +78,8 @@ public class TUI {
|
|||
case(3):
|
||||
// Set Stemming
|
||||
System.out.println("Set Stemming: Input 'yes' or 'no'");
|
||||
String stemmingOption = scan.nextLine();
|
||||
wcm.stemming(stemmingOption);
|
||||
// String stemmingOption = scan.nextLine();
|
||||
// wcm.stemming(stemmingOption);
|
||||
break;
|
||||
case(4):
|
||||
//Create WordCloud
|
||||
|
|
Loading…
Reference in New Issue