public void recurseAdd(int start, String input, ArrayList<String> result,
			LinkedList<String> forNow, boolean table[][], Set<String> dict) {
		if (start == input.length()) {
			String newOne = "";
			for (int i = forNow.size() - 1; i >= 0; i--) {
				newOne += forNow.get(i) + " ";
			}
			result.add(newOne.trim());
			return;
		}
		for (int i = 1 + start; i <= input.length(); i++) {
			if (dict.contains(input.substring(start, i))) {// valid
				if (i < input.length()) {
					if (table[i][input.length() - 1]) {
						forNow.push(input.substring(start, i)); // push shi
																// segment into
																// stack;
						recurseAdd(i, input, result, forNow, table, dict);
						forNow.pop();
					}
				} else {
					forNow.push(input.substring(start, i)); // push shi segment
															// into stack;
					recurseAdd(i, input, result, forNow, table, dict);
					forNow.pop();
				}

			}
		}

	}