@SuppressWarnings("unchecked")
	@Override
	public void match(Matrix<TokenNode> matrix, Sentence sentence)
			throws IOException {
		checkOpen();
		StringBuilder buffer = new StringBuilder();
		int j;
		String image;
		HashMap<Integer, Object> head;
		out: for (int i = 1; i < sentence.size() - 2; i++) {
			buffer.setLength(0);
			image = sentence.get(i).image;
			head = (HashMap<Integer, Object>) wordMap.trie.get(wordMap
					.escape(image.charAt(0)));
			if (head == null)
				continue;
			for (int k = 1; k < image.length(); k++) {
				head = (HashMap<Integer, Object>) head.get(wordMap.escape(image
						.charAt(k)));
				if (head == null)
					continue out;
			}
			buffer.append(image);
			j = i + 1;
			while (buffer.length() <= wordMap.max_len && j < sentence.size()-1) {
				image = sentence.get(j).image;
				for (int k = 0; k < image.length(); k++) {
					head = (HashMap<Integer, Object>) head.get(wordMap
							.escape(image.charAt(k)));
					if (head == null)
						continue out;
				}
				buffer.append(image);
				Word word = (Word) head.get(TrieMap.EndFlag);
				if (word != null) {
					String img = buffer.toString();
					matrix.insert(new TokenNode(i, j+1, new Cell(img,
							CHTag.CH_WORD, sentence.get(i).offset, false)),
							false);
				}
				j++;
			}
		}
	}