I'm working with the following program:
public static void main(String[] args) throws Exception
{
String input = args[0];
InputStream is = new BufferedInputStream( new FileInputStream( input ) );
toMultiLabelDataset(is);
is.close();
}
public static MultiLabelDataset<String, String> toMultiLabelDataset(InputStream is) throws IOException
{
List<RelationAndMentions> relations = toRelations(is, true);
MultiLabelDataset<String, String> dataset = toDataset(relations);
return dataset;
}
As you can see it utilizes a data structure of the form MultiLabelDataset<String, String>
, I want to print the contents of that beast in a human intelligabe form. According to my previous searching I can likely use apache string utils or google guava library, is that right? How would I go about going that?
My guess would be that theres an equivalent data struc in those libraries, one that takes <String, String>
, I just need to determine what that is, copy the contents of MultiLabelDataset<String, String>
and then print? Is that reasonable?
EDIT
Multimap<String, String> result = HashMultimap.create();
for (String key : ((MultiLabelDataset) dataset).items)
{
for (String value : dataset.getLabels())
{
result.put(key, value);
}
}
^not like that.