@Override
	public void reduce(Text keyIn , Iterable<Text> values , Context context) throws IOException , InterruptedException {
		String keyStr = "\"ID\":\"";
		String category = "";

		if (keyIn.toString().matches(".*#(a|b)$")) {
			keyStr += keyIn.toString().substring(0, keyIn.toString().length()-2);
		} else {
			keyStr += keyIn.toString();
		}
		keyStr += "\"";
		String valuesStr = "";

        // カテゴリを見つけてくる
        String categoryPrefix = "\"smallCategory\":";
        for (Text value : values) {
        	String[] properties = value.toString().split(",");
        	for (String property : properties) {
        		if (property.startsWith(categoryPrefix)) {
        			category = property.substring(categoryPrefix.length());
        		}
        		
        		valuesStr += property + ",";
        	}
        }
        
        // 末尾の","を削除
        valuesStr = valuesStr.substring(0, valuesStr.length()-1);

        valueOut.set("{" + keyStr + "," + valuesStr + "},");

        if (category.contains("パスタ")) {
        	mos.write("pasta", nullWritable, valueOut);
        } else if (category.contains("カレー")) {
        	mos.write("curry", nullWritable, valueOut);
        } else if (category.contains("丼")) {
        	mos.write("don", nullWritable, valueOut);
        } else if (category.contains("寿司")) {
        	mos.write("sushi", nullWritable, valueOut);
        } else if (category.contains("ケーキ")) {
        	mos.write("cake", nullWritable, valueOut);
        }
	}