The spell checking seems got confused by contractions, like:
doesn't
weren't
etc. I suspect is it breaking up the word at the apostophe, and so
checking "doesn", which is, of course, a spelling error.
if I pass them straight into aspell, it works fine.
Any thoughts on how to fix that?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
On Tue, Mar 2, 2010 at 9:24 AM, Christopher Barker
<Chris....@noaa.gov> wrote:
> The spell checking seems got confused by contractions
Yep, this is a thorn in my side. My achilles heel probably got me and
I optimized too early. My intent was to minimize calls to the enchant
library because I was seeing slowdowns (mostly when testing on slow
machines like my old OS X laptop, but still. Typing lag is annoying).
> if I pass them straight into aspell, it works fine.
>
> Any thoughts on how to fix that?
No good ones yet. :( Part of it is a word-end position check, but
I've messed around with it before and never found a good solution.
Simply checking for the single quote character isn't enough because it
can mess up stuff around quoted text.
The other part is that I don't want to lose it being based on the stc
insert text/delete text event handling because I want macros and other
things that insert text to continue to work without them having any
knowledge of spell checking on their part.
Any ideas?
Rob
Alternately, do both: have a "loose" spell check that catches the simple
cases, but delegates tougher cases (like words with apostrophes, dashes,
etc.) to the background.
FWIW,
Don
Yeah, right now I'm checking at every idle block, so I could certainly
only check e.g. every 10 idle blocks.
Maybe I'm over-thinking the problem. I had tried messing with the end
of word algorithm to see if a single quote character was actually an
apostrophe as in 't or as an end of string marker... Maybe the end of
word boundaries are only whitespace and punctuation and let enchant
deal with the single quote. I'll have to check that.
Rob
Don
Yep, that's right. I was hoping to avoid language-specific stuff in
my code; maybe enchant handles it itself if I just pass it the whole
string?
When I get some time (hopefully this weekend) I'll check it.
Rob
sure, but I don't think you'd need to, as in that case, the word
following the apostrophe should be a valid word.
oops, make that "the word _before_ the apostrophe"
Rob
Rob
It seems to work great!
Thanks.
-CHB
Excellent. I accidentally left a debug flag turned on, so if you
notice a corner case or something, you can start it from the command
line forward me the stdout.
But I won't leave it that way for long -- it's been a long time since
I made a release, so I need to get that Freshmeat activity indicator
off the floor. :)
Rob
aspell provides a LOT of suggestions for a misspelled word. however, the
one I want is usually on of the first 4 or so. As it is, Peppy gives me
a popup menu with a few entries at the top, each of which is fraction of
the suggestions, then I have to click that to get the list.
I'd like to be able to use one less mouse click most of the time. I
suggest the menu look like:
option1
option2
option3
option4
more suggestions...
----------
ctags
----------
undo
redo
cut
copy paste
----------
...
so if you wanted one of the first 4, you could get it with one click,
and you'd only get the bigger list if you really needed it.
just my $0.02
> But I won't leave it that way for long -- it's been a long time since
> I made a release, so I need to get that Freshmeat activity indicator
> off the floor. :)
By the way, I've been running the SVN version for a while now -- it
works great, at least on the Mac. On the Mac, I have a "alias app
bundle" built, so that it looks and acts like a regular app, you can put
an icon in the doc, drag and drop files on to it, etc, while it is still
running the SVN code.
Is there a way to accomplish something similar on Windows?
(I know this is not a Peppy Specific Question....)
-Chris
This was easy to implement, as it turns out. Check out the new svn.
> By the way, I've been running the SVN version for a while now -- it works
> great, at least on the Mac.
Yep, this is what I do on OS X as well, thanks to your suggestion a while ago.
> Is there a way to accomplish something similar on Windows?
Couldn't you just make a shortcut to wherever you have checked out the
svn code? I always do my windows development from a cygwin bash shell
so I haven't done it, but it seems like that should work.
Rob
perfect! thanks.
> Couldn't you just make a shortcut to wherever you have checked out the
> svn code?
That is what I do now, but it brings up a "dos box", and I dont' get the
icons right, and it doesn't support drag and drop -- though maybe the
Windows version doesn't really support drag and drop anyway.
Maybe I'll play around with it a bit more.
That is what I do now, but it brings up a "dos box", and I dont' get the icons right, and it doesn't support drag and drop -- though maybe the Windows version doesn't really support drag and drop anyway.
nice, I'll try that out. Is it possible to drag an drop onto the task
bar button -- or is that not "done" in Windows -- shows you how much I
use Windows....
> FWIW, I've added the following to my registry, which gives me an "Edit
> with Peppy" on the context menu in Explorer.
> ------------------------------------------------------------------------
>
> Windows Registry Editor Version 5.00
>
> [HKEY_CLASSES_ROOT\*\shell\OpenWithPeppy]
> @="Edit with Peppy"
>
> [HKEY_CLASSES_ROOT\*\shell\OpenWithPeppy\command]
> @="C:\\ProgramFiles\\Python25\\pythonw.exe -um peppy_start \"%1\" %*"
> ------------------------------------------------------------------------
>
> (I've added a little script called peppy_start in Scripts.)
>
> You could probably tweak the command to run it from your svn working copy.
Very cool, that was my next question -- now I need to figure out how to
edit the registry.
It might be nice to build that into an installer some day.
Speaking of which -- I was thinking of trying to make a real app bundle
for OS-X again -- last I tried it was really ugly figuring out how to
get the plugins and all in there -- has that changed any?
I don't think that's done on windows, but I'm no expert.
>> FWIW, I've added the following to my registry, which gives me an "Edit
>> with Peppy" on the context menu in Explorer.
>
> Very cool, that was my next question -- now I need to figure out how to edit
> the registry.
Yes that is a very cool trick, Don. I'll have to see about adding
that it when using the Nullsoft Windows installer.
> Speaking of which -- I was thinking of trying to make a real app bundle for
> OS-X again -- last I tried it was really ugly figuring out how to get the
> plugins and all in there -- has that changed any?
Nope, it is a big ol' fugly mess. Probably less of a mess than last
time you checked, Chris, but creating an app bundle for windows is not
straightforward at all. It still uses a makefile to create the
versioned archive, and uses cygwin on windows to allow me to automate
the build process. There are a bunch of hacks to place plugins in the
proper place for the py2exe install. Check the py2exe directory for
the scripts. Basically, most of the work goes into setting up the
directory structure in preparation for the "python setupy.py py2exe"
command.
Also to create the help files, you need sphinx installed. The
setup.py has improved a lot and is fairly well documented now.
Rob
Is it possible to drag an drop onto the task bar button -- or is that not "done" in Windows -- shows you how much I use Windows....I don't think that's done on windows, but I'm no expert.
FWIW, I've added the following to my registry, which gives me an "Edit with Peppy" on the context menu in Explorer.Very cool, that was my next question -- now I need to figure out how to edit the registry.
well, on the Mac, you can drop a file on an applications icon on the
"dock", which is much like the task bar. The file then opens in teh app
(if you've got the app set up to handle the message). It's a really nice
way to do it, 'cause you don't need the app to be visible to do it. I
don't know that Windows has anything like that, but adding peppy to the
right click menu will help a lot -- I've always liked that SciTe puts
that in for you.
> Just copy the lines I gave to a file with the extension ".reg", then
> right-click on it; you'll see a menu item named "Merge" --
got it -- thanks, that will help.
-Chris
Don
Sure, that's still there -- in fact, it goes one further, a "type"(text
file) and "creator" (Peppy).
That works great for something like a MSWord file, that you would only
want to open with one application, but for something like a jpg image or
a text file there might be a dozen different apps that I'd want to open
it with.
Even python files could be opened in Peppy, or run with python, or???
So I like to be more explicit.
> Failed opening
> file:///c:/Dwig/Falcon/Development/Online/RCAServer/Utilities/ConfigEditor/⇒
> Started "C:\ProgramFiles\Python25\python.exe"
> "c:/Dwig/Falcon/Development/Online/RCAServer/Utilities/ConfigEditor/test_backup.py"
> on Tue Apr 13 15#14.
>
> Detailed error message follows:
>
> Traceback (most recent call last):
> File
> "C:\ProgramFiles\Python25\lib\site-packages\peppy-0.14.0-py2.5.egg\peppy\fileopener.py",
> line 174, in determineMajorMode
> self.scanBufferForMajorMode()
> File
> "C:\ProgramFiles\Python25\lib\site-packages\peppy-0.14.0-py2.5.egg\peppy\fileopener.py",
> line 197, in scanBufferForMajorMode
> self.modecls = MajorModeMatcherDriver.match(self.buffer, url=self.url)
> File
> "C:\ProgramFiles\Python25\lib\site-packages\peppy-0.14.0-py2.5.egg\peppy\majormodematcher.py",
> line 192, in match
> mode = cls.matchFile(buffer, magic_size, url, header)
> File
> "C:\ProgramFiles\Python25\lib\site-packages\peppy-0.14.0-py2.5.egg\peppy\majormodematcher.py",
> line 252, in matchFile
> metadata = cls.getFailsafeMetadata(url)
> File
> "C:\ProgramFiles\Python25\lib\site-packages\peppy-0.14.0-py2.5.egg\peppy\majormodematcher.py",
> line 350, in getFailsafeMetadata
> traceback.print_exc()
> File "C:\ProgramFiles\Python25\Lib\traceback.py", line 227, in print_exc
> print_exception(etype, value, tb, limit, file)
> File "C:\ProgramFiles\Python25\Lib\traceback.py", line 124, in
> print_exception
> _print(file, 'Traceback (most recent call last):')
> File "C:\ProgramFiles\Python25\Lib\traceback.py", line 13, in _print
> file.write(str+terminator)
> IOError: [Errno 9] Bad file descriptor
Any ideas?
Don
It looks like the traceback is not actually the error that we're
interested in, but an error caused by trying to print the real error.
I can't seem to duplicate it here -- when I try to run a wxpython
sample file using F5 it seems to work.
Can you try the latest svn? I made a change that should cause the
error to be printed in the errorlog sidebar. I realize you're on
Windows and so that may not be convenient... Soon when I get some
more Fortran 77 mode stuff done, I'll make a new release.
(Yes, I have the occasion to code in F77 for my job. Yuck.)
Rob
On Tue, Apr 13, 2010 at 3:18 PM, Don Dwiggins <ddwi...@advpubtech.com> wrote:I just loaded a wxPthon .py file and tried to execute it with F5. I got the following traceback:It looks like the traceback is not actually the error that we're interested in, but an error caused by trying to print the real error. I can't seem to duplicate it here -- when I try to run a wxpython sample file using F5 it seems to work. Can you try the latest svn? I made a change that should cause the error to be printed in the errorlog sidebar.
I realize you're on Windows and so that may not be convenient... Soon when I get some more Fortran 77 mode stuff done, I'll make a new release. (Yes, I have the occasion to code in F77 for my job. Yuck.)