//
// Core Program for TETDM 
// SentenceData.java Version 0.11
// Copyright(C) 2011 TETDM CORE MEMBER ALL RIGHTS RESERVED.
// This program is provided under the license.
//


package source.TextData;


import java.io.*;
import java.util.*;

public class SentenceData
{
	public String sentenceText;		//Sentence text

	public int keywordIDList[];		//List of keyword ID
	public int keywordNumber;		//Number of keywords
	public int kindKeywordNumber;	//kind number of keywords	
	
	public String word[];			//All words
	public String wordEndForm[];	//All words end-form
	public int wordIDList[];		//ID list for all words, -1: not in keywords
	public int wordNumber;			//Number of all words

	public int positionOfSegment;	//Segment position number in the original text
	public int positionOfSentence;	//Sentence position number in the original text


	public SentenceData(String text, int n1, int n2)
	{
		sentenceText = text;
		positionOfSegment = n1;
		positionOfSentence = n2;
	}

	public SentenceData(String senText, String senText2, String idlist, int keynum, int n1, int n2, boolean english)
	{
		if(english)
			sentenceText = senText;
		else
			sentenceText = senText.replace(" ","");
		
		word = senText.split(" ");
		wordEndForm = senText2.split(" ");

		wordNumber = word.length;
		keywordNumber = keynum;

		keywordIDList = new int[keywordNumber];
		wordIDList = new int[wordNumber];

		String idlist2[] = idlist.split(" ");

		for(int i=0;i<wordNumber;i++)
			wordIDList[i] = Integer.parseInt(idlist2[i]);

		for(int i=0,k=0;i<wordNumber;i++)
			if(wordIDList[i] >= 0)
				keywordIDList[k++] = wordIDList[i];

		positionOfSegment = n1;
		positionOfSentence = n2;
	}
}
