[Psi-Devel] [Patches] [Patch] Spell checker doesn't handle abbreviated words

Norman Rasmussen norman at rasmussen.co.za
Thu Jul 17 02:38:50 PDT 2008


On Thu, Jul 17, 2008 at 12:30 AM, Michail Pishchagin <mblsha at gmail.com>
wrote:

>        // Match words (minimally)
>        static QRegExp expression("\\b\\w+\\b");
>        static QRegExp number("^\\d+$");
>        // Iterate through all words
>        int index = text.indexOf(expression);
>        while (index >= 0) {
>                int length = expression.matchedLength();
>                if (expression.cap().indexOf(number) >= 0) {
>                        // skipping numbers
>                }


Using expression("\\w[\\w']*\\w") should still work right?
Why not use number.exactMatch(str) instead of str.indexOf(number) >= 0 ?
(same logic, I think it's easier to read)

-- 
- Norman Rasmussen
- Email: norman at rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.affinix.com/pipermail/psi-devel-affinix.com/attachments/20080717/d2076ee0/attachment.htm>


More information about the Psi-Devel mailing list