public static void assignTokenAttribute(TextComponent document)
			throws ParseException {
		String numericRegex = properties.getString("regex.token.numeric");
		String wordRegex = properties.getString("regex.token.word");
		String punctuationRegex = properties
				.getString("regex.token.punctuation");

		Pattern numericPattern;
		Pattern wordPattern;
		Pattern punctuationPattern;
		try {
			wordPattern = Pattern.compile(wordRegex);
			numericPattern = Pattern.compile(numericRegex);
			punctuationPattern = Pattern.compile(punctuationRegex);
		} catch (IllegalArgumentException e) {
			LOGGER.error("Sintax error in token attribute regex" + e);
			throw new ParseException(numericRegex, 0);
		}
		String value;
		Matcher numericMatcher;
		Matcher wordMatcher;
		Matcher punctuationMatcher;
		
		Iterator<?> iterator= document.createIterator();
		while(iterator.hasNext()){
			TextComponent token = (TextComponent)iterator.next();
			if(token.getName().equals(TextComponentName.TOKEN)){
				value = token.getValue();
				numericMatcher = numericPattern.matcher(value);
				wordMatcher = wordPattern.matcher(value);
				punctuationMatcher = punctuationPattern.matcher(value);
				if (numericMatcher.matches()) {
					token.setType(TokenType.NUMERIC);
				} else if (wordMatcher.matches()) {
					token.setType(TokenType.WORD);
				} else if (punctuationMatcher.matches()) {
					token.setType(TokenType.PUNCTUATION);
				}
			}
		}
	}