src/yang/weiwei/mtm/MTM.java
/**
	 * Get a topic's top words (with highest weight)
	 * @param lang Language ID
	 * @param topic Topic number
	 * @param numTopWords Number of top words
	 * @return Given topic's top words
	 */
Get a topic's top words (with highest weight)
@param lang Language ID
@param topic Topic number
@param numTopWords Number of top words
@return Given topic's top words
Get a topic ' s top words ( with highest weight ) @param lang Language ID @param topic Topic number @param numTopWords Number of top words @return Given topic ' s top words
public String topWordsByWeight(int lang, int topic, int numTopWords)
	{
		String result="Language "+lang+" Topic "+topic+":";
		MTMWord words[]=new MTMWord[param.numVocab[lang]];
		for (int vocab=0; vocab<param.numVocab[lang]; vocab++)
		{
			words[vocab]=new MTMWord(param.vocab[lang].getVocab(vocab), phi[lang][topic][vocab]);
		}
		Arrays.sort(words);
		for (int i=0; i<numTopWords; i++)
		{
			result+="   "+words[i];
		}
		return result;
	}
public String topWordsByWeight ( int lang , int topic , int numTopWords ) { String result = "Language " + lang + " Topic " + topic + ":" ; MTMWord words [ ] = new MTMWord [ param . numVocab [ lang ] ] ; for ( int vocab = 0 ; vocab < param . numVocab [ lang ] ; vocab ++ ) { words [ vocab ] = new MTMWord ( param . vocab [ lang ] . getVocab ( vocab ) , phi [ lang ] [ topic ] [ vocab ] ) ; } Arrays . sort ( words ) ; for ( int i = 0 ; i < numTopWords ; i ++ ) { result += "   " + words [ i ] ; } return result ; }
Get a topic's top words (with highest weight)
 @param lang Language ID
 @param topic Topic number
 @param numTopWords Number of top words
 @return Given topic's top words
Get a topic ' s top words ( with highest weight ) @param lang Language ID @param topic Topic number @param numTopWords Number of top words @return Given topic ' s top words