Map<POS, String[][]> suffixMap = new HashMap<POS, String[][]>();
suffixMap.put(POS.NOUN,new String[][] {{"s",""},{"ses","s"},{"xes","x"},{"zes","z"},{"ches","ch"},{"shes","sh"},{"men","man"},{"ies","y"}});
suffixMap.put(POS.VERB,new String[][] {{"s",""},{"ies","y"},{"es","e"},{"es",""},{"ed","e"},{"ed",""},{"ing","e"},{"ing",""}});
suffixMap.put(POS.ADJECTIVE,new String[][] {{"er",""},{"est",""},{"er","e"},{"est","e"}});
DetachSuffixesOperation tokDso = new DetachSuffixesOperation(suffixMap);
tokDso.addDelegate(DetachSuffixesOperation.OPERATIONS,new Operation[] {new LookupIndexWordOperation(),new LookupExceptionsOperation()});
TokenizerOperation tokOp = new TokenizerOperation(new String[] {" ","-"});
tokOp.addDelegate(TokenizerOperation.TOKEN_OPERATIONS,new Operation[] {new LookupIndexWordOperation(),new LookupExceptionsOperation(),tokDso});
DetachSuffixesOperation morphDso = new DetachSuffixesOperation(suffixMap);
morphDso.addDelegate(DetachSuffixesOperation.OPERATIONS,new Operation[] {new LookupIndexWordOperation(),new LookupExceptionsOperation()});
Operation[] operations = {new LookupExceptionsOperation(), morphDso , tokOp};
morphy = new DefaultMorphologicalProcessor(operations);
FileManager manager = new FileManagerImpl(searchDirectory,PrincetonRandomAccessDictionaryFile.class);
FileDictionaryElementFactory factory = new PrincetonWN17FileDictionaryElementFactory();
FileBackedDictionary.install(manager, morphy,factory,true);
dict = net.didion.jwnl.dictionary.Dictionary.getInstance();