//
// Core Program for TETDM 
// SegmentData.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 SegmentData
{
	public String segmentText;

	public SentenceData sentence[];			//Structure of sentence
	public int sentenceNumber;				//number of sentences

	public int wordNumber;					//Number of all words			//Relation.java
	public int kindKeywordNumber;			//kind number of keywords

	public int positionOfSegment;			//Number of this segment in the original text	
	public int positionOfFirstSentence;		//position(number of appearance in the original text) of the first sentence in the segment


	public SegmentData(String segText, int n)
	{
		segmentText = segText;
		positionOfSegment = n;
	}

	public void initializeSentence(String sentences, String keyids, String keyn, String sentences2, boolean english)
	{
		String sents[] = sentences.split("@@");		// all word list with spaces
		String sents2[] = sentences2.split("@@");	// all word list (end form) with spaces	
		
		String keyidss[] = keyids.split("@");		// id list with spaces
		String keynumbers[] = keyn.split(" ");		// list of keyword numbers 

		sentence = new SentenceData[sentenceNumber];
		for(int i=0;i<sentenceNumber;i++)
			sentence[i] = new SentenceData(sents[i], sents2[i], keyidss[i], Integer.parseInt(keynumbers[i]), positionOfSegment, positionOfFirstSentence+i, english);	
	}
}
