public OneWordContextModel(File file) {
		super(file);
		Scanner scanner = null;
		try {
			scanner = new Scanner(file);
		} catch (FileNotFoundException e) {
			System.out.println("Error occured with: "+ file.getAbsolutePath());
			System.out.println("Program will exit");
			e.printStackTrace();
			System.exit(0);
		}
		
		LinkedList<String> context = new LinkedList<String>();
		context.add("");
		
		while(scanner.hasNext()){
			
			String[] split = scanner.next().split("_");
			//split[0] would be the word itself.
			//split[1] is the key.
			
			String word = split[1];
			String key = context.remove();
			context.add(word);
			
			
			if("".equals(word)){
				continue;
			}
			totalKeyOccurrences++;
			if(model.containsKey(key)){
				ArrayList<WordNode> wnList = model.get(key);
				keyOccurrences.put(key,  keyOccurrences.get(key) + 1); //increment the number of occurrences of the key
				boolean found = false;
				for(WordNode wn: wnList){
					if(wn.word.equals(word)){
						wn.count++;
						model.put(key, wnList);
						found = true;
						break;
					}
				}
				if(!found)
					wnList.add(new WordNode(word, 1));
				
			}
			else{
				ArrayList<WordNode> newList = new ArrayList<WordNode>();
				newList.add(new WordNode(word, 1));
				model.put(key, newList);
				keyOccurrences.put(key,  1);
			}
		
		}
	}