toggle name, With explanations

Eric S. Johansson esj at harvee.org
Mon Jul 30 22:44:00 EDT 2012


the wonderful responses I received from people like Lazlo, Paul, and Stephen has 
given me some ideas about a different approach. First, here's explanation of 
what I'm doing

I'm developing a method which will enable hand disabled developers such as 
myself to create and manipulate symbols identical to those created by 
non-disabled developers. the input mechanism will be speech recognition 
maximizing the use of ordinary continuous English dictation and a minimal set of 
commands to activate this method. Subsequent work will produce a speech user 
interface for navigation code and tools such as debuggers bypassing the 
interference and constraints created by GUIs.

The core concept is any string of a natural language words can be transformed 
into a symbol by storing the matchup between the natural language word string 
and the symbol string in a database.  in other words, a dictionary which has 
paired keys and one key can return the other.

in my original request I was thinking about parsing the environment and looking 
for the transition between code and symbol or natural language word string but 
unfortunately, that technique breaks because the characters around the region of 
interest may not be complete or correct code. So I thought about trying to look 
at the other way. If you find a string of characters that you don't look like a 
symbol or look like a string of natural in words, when the characters stop 
looking like that, then that defines the limits of the region of interest.

example:

s.pack(side=Tkinter.R^IGHT, fill=Tkinter.Y)

the carrot marks the current position. If I was to say this point, "toggle 
word", I would first look to the left and the right and look forward the 
character string stopped looking like a symbol or a natural language word 
string.in this example, I would find the string "RIGHT". If I didn't find 
anything, I would look one more character to the left and see if there was a "." 
present, do the same search again this time solely to the left and I would have 
the string "TKinter.RIGHT". The database would have the in tree and replace it 
with "TK interpreter right" so I could edit the string with speech recognition.

s.pack(side=TK interpreter^ right, fill=Tkinter.Y)

Then using the same basic technique as I described above, I looked left and 
right for a series of symbols, in this case they are actually words, until I 
reach something that is not a symbol. The end result is used a key for the 
database which would return "Tkinter.RIGHT"

It looks like if I'm correct, this is a much simpler way of doing what I wanted 
to do (extract symbols and natural language word strings).

1) can you see any holes in this logic?
2) what would you recommend for regular expressions. The reason I ask is that if 
you have spaces in the string, you only want want alphanumeric sequences,
if you have alphanumeric plus symbol special characters, you don't want spaces. 
I'm not sure how strict that precondition should be. I'm going to
need to think about it more. Opinions would be welcome.

I think this works for almost any language too which is really important in the 
disabled programmer community.

I appreciate your patience. Sometimes the overhead of communicating using speech 
recognition with tools don't work well with speech recognition such as
Thunderbird makes the whole process of writing almost more difficult than it's 
worth. Working on tools like this is incremental progress I need to make
in order to be able to bring speech recognition-based accessibility to the 
Python world.

--- eric






More information about the Python-list mailing list