@Override
	public void run() {
		String titles, wordsToIgnore;
		
		// Read titles from standard input.
		Scanner sc = new Scanner(System.in);
		System.out.print(MSG_TITLE_PROMPT);
		titles = sc.nextLine();
		System.out.print(MSG_WORDS_TO_IGNORE_PROMPT);
		wordsToIgnore = sc.nextLine();
		sc.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;
			}
		}
	}