﻿package template_sentence_generator;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

public class Main2 {


	public static void main(String[] args) throws FileNotFoundException, IOException {


		List<Noun> nounlist=NounList2.getNounListWithCtg("data/comentAll.txt","resources/category.txt");
		List<String> existSentencelist=OriginSentenceList.createOriginSentenceList("data/comentAll.txt");
		String BREAK="「ｂれあｋ」";
		 int i=1;
		 int same=0;
		 boolean hantei;
		 int temp = CountTemp.countTemp(nounlist, existSentencelist);
		 List<String> newSentencelist = NewSentenceList2.createNewSentenceList(nounlist, existSentencelist, 100);







		for(String str1 :newSentencelist){
			hantei=false;

			for(String exist:existSentencelist){
				if(exist.equals(str1.replaceAll("距離：\\d+?", ""))){
					same++;
				    //System.out.println("already:"+str1.replaceAll(">>\\d+"+BREAK+"||>>\\d+", "").replace(BREAK, "\n")+"count:"+same);
				    hantei=true;
				    break;
				}
			}

			if(!hantei){
				existSentencelist.add(str1.replaceAll("距離：\\d+?", ""));
				System.out.println("----------------"+i+"レス目-----------------");
			    System.out.println(str1.replaceAll(">>\\d+?"+BREAK+"||>>\\d+?", "").replace(BREAK, "\n"));
		        System.out.println("-----------------------------------------");
		        i++;
			}
		}
		System.out.println("既存の文章："+same);
		System.out.println("テンプレート総数："+temp);
	}

}
