private void fillDatabase(String sentenceFile) {

		Scanner in;
		try {
			//reads sentence file
			in = new Scanner(new FileReader(sentenceFile + ".txt"));
			in.useDelimiter("\n");

			Result r = new Result();
			String temp = "";
			
			//separate words and add the to the input arg
			while (in.hasNext()) {
				temp = in.next();
				if(temp.indexOf("\r")!=-1)
				{
					temp = temp.substring(0, temp.length() - 1);
				} else temp = temp.substring(0, temp.length());

				r.addResult(temp);
			}
			System.out.println("getting results");

			//get the phonemes
			ArrayList<PhonemeContainer> phonemes = getPhonemes(r);

			System.out.println("phoneme creation successful!");
			
			//set the public data base to the phonemes
			PhonemeDB pdb = new PhonemeDB();
			pdb.arrayContent = getPhonemes(r);

			//add the phonemes to the database
			for (PhonemeContainer res : phonemes) {
				String x = "";
				for (String w : res.getWords()) {
					if (w == null)
						break;
					if (x.equals(""))
						x = w;
					else
						x = x + " " + w;
				}
				pdb.hashContent.put(x, res.getPhonemes());
			}


			OutputStream fos = null;

			//serialize the database
			try {

				fos = new FileOutputStream(sentenceFile
						+ ".ser");
				ObjectOutputStream o = new ObjectOutputStream(fos);
				o.writeObject(pdb);

			} catch (IOException e) {
				System.err.println(e);
			} finally {
				try {
					fos.close();
				} catch (Exception e) {
				}
			}

		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}