public static HashMap getChunksIO(ArrayList taglist) {
		int begin = -1;
		int end = -1;

		HashMap<String, String> blocks = new HashMap<String, String>();
		String old_tag = "O";
		String curr_tag = "";
		for (int i = 0; i < taglist.size(); i++) {
			curr_tag = (String) taglist.get(i);

			if (curr_tag.equals(old_tag)) {
				// we are inside the same entity ... do nothing
			} else {
				// tags change

				// if we came from an entity: save old one
				if (begin > -1) {
					end = i - 1;
					String info = "";
					for (int j = begin; j < end + 1; j++) {

						if (info.length() > 0)
							info += "#";
						info += (String) taglist.get(j);

					}

					blocks.put(begin + "," + end, info);
				}

				// reset offsets
				if (!curr_tag.equals("O"))
					begin = i; // if a new entity starts
				else
					begin = -1; // if we are outside

				end = -1;
			}
			old_tag = curr_tag;
		}

		return blocks;
	}