LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[instanceLength(instance)]);
if (false) {
// This method not yet obeying its last "false" argument, and must be for this to work
//sampleTopicsForOneDoc((FeatureSequence)instance.getData(), topicSequence, false, false);
} else {
Randoms r = new Randoms();
FeatureSequence fs = (FeatureSequence) instance.getData();
int[] topics = topicSequence.getFeatures();
for (int i = 0; i < topics.length; i++) {
int type = fs.getIndexAtPosition(i);
topics[i] = r.nextInt(numTopics);
typeTopicCounts[type].adjustOrPutValue(topics[i], 1, 1);
tokensPerTopic[topics[i]]++;
/* if(typeTopicCounts[type].size() != 0) {
topics[i] = r.nextInt(numTopics);
typeTopicCounts[type].adjustOrPutValue(topics[i], 1, 1);