package ch.bfh.bti7535.w2016.algorithm;

import ch.bfh.bti7535.w2016.filehandling.Classification;

import java.util.HashMap;
import java.util.Map;

public class Document {

	private String filename;
	private Classification goldStandard;
	private Classification testResult;
	private Map<String, WordProperty> content = new HashMap<>();

	public Document() {
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getFilename() {
		return filename;
	}

	public void setGoldStandard(Classification classifier) {
		this.goldStandard = classifier;
	}

	public Classification getGoldStandard() {
		return goldStandard;
	}

	public void setContent(Map<String, WordProperty> content) {
		this.content = content;
	}

	public Map<String, WordProperty> getContent() {
		return content;
	}

	public void setTestResult(Classification testResult) {
		this.testResult = testResult;
	}

	public Classification getTestResult() {
		return testResult;
	}

	public static class WordProperty {
		private int occurence = 0;
		private Classification meaning;

		public WordProperty(int occurence, Classification meaning) {
			this.occurence = occurence;
			this.meaning = meaning;
		}

		public int getOccurence() {
			return occurence;
		}

		@Override public String toString() {
			return "WordProperty{" +
					"occurence=" + occurence +
					", meaning=" + meaning +
					'}';
		}
	}
}

@@ -118,16 +118,39 @@
 ashMap;%0A
+import java.util.List;%0A
 import j
@@ -163,16 +163,16 @@
 il.Map;%0A
-
 %0Apublic 
@@ -373,24 +373,90 @@
 ent() %7B%0A%09%7D%0A%0A
+%09public Document(List%3CString%3E tokens) %7B%0A%09%09setContent(tokens);%0A%09%7D%0A%0A
 %09public void
@@ -822,32 +822,155 @@
  = content;%0A%09%7D%0A%0A
+%09public void setContent(List%3CString%3E content) %7B%0A%09%09for (String token : content) %7B%0A%09%09%09this.content.put(token, null);%0A%09%09%7D%0A%09%7D%0A%0A
 %09public Map%3CStri
@@ -997,16 +997,34 @@
 tContent
+WithWordProperties
 () %7B%0A%09%09r
@@ -1034,32 +1034,114 @@
 rn content;%0A%09%7D%0A%0A
+%09public List%3CString%3E getContent() %7B%0A%09%09return (List%3CString%3E) content.keySet();%0A%09%7D%0A%0A
 %09public void set

Document class needs update on getter/setter for tokens (no usage of WordProperty for NaiveBayes)