@@ -0,0 +1,1975 @@
+package com.github.megallo.markoverator.storage.h2;%0A%0Aimport com.github.megallo.markoverator.storage.BigrammerStorage;%0Aimport com.github.megallo.markoverator.utils.Pair;%0Aimport org.h2.mvstore.MVStore;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Apublic class MVStoreBigrammerStorage implements BigrammerStorage %7B%0A%0A    private final MVStore store;%0A%0A    private final Map%3CInteger, String%3E fullWordList;%0A    private final Map%3CPair, List%3CString%3E%3E forwardCache;%0A    private final Map%3CPair, List%3CString%3E%3E backwardCache;%0A    private final Map%3CString, List%3CInteger%3E%3E wordIndex;%0A%0A    public MVStoreBigrammerStorage(String filename) %7B%0A        this.store = new MVStore.Builder()%0A                .fileName(filename)%0A                .readOnly()%0A                .open();%0A%0A        // all_words %3Ccounter, word%3E%0A        this.fullWordList = store.openMap(%22fullWordList%22);%0A%0A        // forward_chain %3Cword_one, word_two, word_three%3E%0A        this.forwardCache = store.openMap(%22forwardCache%22);%0A%0A        // backward_chain %3Cword_two, word_three, word_one%3E%0A        this.backwardCache = store.openMap(%22backwardCache%22);%0A%0A        // word_index %3Cword, %3Clist of word locations%3E%3E%0A        this.wordIndex = store.openMap(%22wordIndex%22);%0A    %7D%0A%0A    @Override%0A    public int getFullWordListSize() %7B%0A        return fullWordList.size();%0A    %7D%0A%0A    @Override%0A    public String getByIndex(int index) %7B%0A        return fullWordList.get(index);%0A    %7D%0A%0A    @Override%0A    public List%3CInteger%3E getAllPossibleLocations(String word) %7B%0A        return wordIndex.get(word);%0A    %7D%0A%0A    @Override%0A    public boolean containsForwardWordList(Pair key) %7B%0A        return forwardCache.containsKey(key);%0A    %7D%0A%0A    @Override%0A    public List%3CString%3E getForwardWordList(Pair key) %7B%0A        return forwardCache.get(key);%0A    %7D%0A%0A    @Override%0A    public List%3CString%3E getBackwardWordList(Pair key) %7B%0A        return backwardCache.get(key);%0A    %7D%0A%0A    public String getFileName() %7B%0A        return store.getFileStore().getFileName();%0A    %7D%0A%7D%0A

Add MVStore-based BigrammerStorage implementation