[Gambas-user] Textedit and Spell checking

MaxVK maximvonk at ...626...
Sat Mar 29 14:51:33 CET 2008



Rob Kudla wrote:
> 
> If you were using a regular textarea, I'd suggest replacing all the 
> linefeeds with spaces in a temporary variable, using 
> Replace(textarea1.text, "\n", " "), before shelling out to aspell.  
> Then the offsets would be preserved, but aspell should see it as one 
> long paragraph.  Aspell handles input on a line by line basis and I 
> can't find a flag to change that.
> 
> I don't know whether that would work in a textedit, but I did notice 
> that the textedit includes br tags inline with no linefeed, while 
> inserting a linefeed after each paragraph.  So I don't think it's br 
> vs. p, but linefeed vs. no linefeed.
> 
> Rob
> 

Quite right. Replacing the linefeeds with spaces works very well, but (for
some reason) it makes it even harder to keep track of the pos when words are
replaced with more or less characters than the original. 

The quickest way around this is to reverse the order in which the items
found by aspell are handled, which means you don't need to keep track of pos
at all anymore, its just a bit odd doing a spell check from the end of the
document to the beginning!

I'm going to play about a bit with tracking the pos when replacing words, to
see if I can get the spell check working in the right direction.

Max
-- 
View this message in context: http://www.nabble.com/Textedit-and-Spell-checking-tp16359797p16370219.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list