Trailing context bug

0 views
Skip to first unread message

David T.

unread,
Sep 8, 2010, 12:50:22 PM9/8/10
to pyenchant users
Hello all,

I'm using the SpellChecker class and its functions leading_context and
trailing_context and when the misspelled word is the first I obtain no
context.

Example:

text = "Hellllou my friends"

checker = SpellChecker('en_EN')

checker.set_text(text)
checker.next()
print checker.trailing_context(checker.wordpos)

out:
" " (nothing)


Is this the expected working?

Thanks in advance.

Regards,

Ryan Kelly

unread,
Sep 8, 2010, 6:28:52 PM9/8/10
to pyencha...@googlegroups.com

The argument to trailing_context() isn't the position of the error, it's
the number of chars of output you want. Since the first error is at
position zero, you're asking for zero chars of trailing context and
getting an empty string.

Cheers,

Ryan


--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ry...@rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details

signature.asc

David T

unread,
Sep 9, 2010, 3:05:35 AM9/9/10
to pyencha...@googlegroups.com
Yeah, sorry, I thought this function was needed to know where the erroneous word was but this is known internally.

Congratulations for this great work.

2010/9/9 Ryan Kelly <ry...@rfk.id.au>
Reply all
Reply to author
Forward
0 new messages