//
// Mining module for TETDM 
// TermMiningBase.java Version 0.30
// Copyright(C) 2012 YASUFUMI TAKAMA All RIGHTS RESERVED.
// This program is provided under the license.
// You Should read the README file.
//

package module.MiningModules.TermMiningBase;

import source.*;
import source.TextData.*;

@SuppressWarnings("serial")
public class TermMiningBase extends MiningModule
{
	public TermMiningBase()
	{
		setModuleID(48);
		pairingVisualizationID = new int[1];
		pairingVisualizationID[0] = 25;
        
        setCategoryID(2);
	}
	
	public void miningOperations(int optionNumber)
	{
		switch(optionNumber)
		{
			case 0:
				setDataStringArray(0,SetKeyword());
				setDataIntegerArray(0,SetValues()); // Call before SetKeyword()
				break;
		}
	}
	
	public int[] SetValues() // return list of values correspondings to keywords
	{
		int[] values = new int[text.keywordNumber];
		for(int i=0;i<text.keywordNumber;i++){
			values[i] = text.keyword[i].frequency;
		}
		return values;
	}
	public String[] SetKeyword() // return list of keywords mined by TETDM
	{
		String[] tlist = new String[text.keywordNumber];
		for(int i=0; i<text.keywordNumber;i++){
			tlist[i] = text.keyword[i].word;
		}
		return tlist;
	}
}
