        private void processPartiallyTagged(Context context) throws IOException, InterruptedException {
        	stateIndexes.clear();
        	for (int i = 0; i <  items.length; ++i) {
        		if (ArrayUtils.contains(states, items[i])) {
        			stateIndexes.add(i);
        		}
        	}
    		outKey.initialize();
    		outKey.add(INITIAL_STATE, items[stateIndexes.get(0)], items[stateIndexes.get(0)]);
    		outVal.set(1);
    		context.write(outKey, outVal);
        	int leftBound = 0;
        	int rightBound = 0;
        	int leftWindow = 0;
        	int rightWindow = 0;
        	for (int i = 0; i < stateIndexes.size(); ++i ) {
        		if (i > 0) {
        			leftWindow = stateIndexes.get(i) - stateIndexes.get(i-1) / 2;
        			leftBound =stateIndexes.get(i) - leftWindow; 
        		} else {
        			leftBound = -1;
        		}
        		if (i  < stateIndexes.size() -1) {
        			rightWindow = stateIndexes.get(i+1) - stateIndexes.get(i) / 2; 
        			rightBound =  stateIndexes.get(i) + rightWindow;
        		} else {
        			rightBound = -1;
        		}
        		if (leftBound == -1 && rightBound != -1) {
        			leftBound =stateIndexes.get(i) - rightWindow; 
        			if (leftBound < 0) {
        				leftBound = 0;
        			}
        		} else if    (rightBound == -1 && leftBound != -1) {
        			rightBound =stateIndexes.get(i) + leftWindow; 
        			if (rightBound >= items.length) {
        				rightBound =  items.length-1;
        			}
        		}
        		String state = items[stateIndexes.get(i)];
        		for (int j = stateIndexes.get(i)-1, k=0;  j >= leftBound;  --j,++k ) {
        			String obs = items[j];
            		outKey.initialize();
            		outKey.add(STATE_OBS, state, obs);
            		outVal.set(windowFunction[k]);
            		context.write(outKey, outVal);
        		}
        		for (int j = stateIndexes.get(i)+1, k=0;  j <= rightBound;  ++j,++k ) {
        			String obs = items[j];
            		outKey.initialize();
            		outKey.add(STATE_OBS, state, obs);
            		outVal.set(windowFunction[k]);
            		context.write(outKey, outVal);
        		}
        	}
        	for (int i = 0;  i < stateIndexes.size() -1; ++i) {
        		outKey.initialize();
        		outKey.add(STATE_TRANS, items[stateIndexes.get(i)],  items[stateIndexes.get(i+1)]);
        		outVal.set(1);
        		context.write(outKey, outVal);
        	}
        }	

        private void processPartiallyTagged(Context context) throws IOException, InterruptedException {
        	stateIndexes.clear();
        	for (int i = 0; i <  items.length; ++i) {
        		if (ArrayUtils.contains(states, items[i])) {
        			stateIndexes.add(i);
        		}
        	}
    		outKey.initialize();
    		outKey.add(INITIAL_STATE, items[stateIndexes.get(0)], items[stateIndexes.get(0)]);
    		outVal.set(1);
    		context.write(outKey, outVal);
        	int leftBound = 0;
        	int rightBound = 0;
        	int leftWindow = 0;
        	int rightWindow = 0;
        	for (int i = 0; i < stateIndexes.size(); ++i ) {
        		if (i > 0) {
        			leftWindow = stateIndexes.get(i) - stateIndexes.get(i-1) / 2;
        			leftBound =stateIndexes.get(i) - leftWindow; 
        		} else {
        			leftBound = -1;
        		}
        		if (i  < stateIndexes.size() -1) {
        			rightWindow = stateIndexes.get(i+1) - stateIndexes.get(i) / 2; 
        			rightBound =  stateIndexes.get(i) + rightWindow;
        		} else {
        			rightBound = -1;
        		}
        		if (leftBound == -1 && rightBound != -1) {
        			leftBound =stateIndexes.get(i) - rightWindow; 
        			if (leftBound < 0) {
        				leftBound = 0;
        			}
        		} else if    (rightBound == -1 && leftBound != -1) {
        			rightBound =stateIndexes.get(i) + leftWindow; 
        			if (rightBound >= items.length) {
        				rightBound =  items.length-1;
        			}
        		} else if (leftBound == -1 && rightBound == -1) {
        			leftBound =stateIndexes.get(i) / 2;
        			rightBound = stateIndexes.get(i) + (items.length - 1 - stateIndexes.get(i)) / 2;
        		}
        		String state = items[stateIndexes.get(i)];
        		for (int j = stateIndexes.get(i)-1, k=0;  j >= leftBound;  --j,++k ) {
        			String obs = items[j];
            		outKey.initialize();
            		outKey.add(STATE_OBS, state, obs);
            		int val = k < windowFunction.length ?  windowFunction[k]  :   windowFunction[ windowFunction.length -1];  
            		outVal.set(val);
            		context.write(outKey, outVal);
        		}
        		for (int j = stateIndexes.get(i)+1, k=0;  j <= rightBound;  ++j,++k ) {
        			String obs = items[j];
            		outKey.initialize();
            		outKey.add(STATE_OBS, state, obs);
            		int val = k < windowFunction.length ?  windowFunction[k]  :   windowFunction[ windowFunction.length -1];  
            		outVal.set(val);
            		context.write(outKey, outVal);
        		}
        	}
        	for (int i = 0;  i < stateIndexes.size() -1; ++i) {
        		outKey.initialize();
        		outKey.add(STATE_TRANS, items[stateIndexes.get(i)],  items[stateIndexes.get(i+1)]);
        		outVal.set(1);
        		context.write(outKey, outVal);
        	}
        }	
