public static void prettyPrintPartsOfMatrix(String legend,
			RealMatrix matrix, String[] documentNames, String[] words,
			PrintWriter writer, int startRow, int endRow, int startCol,
			int endCol) {
		writer.printf("=== %s ===%n", legend);
		writer.printf("%15s", " ");
		for (int i = 0; i < endCol && i < documentNames.length; i++) {
			if (i > startCol)
				writer.printf("%8s", documentNames[i]);
		}
		writer.println();
		for (int i = 0; i < words.length && i < endRow; i++) {
			if (i > startRow) {
				writer.printf("%15s", words[i]);
				for (int j = 0; j < endCol && j < documentNames.length; j++) {
					if (j > startCol)
						writer.printf("%8.4f", matrix.getEntry(i, j));
				}
				writer.println();
			}
		}
		writer.flush();
	}