private static Integer createPostingList(long featureId, StringTokenizer tokenizer, File postingFile,
			File compressedPostingFile) {

		TreeMap<Integer, Integer> postingInput = new TreeMap<Integer, Integer>();

		BasicPostingList posting = new BasicPostingList(featureId);
		CompressedPostingList compressedPosting = new CompressedPostingList(featureId);

		int j = 0;
		int maxWeight = 0;
		int did = 0;
		while (tokenizer.hasMoreElements()) {
			Integer token = Integer.parseInt(tokenizer.nextToken());
			if (j % 2 == 0 && token != 0) {
				did = token;
				postingInput.put(token, 0);
			} else if (j % 2 == 1 && token != 0) {
				if (token > maxWeight) {
					maxWeight = token;
				}
				postingInput.put(did, token);
			}
			j++;
		}

		Iterator<Integer> iter = postingInput.keySet().iterator();
		int key;
		while (iter.hasNext()) {
			key = iter.next();
			posting.addDoc(key);
			posting.addWeight(postingInput.get(key));
			compressedPosting.addDoc(key);
			compressedPosting.addWeight(postingInput.get(key));
		}

		// System.out.println(posting);
		// System.out.println(compressedPosting);

		try {
			FileOutputStream postingStream = new FileOutputStream(postingFile, true);
			FileOutputStream compressedPostingStream = new FileOutputStream(compressedPostingFile, true);
			ObjectOutputStream postingOut = new ObjectOutputStream(postingStream);
			ObjectOutputStream compressedPostingOut = new ObjectOutputStream(compressedPostingStream);
			postingOut.writeObject(posting);
			postingOut.flush();
			postingOut.close();
			postingStream.close();
			compressedPostingOut.writeObject(compressedPosting);
			compressedPostingOut.flush();
			compressedPostingOut.close();
			compressedPostingStream.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

		return maxWeight;
	}