public void buildDB(){
		Console.line("Building Database\n**********************\n");
		for (CorpusSource source : sources){
			if (!source.wasRead()){
				Console.text(".");
				if (source.open()){
					while (source.hasNext()){
						String sentence = source.readSentence();
						//sentence = sentence.replaceAll("[\\W\\d]+", " ").trim(); //^a-zA-Z
						sentence = sentence.replaceAll("\\d+?", " ").replaceAll("(\\s+?\\W+?)", " ")
						.replaceAll("(\\W+?\\s+?)"," ").replaceAll("[-/\\[\\]\\(\\)]", " " );
						if (sentence.length()!=0){
							String[] words = toWords(sentence);
							for (String word : words){
								vocab.add(word);
							}
							for (int i=0;i<words.length;i++) {
								//Make the right context for the word
								VocabularyContext cont = new VocabularyContext(
										vocab.getIndex(i==0 ? "$START" : words[i-1]),
										vocab.getIndex(i==(words.length-1) ? "$END" : words[i+1])
										);
								//add it to the word
								vocab.getWord(vocab.getIndex(words[i])).addContext(cont);
								//add 1 to the token count (absolute corpus size, with repititions)
								tokenCount++;
								
							}
						}
					}
				} else {
					Console.line("");
					Console.error("Can't open "+source.name, name);
				}
				source.close();
			}
			source.markAsRead();
		}
		Console.line("Done building database\n");
		sources.clear();
	}