【发布时间】:2015-02-17 07:23:36
【问题描述】:
显然ArrayList.getValue().size() 不是正确答案。
我环顾四周,向 Google 提出的问题并不容易。
我已经非常全面地解释了我在伪代码 cmets 中尝试做什么,也许有人知道如何遍历该数组列表?
public static void perceptron_data_struc_generateur(Set<String> GLOBO_DICT,
Map<File, ArrayList<String> > fileDict,
Map<File, int[] > perceptron_input)
{
//create a new entry in the array list 'perceptron_input'
//with the key as the file name from fileDict
//create a new array which is the length of GLOBO_DICT
//iterate through the indicies of GLOBO_DICT
//for all words in globo dict, if that word appears in fileDict,
//increment the perceptron_input index that corresponds to that
//word in GLOBO_DICT by the number of times that word appears in fileDict
for (Map.Entry entry : fileDict.entrySet())
{
//System.out.println(entry.getKey());
int[] cross_czech = new int[GLOBO_DICT.size()];
for (String s : GLOBO_DICT)
{
for(int i = 0; i < entry.getValue() ).size(); i++)
{
}
}
}
}
最终目标是获得this question 的第一个答案,以防您有兴趣。
【问题讨论】:
标签: java