On Mon, 13 Dec 2004, Kevin Atkinson wrote:

> On Mon, 13 Dec 2004, Sandor Miskey wrote:
> 
> > Dear Aspell users,
> > 
> > I am having problems that have come up while installing and trying to
> > use aspell-0.60.1.1 with aspell6-hu-0.99.4.2-0 on SUSE LINUX PRO 9.2.
> > 
> > After installation as long as I have the default "repl-table hu_affix.dat"
> > line in /usr/local/lib/aspell/hu.dat, the "aspell -d hu -c Teszt.txt"
> > command hangs at the very first misspelled word with 100% CPU utilization.
> 
> I will look into this one.

The problem was the line:
  REP - –

The attached patch solve the problem by ignoring problem entries in the 
replacement table such as the above.

-- 
http://kevin.atkinson.dhs.org
===================================================================
RCS file: /cvsroot/aspell/aspell/modules/speller/default/language.cpp,v
retrieving revision 1.58
diff -u -r1.58 language.cpp
--- modules/speller/default/language.cpp        21 Nov 2004 02:52:23 -0000      
1.58
+++ modules/speller/default/language.cpp        17 Dec 2004 08:21:28 -0000
@@ -299,7 +299,7 @@
           break;
         }
       }
-      repls_.resize(num_repl);
+
       if (num_repl > 0)
         have_repl_ = true;
 
@@ -309,10 +309,21 @@
         ::to_lower(d.key);
         assert(d.key == "rep"); // FIXME
         split(d);
-        repls_[i].substr = buf_.dup(iconv(d.key));
-        to_clean((char *)repls_[i].substr, repls_[i].substr);
-        repls_[i].repl   = buf_.dup(iconv(d.value));
-        to_clean((char *)repls_[i].repl, repls_[i].repl);
+        SuggestRepl rep;
+        rep.substr = buf_.dup(iconv(d.key));
+        if (check_if_valid(*this, rep.substr).get_err()) 
+          continue; // FIXME: This should probably be an error, but
+                    // this may cause problems with compatibility with
+                    // Myspell as these entries may make sense for
+                    // Myspell (but obviously not for Aspell)
+        to_clean((char *)rep.substr, rep.substr);
+        rep.repl   = buf_.dup(iconv(d.value));
+        if (check_if_valid(*this, rep.repl).get_err()) 
+          continue; // FIXME: Ditto
+        to_clean((char *)rep.repl, rep.repl);
+        if (strcmp(rep.substr, rep.repl) == 0 || rep.substr[0] == '\0')
+          continue; // FIXME: Ditto
+        repls_.push_back(rep);
       }
 
     }
_______________________________________________
Aspell-user mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/aspell-user

Reply via email to