public Thesaurus(String file) throws FileNotFoundException
    {
    Scanner sc = null;
    
    try
    {
	// opens scanner
	String br = System.getProperty("line.separator");
	sc = new Scanner(new BufferedReader(new FileReader(file)));

	// initializes map
	map = new HashMap<String, String>();

	// a few variables to use while iterating
	String word = "";
	String line = "";
	String tmp;

	// loops through by word
	while(sc.hasNextLine())
	   {
		word = sc.nextLine();
		tmp = " ";
		line = "";

		// loops through by synonym
		while(sc.hasNextLine() && !tmp.isEmpty())
		{
			tmp = sc.nextLine();
			if (!tmp.isEmpty())
			{
				line += tmp + br;
			}
		}

		// adds the pair to the map
		map.put(word, line);
	    }

	}
	finally
	{
		if (sc != null)
			sc.close();
	}	
    }