<commit_before>package main;

import entities.Corpus;
import entities.Song;
import entities.Word;
import org.hibernate.Transaction;
import plsa.PLSA;
import storage.Hibernator;

import java.util.ArrayList;
import java.util.List;

public class MainHibernateTest {

    public static void main(String[] args) throws Exception {
        Corpus corpus = new Corpus();
        Word word = new Word("hi",2);
        List<Word> wordList =  new ArrayList<>();
        wordList.add(word);
        corpus.add(new Song(9,"i","you and i",wordList));

        PLSA plsa = new PLSA(corpus,1,1);<commit_msg>Showcase of hibernate problem (execute MainHibernateTest twice)<commit_after>package main;

import entities.Corpus;
import entities.Song;
import entities.Word;
import org.hibernate.Transaction;
import plsa.PLSA;
import storage.Hibernator;

import javax.persistence.TypedQuery;
import java.util.ArrayList;
import java.util.List;

public class MainHibernateTest {

    public static void main(String[] args) throws Exception {

        Corpus c = new Corpus();

        TypedQuery<Song> query = Hibernator.mainSession.createQuery("from Song", Song.class).setMaxResults(500);
        List<Song> songs = query.getResultList();

        songs.forEach((song) -> c.add(song));

        PLSA plsa = new PLSA(c, 10, 5);
        plsa.run();
{'fraction_non_alphanumeric': 0.11497730711043873, 'fraction_numerical': 0.007564296520423601, 'mean_word_length': 3.8819188191881917, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '4927204', 'n_tokens_mistral': 422, 'n_tokens_neox': 396, 'n_words': 105}