public static void annotateImpl(String text) throws IOException {
		Annotation document = new Annotation(text);
		pipeline.annotate(document);
		List<CoreMap> sentences = document.get(SentencesAnnotation.class);
		logger.info("# of sent = " + sentences.size());
		txt.setLength(0);
		pos.setLength(0);
		parse.setLength(0);
		dep.setLength(0);
		seg.setLength(0);
		for (CoreMap sentence : sentences) {
			// parse info
			Tree tree = sentence.get(TreeAnnotation.class);
			wparse.write(tree.toString() + "\n");
			parse.append(tree.toString());
			// this is the Stanford dependency graph of the current sentence
			String deps = StanfordDependencyResolver.getString(sentence);
			wdep.write(deps.replace("\n", "\t") + "\n");
			dep.append(deps.replace("\n", "\t") + "\n");
			// traversing the words in the current sentence
			// a CoreLabel is a CoreMap with additional token-specific methods
			ArrayList<String> tags = new ArrayList<String>(), tokens = new ArrayList<String>();
			for (CoreLabel token : sentence.get(TokensAnnotation.class)) {
				String tokenTxt = token.word();
				// this is the POS tag of the token
				String posStr = token.get(PartOfSpeechAnnotation.class);
				String ner = token.get(NamedEntityTagAnnotation.class);
				tokens.add(tokenTxt);
				if (!ignoreNerTypeSet.contains(ner)) {
					tags.add(ner);
				} else {
					tags.add("O");
				}
				wtxt.write(tokenTxt + " ");
				txt.append(tokenTxt + " ");
				wpos.write(posStr + " ");
				pos.append(posStr + " ");
			}
			txt.append("\n");
			wtxt.write("\n");
			pos.append("\n");
			wpos.write("\n");
			if (X.getBoolean("segmentation") == true) {
				String prevTag = "O";
				for (int i = 0; i < tags.size(); i++) {
					if (prevTag.equals("O")) {
						if (!tags.get(i).equals(prevTag)) {
							wseg.write(tokens.get(i) + "\t" + "B-E\t"
									+ tags.get(i) + "\n");
							seg.append(tokens.get(i) + "\t" + "B-E\t"
									+ tags.get(i) + "\n");
						} else {
							wseg.write(tokens.get(i) + "\t" + "O\t"
									+ tags.get(i) + "\n");
							seg.append(tokens.get(i) + "\t" + "O\t"
									+ tags.get(i) + "\n");
						}
					} else {
						if (!tags.get(i).equals(prevTag)) {
							if (!tags.get(i).equals("O")) {
								wseg.write(tokens.get(i) + "\t" + "B-E\t"
										+ tags.get(i) + "\n");
								seg.append(tokens.get(i) + "\t" + "B-E\t"
										+ tags.get(i) + "\n");
							} else {
								wseg.write(tokens.get(i) + "\t" + "O\t"
										+ tags.get(i) + "\n");
								seg.append(tokens.get(i) + "\t" + "O\t"
										+ tags.get(i) + "\n");
							}
						} else {
							wseg.write(tokens.get(i) + "\t" + "I-E\t"
									+ tags.get(i) + "\n");
							seg.append(tokens.get(i) + "\t" + "I-E\t"
									+ tags.get(i) + "\n");
						}
					}
					prevTag = tags.get(i);
				}
				seg.append("\n");
				wseg.write("\n");
			}
		}
	}