public BoyerMoore(String pattern, int R) {

		this.pattern = pattern;
		int M = pattern.length();
	
		// initialize skip table
		right = new int[R];
		for (int i = 0; i < R; i++) right[i] = -1;
		for (int j = 0; j < M; j++) right[pattern.charAt(j)] = j;
	}