Here you can find the source of createWidList(int[][] widArray)
Parameter | Description |
---|---|
widArray | two dimensional interger array |
public static List<List<Integer>> createWidList(int[][] widArray)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**/*w w w . j a v a 2s .c o m*/ * Converts two dimensional integer (representing word ids) array into a * list of lists. Used for testing purposes. * * @param widArray two dimensional interger array * @return list of lists. */ public static List<List<Integer>> createWidList(int[][] widArray) { List<List<Integer>> widList = new ArrayList<List<Integer>>(); for (int[] widArrayGroup : widArray) { List<Integer> widListGroup = new ArrayList<Integer>(); for (int wid : widArrayGroup) { widListGroup.add(wid); } widList.add(widListGroup); } return widList; } }