class ContextExtractor {

	protected int closest(int key, List<Integer> list) {
		int size = list.size();
		int delta = size / 2;
		int i = size / 2;
		while (delta > 1) {
			logger.debug("i = {} \t delta = {} ", i, delta);

			int elem = list.get(i);
			delta = (delta % 2 == 0) ? (delta) / 2 : (delta + 1) / 2;
			if (elem == key)
				return i;
			if (elem > key) {
				i = Math.max(i - delta, 0);
			} else {
				i = Math.min(delta + i, size - 1);
			}

		}
		int elem = list.get(i);
		if (elem > key)
			return i - 1;
		return i;
	}

	protected  ContextExtractor();
	public  ContextExtractor(Field field);
	protected  ContextExtractor(String text);

}