<commit_before>package edu.chl.proton.model;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 * Created by antonlevholm on 2017-05-01.
 */
public class Workspace implements IFileHandler, IDocumentHandler {
    private List<Document> tabs = new ArrayList<>();
    private Document currentDocument;
    private Folder currentDirectory;
    private DocumentFactory factory = new DocumentFactory();

    public Workspace() {
        //setCurrentDirectory(new Folder("Root"));
    }


    public void setCurrentDocument(Document doc) {
        currentDocument = doc;
    }

    public Document getCurrentDocument() {
        return currentDocument;
    }

    public void saveCurrentDocument() throws IOException {
       currentDocument.save();
    }

    public void setCurrentDirectory(Folder folder) {
        currentDirectory = folder;
    }

    public String getCurrentDirectory() {
        return "./"; //currentDirectory.getPath();
    }


    public void createDocument(DocumentType type) {
        factory.createDocument(type);
    }

    @Override
    public void openDocument(String filePath) {
        factory.getDocument(filePath);

    }

    @Override
    public void removeCurrentDocument() {

    }

    public void removeDocument(Document doc) {
        if (tabs.contains(doc)) {
            tabs.remove(doc);
        }
    }
<commit_msg>create new markdown doc in Workspace constructor<commit_after>package edu.chl.proton.model;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 * Created by antonlevholm on 2017-05-01.
 */
public class Workspace implements IFileHandler, IDocumentHandler {
    private List<Document> tabs = new ArrayList<>();
    private Document currentDocument;
    private Folder currentDirectory;
    private DocumentFactory factory = new DocumentFactory();

    public Workspace() {
        currentDocument = factory.createDocument(DocumentType.MARKDOWN);
        tabs.add(currentDocument);
        //setCurrentDirectory(new Folder("Root"));
    }


    public void setCurrentDocument(Document doc) {
        currentDocument = doc;
    }

    public Document getCurrentDocument() {
        return currentDocument;
    }

    public void saveCurrentDocument() throws IOException {
       currentDocument.save();
    }

    public void setCurrentDirectory(Folder folder) {
        currentDirectory = folder;
    }

    public String getCurrentDirectory() {
        return currentDirectory == null ? "./" : currentDirectory.getPath();
    }


    public void createDocument(DocumentType type) {
        factory.createDocument(type);
    }

    @Override
    public void openDocument(String filePath) {
        factory.getDocument(filePath);

    }

    @Override
    public void removeCurrentDocument() {

    }

    public void removeDocument(Document doc) {
        if (tabs.contains(doc)) {
            tabs.remove(doc);
        }
    }

{'fraction_non_alphanumeric': 0.09413735343383585, 'fraction_numerical': 0.005360134003350084, 'mean_word_length': 2.934123847167325, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '128906', 'n_tokens_mistral': 804, 'n_tokens_neox': 758, 'n_words': 193}