public void build() {

		long start = System.currentTimeMillis();

		// all lower case
		completeText = completeText.toLowerCase();

		// read stop words from file
		ArrayList<String> stopWords = getStopWords();

		// stemming
		SnowballStemmerWrapper stemmerWrapper = new SnowballStemmerWrapper(
				completeText);
		completeText = stemmerWrapper.runStringInput();

		// split by space
		String[] tokens = completeText.split(" ");
		System.out.println("Number of tokens: " + tokens.length);

		// remove stop words
		ArrayList<String> vocsAll = new ArrayList<>();
		int step = 10000;
		int count = 0;
		for (int i = count * step; i < Math.min((count + 1) * step,
				tokens.length); i++) {
			String token = tokens[i];
			boolean isStopWord = false;
			for (String stopWord : stopWords) {
				if (token.equals(stopWord)) {
					isStopWord = true;
					break;
				}
			}
			if (!isStopWord) {
				// remove special characters
				// token = token.replaceAll("[^a-z]", "");
				token = token.replaceAll("[\\W]", "");
				token = token.trim();
				vocsAll.add(token);
			}
			count++;
		}
		System.out.println("Number of total vocs: " + vocsAll.size());

		// get unique values
		ArrayList<String> vocs = new ArrayList<>();
		for (String voc : vocsAll) {
			if (!vocs.contains(voc))
				vocs.add(voc);
		}
		System.out.println("Number of vocs: " + vocs.size());

		long finished = System.currentTimeMillis();

		System.out.println("in " + (finished - start) / 1000 + "seconds");

		// write Vocabulary to file
		try {
			BufferedWriter writer = new BufferedWriter(new FileWriter(
					vocabularyPath));
			for (String voc : vocs) {
				writer.write(voc);
				writer.write("\n");
			}
			writer.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}