@Override
	public void run() {
		// Read titles from file.
		BufferedReader br;
		try {
			br = new BufferedReader(new FileReader("/home/yjwong/Documents/KwicKwacKwoc/large_input.list"));
			String titles = br.readLine();
			String wordsToIgnore = br.readLine();
			br.close();
			
			// Parse the comma-delimited list of words.
			List<String> listOfTitles = parseInput(titles); 
			List<String> listOfWordsToIgnore = parseInput(wordsToIgnore);
			
			// Create the work units.
			List<WorkUnit> workUnits = new ArrayList<WorkUnit>();
			for (int i = 0; i < listOfTitles.size(); ++i) {
				String title  = listOfTitles.get(i);
				
				mLogger.finest("Created WorkUnit for titles: " + title);
				WorkUnit work = new WorkUnit(title);
				workUnits.add(work);
			}
			
			workUnits.add(new WorkUnit());
			
			for (int i = 0; i < listOfWordsToIgnore.size(); ++i) {
				String wordToIgnore = listOfWordsToIgnore.get(i);
				
				mLogger.finest("Created WorkUnit for wordsToIgnore: " + wordToIgnore);
				WorkUnit work = new WorkUnit(wordToIgnore);
				workUnits.add(work);
			}
			
			WorkUnit lastWorkUnit = new WorkUnit();
			lastWorkUnit.setLast(true);
			workUnits.add(lastWorkUnit);
			
			// Write work units to the output port.
			for (WorkUnit work : workUnits) {
				try {
					getOutputPort().write(work);
				} catch (InterruptedException e) {
					return;
				}
			}
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}