Index: app/TODO
===================================================================
--- app/TODO	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ app/TODO	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -1,4 +1,5 @@
 BARDZO WAZNE:
 * przemyslec sposob wybierania jezyka / slownika po zainstalowaniu roznych dystrybucji [PK, TO]
+* gue nie sortuje wynikow, opcja weights dziala na odwrot
 
 WAZNE:
@@ -13,3 +14,2 @@
 * kor: nie dziala opcja distance
 * zunifikowac opcje cor i kor
-
Index: app/conf/gue.conf
===================================================================
--- app/conf/gue.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/gue.conf	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -11,2 +11,4 @@
 # parameter_name [=] value
 #
+dictionary-home = PATH_PREFIX/share/utt
+process = W
Index: app/src/gue/common_guess.cc
===================================================================
--- app/src/gue/common_guess.cc	(revision 40358d23e569b2d0d4697a192451fff347a48e96)
+++ app/src/gue/common_guess.cc	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -26,5 +26,5 @@
       char buf[255];
       expand_path(args->dictionary_home_arg, buf);
-      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg);
+      sprintf(dictionary,"%s/%s/gue.bin",buf,args->language_arg);
       if(file_accessible(dictionary)!=0)
 	{
Index: app/src/gue/main.cc
===================================================================
--- app/src/gue/main.cc	(revision 10c74af18d1db99b7373ceafcb3c13352fe80320)
+++ app/src/gue/main.cc	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -13,4 +13,5 @@
 #define W_PREF 0.4
 
+
 int main(int argc, char** argv) {
 
@@ -25,46 +26,4 @@
   process_common_options(&args,argv[0]);
   process_guess_options(&args);
-
-
-  // PONIÅ»EJ POPRZEDNI KOD (JUSTYNY)
-// //preliminary command-line parsing - for configuration file info only
-//   gengetopt_args_info pre_args;
-
-//   if (cmdline_parser(argc, argv, &pre_args) != 0)
-//     	exit(1);
-//   if(pre_args.config_given){
-// 	printf("podano config: %s\n",pre_args.config_arg);
-// 	non_standard_config=1;
-//   }
-  
-
-// //configuration file 1 parsing
-// 	struct cmdline_parser_params *params;	
-// 	params = cmdline_parser_params_init();
-// 	params->initialize = 1;
-// 	if(cmdline_parser_config_file(CONFIGFILE1,&args, params)!=0){
-// 		printf("System-wide configuration file parsing error!\n");		
-// 		exit(1);
-// 	}  
-
-// //configuration file 2 parsing-overriding
-// 	params->initialize=0;
-// 	params->override=1;
-// 	char* config2=(non_standard_config)?pre_args.config_arg:CONFIGFILE2;
-// 	if(cmdline_parser_config_file(config2,&args, params)!=0){
-// 		printf("User configuration file parsing error!\n");		
-// 		return 1;
-// 	}
-
-// 	params->initialize=0;
-// 	params->override=1;
-// 	//params->check_required=1;
-	
-// 	free(params);
-
-// //command-line options parsing-overriding
-//   if (cmdline_parser(argc, argv, &args) != 0)
-//     exit(1);
-
 
   char line[MAX_LINE];
@@ -84,5 +43,5 @@
       int start, len;
       
-      line[strlen(line)-1] = '\0';
+      //      line[strlen(line)-1] = '\0';
       
       if (!process_seg(line, args))
@@ -119,4 +78,6 @@
 
 	      count = 1;
+
+	      	      tab.sort();
 	      
 	      while (count < tab.count() && count <= guess_count)
@@ -177,10 +138,11 @@
 	      else
 		{
-		  for (int i=0; i< tab.count(); ++i)
+		  for (int i=0; i< count; ++i)
 		    {
 		      // kolejne opisy - kolejne linie.
 		      char* descp=desc;
-		      descp += sprintf(desc, " %s%s,%s\n", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		      descp += sprintf(desc, " %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
 		      if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
+		      descp += sprintf(descp,"\n");
 		      strcpy(outline,line);
 		      outline[strlen(outline)-1]='\0';
Index: app/src/lib/word.cc
===================================================================
--- app/src/lib/word.cc	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ app/src/lib/word.cc	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -16,7 +16,7 @@
   lemd[i]='\0';
   if(isdigit(lemd[0]))
-    fullform(f,lemd,l);  // je¶li lemat zakodowany
+    fullform(f,lemd,l);  // jeÂ¶li lemat zakodowany
   else
-    strcpy(l,lemd);     // je¶li lemat w pe³nej postaci
+    strcpy(l,lemd);     // jeÂ¶li lemat w peÂ³nej postaci
   strcpy(d,de+i+1);
 }
@@ -25,4 +25,16 @@
 bool Word::cmp_w(Word a, Word b) {
   return (a.w_suf() > b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool Word::cmp_w_rev(Word a, Word b) {
+  return (a.w_suf() < b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool cmp_w_fun(Word a, Word b) {
+  return (a.w_suf() > b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool cmp_w_rev_fun(Word a, Word b) {
+  return (a.w_suf() < b.w_suf());
 }
 //---------------------------------------------------------------------------
@@ -110,4 +122,9 @@
 void Words::sort() {
   std::sort(tab.begin(), tab.end(), Word::cmp_w);
+}
+
+//---------------------------------------------------------------------------
+void Words::sort_rev() {
+  std::sort(tab.begin(), tab.end(), cmp_w_rev_fun);
 }
 
Index: app/src/lib/word.h
===================================================================
--- app/src/lib/word.h	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ app/src/lib/word.h	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
@@ -40,4 +40,5 @@
 public:
   static bool cmp_w(Word a, Word b);
+  static bool cmp_w_rev(Word a, Word b);
 
   Word() : _len_suf(-1) { *f='\0'; returned=0; };
@@ -104,4 +105,12 @@
 
 //---------------------------------------------------------------------------
+
+
+
+
+bool cmp_w_fun(Word a, Word b);
+bool cmp_w_rev_fun(Word a, Word b);
+
+
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
@@ -133,4 +142,5 @@
 
   void sort();
+  void sort_rev();
 
   void prn(ostream& os);
