public DocumentDictionary(File file) {
		Scanner scanner = null;
		try {
			scanner = new Scanner(file);
		} catch (FileNotFoundException e) {
			System.out.println("Error occured with: "+ file.getAbsolutePath());
			e.printStackTrace();
		}
		
		partsOfSpeech = new HashMap<Object, ArrayList<WordNode>>();
		posCounts = new HashMap<Object, Integer>();
		
		while(scanner.hasNext()){
			
			String[] split = scanner.next().split("_");
			String key = split[1];
			String word = split[0];
			
			if("".equals(key)){
				continue;
			}
			
			if(partsOfSpeech.containsKey(key)){
				ArrayList<WordNode> count = partsOfSpeech.get(key);
				posCounts.put(key,  posCounts.get(key)+1);
				boolean found = false;
				for(WordNode wn: count){
					if(wn.word.equals(word)){
						wn.count++;
						partsOfSpeech.put(key, count);
						found = true;
						break;
					}
				}
				if(!found)
					count.add(new WordNode(word, 1));
				
			}
			else{
				ArrayList<WordNode> newList = new ArrayList<WordNode>();
				newList.add(new WordNode(word, 1));
				posCounts.put(key,  1);
				partsOfSpeech.put(key, newList);
			}			
		}
		
	}