package nyc.angus.wordgrid;

import java.io.IOException;
import java.util.Map;

import nyc.angus.wordgrid.dictionary.DictionaryLoader;
import nyc.angus.wordgrid.dictionary.trie.TrieDictionary;
import nyc.angus.wordgrid.frequency.WordFrequencyLoader;
import nyc.angus.wordgrid.frequency.WordFrequencySorting;
import nyc.angus.wordgrid.ui.SelectGridSizeFrame;

/**
 * Start the solver user interface, which allows entry of word grid problems, and shows the results produced by the
 * solver.
 */
public class StartSolverUi {

	public static void main(final String[] args) throws IOException {
		final TrieDictionary dictionary = TrieDictionary.createTrie(DictionaryLoader
				.loadDictionary("/nyc/angus/wordgrid/resource/dictionary.txt"));

		final Map<String, Integer> frequencies = WordFrequencyLoader.loadWordFrequencies("/nyc/angus/wordgrid/resource/frequencies.csv", 5);
		final WordFrequencySorting sorter = new WordFrequencySorting(frequencies);

		final SelectGridSizeFrame initialFrame = new SelectGridSizeFrame(dictionary, sorter);
		initialFrame.setVisible(true);
	}
}

@@ -517,16 +517,447 @@
 erUi %7B%0A%0A
+%09/**%0A%09 * Path to the frequencies resource, listing 5000 words and a ranking of their frequency of use in an english%0A%09 * corpus.%0A%09 */%0A%09private static final String NYC_ANGUS_WORDGRID_RESOURCE_FREQUENCIES_CSV = %22/nyc/angus/wordgrid/resource/frequencies.csv%22;%0A%0A%09/**%0A%09 * Path to the dictionary resource, listing english words.%0A%09 */%0A%09private static final String DICTIONARY_RESOURCE_PATH = %22/nyc/angus/wordgrid/resource/dictionary.txt%22;%0A%0A
 %09public 
@@ -1097,13 +1097,8 @@
 ader
-%0A%09%09%09%09
 .loa
@@ -1113,53 +1113,32 @@
 ary(
-%22/nyc/angus/wordgrid/resource/dictionary.txt%22
+DICTIONARY_RESOURCE_PATH
 ));%0A
@@ -1225,54 +1225,51 @@
 ies(
-%22/nyc/angus/wordgrid/resource/frequencies.csv%22
+NYC_ANGUS_WORDGRID_RESOURCE_FREQUENCIES_CSV
 , 5)

refactor (ui): move resource paths to constant