Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: simplified Python parsing question

Reply
Thread Tools

Re: simplified Python parsing question

 
 
Eric S. Johansson
Guest
Posts: n/a
 
      07-30-2012
On 7/30/2012 10:59 AM, Laszlo Nagy wrote:
>
>>
>> yeah the problem is also little more complicated than simple parsing of
>> Python code. For example, one example (from the white paper)
>>
>> *meat space blowback = Friends and family [well-meaning attempt]
>>
>> *could that be parsed by the tools you mention?

>
> It is not valid Python code. Pygments is able to tokenize code that is not
> valid Python code. Because it is not parsing, it is just tokenizing. But if
> you put a bunch of random tokens into a file, then of course you will never be
> able to split that into statements.


If you have been reading the papers, you would understand what I'm doing. I'm
trying to take Python code with speech recognition friendly symbols and
translate the symbols into a code friendly form. My conjecture is that you can
change your perspective on the code and look for the edge that would normally be
used to define start of a symbol, you should be able to define the name string.
Another possibility is looking at the region which just contains letters numbers
and spaces and outside and use that as your definition of a name string. It
would probably help to verify that each word is found in a dictionary although
that adds extra complexity if you are trying to increase the dictionary at the
same time as the translation table.

I'm beginning to think for the first generation I should just use regular
expressions looking forwards and backwards and try to enumerate the possible cases.
>
> Probably, you will need to process ident/dedent tokens, identify the "level"
> of the satement. And then you can tell what file, class, inner class, method
> you are staying in. Inside one "level" or code block, you could try to divide
> the code into statements.


I was starting in that direction so that is good confirmation

>
> Otherwise, I have no idea how a blind person could navigate in a Python
> source. In fact I have no idea how they use regular programs. So I'm affraid I
> cannot help too much with this.


I'm sorry, I am, and I'm trying to help, hand disabled programmers. There are
more disability than blindness and after almost 20 years of encountering this
shortsightedness, I do get a little cranky at times.
>
>


 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      07-31-2012
On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote:

> If you have been reading the papers, you would understand what I'm
> doing.


That is the second time, at least, that you have made a comment like that.

Understand that most people are not going to follow links to find out
whether or not they are interested in what you have to say. If you can't
give a brief explanation of what you are doing in your email or news
post, many people aren't going to read on. Perhaps they intend to but are
too busy, or they have email access but web access is restricted, or
they've already got 200 tabs open in their browser and don't want any
more (I'm not exaggerating, I know people like that).

People use email because it is a "push" technology -- you don't have to
go out and look for information, it gets pushed into your inbox. Clicking
on links is a "pull" technology -- you have to make the explicit decision
to click the link, open a browser, go out to the Internet and read who
knows what. That requires a different frame of mind. Expect to lose some
of your audience every time you require them to follow a link.

And *especially* so if that it a link to Google Docs, instead of an
normal web page. Google Docs is, in my opinion, a nasty piece of rubbish
that doesn't run on any of my browsers. As far as I'm concerned, I'd
rather download a Word doc, because at least I can open that in
OpenOffice or Abiword and read it. Something in Google Docs might as well
be locked in a safe as far as I'm concerned.


--
Steven
 
Reply With Quote
 
 
 
 
Eric S. Johansson
Guest
Posts: n/a
 
      07-31-2012
On 7/30/2012 9:54 PM, Steven D'Aprano wrote:
> On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote:
>
>> If you have been reading the papers, you would understand what I'm
>> doing.

> That is the second time, at least, that you have made a comment like that.


Actually, it's probably more like the forth hundred time. I apologize, I was
wrong and I would back up and start over again if I could
>
> Understand that most people are not going to follow links to find out
> whether or not they are interested in what you have to say. If you can't
> give a brief explanation of what you are doing in your email or news
> post, many people aren't going to read on. Perhaps they intend to but are
> too busy, or they have email access but web access is restricted, or
> they've already got 200 tabs open in their browser and don't want any
> more (I'm not exaggerating, I know people like that).


accept criticism. I'm still working on an elevator pitch for this concept. I've
been living with the technology and all its variations for about 10 years and
it's not easy to explain to someone who is not disabled. People with working
hands don't understand how isolating and, sometimes humiliating software can be.
advocates like myself sometimes get a little tired of saying the same thing over
and over and over again and people who are disabled just don't care. So you find
yourself using shorthand because you going to be ignored anyway
>
> People use email because it is a "push" technology -- you don't have to
> go out and look for information, it gets pushed into your inbox. Clicking
> on links is a "pull" technology -- you have to make the explicit decision
> to click the link, open a browser, go out to the Internet and read who
> knows what. That requires a different frame of mind. Expect to lose some
> of your audience every time you require them to follow a link.


Okay, this implies the need to really work on more of an elevator/summary
speech. Thank you for your input. I appreciate it
>
> And *especially* so if that it a link to Google Docs, instead of an
> normal web page. Google Docs is, in my opinion, a nasty piece of rubbish
> that doesn't run on any of my browsers. As far as I'm concerned, I'd
> rather download a Word doc, because at least I can open that in
> OpenOffice or Abiword and read it. Something in Google Docs might as well
> be locked in a safe as far as I'm concerned.


the ability for multiple people to work on the same document at the same time is
really important. Can't do that with Word or Libre office. revision tracking
in traditional word processors are unpleasant to work with especially if your
hands are broken.

It would please me greatly if you would be willing to try an experiment. live my
life for a while. Sit in a chair and tell somebody what to type and where to
move the mouse without moving your hands. keep your hands gripping the arms or
the sides of the chair. The rule is you can't touch the keyboard you can't touch
the mice, you can't point at the screen. I suspect you would have a hard time
surviving half a day with these limitations. no embarrassment in that, most
people wouldn't make it as far as a half a day. I've had to live with it since
1994. Not trying to brag, just pointing out the facts.

I'm going to try again from a different angle in a different thread. I will take
your advice to heart and I would appreciate some feedback on how well I do
satisfying the issues you have described

 
Reply With Quote
 
Tim Chase
Guest
Posts: n/a
 
      07-31-2012
On 07/30/12 21:11, Eric S. Johansson wrote:
> the ability for multiple people to work on the same document at
> the same time is really important. Can't do that with Word or
> Libre office. revision tracking in traditional word processors
> are unpleasant to work with especially if your hands are broken.


If you're developing, I might recommend using text-based storage and
actual revision-control software. Hosting HTML (or Restructured
Text, or plain-text, or LaTeX) documents on a shared repository such
as GitHub or Bitbucket provides nicely for accessible documentation
as well as much more powerful revision control.

> It would please me greatly if you would be willing to try an
> experiment. live my life for a while. Sit in a chair and tell
> somebody what to type and where to move the mouse without moving
> your hands. keep your hands gripping the arms or the sides of
> the chair. The rule is you can't touch the keyboard you can't
> touch the mice, you can't point at the screen. I suspect you
> would have a hard time surviving half a day with these
> limitations. no embarrassment in that, most people wouldn't make
> it as far as a half a day.


I've tried a similar experiment and am curious on your input device.
Eye-tracking/dwell-clicking? A sip/puff joystick? Of the various
input methods I tried, I found that Dasher[1] was the most
intuitive, had a fairly high input rate and accuracy (both
initially, and in terms of correcting mistakes I'd made). It also
had the ability to generate dictionaries/vocabularies that made more
appropriate/weighted suggestions which might help in certain
contexts (e.g. pre-load a Python grammar allowing for choosing full
atoms in a given context).

-tkc

[1]
http://en.wikipedia.org/wiki/Dasher
http://www.inference.phy.cam.ac.uk/dasher/





 
Reply With Quote
 
Ian Kelly
Guest
Posts: n/a
 
      07-31-2012
On Mon, Jul 30, 2012 at 8:54 PM, Tim Chase
<(E-Mail Removed)> wrote:
> I've tried a similar experiment and am curious on your input device.
> Eye-tracking/dwell-clicking? A sip/puff joystick? Of the various
> input methods I tried, I found that Dasher[1] was the most
> intuitive, had a fairly high input rate and accuracy (both
> initially, and in terms of correcting mistakes I'd made). It also
> had the ability to generate dictionaries/vocabularies that made more
> appropriate/weighted suggestions which might help in certain
> contexts (e.g. pre-load a Python grammar allowing for choosing full
> atoms in a given context).


A microphone with voice recognition software is described in the storyboard.
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      07-31-2012
On Tue, Jul 31, 2012 at 11:54 AM, Steven D'Aprano
<(E-Mail Removed)> wrote:
> Google Docs is, in my opinion, a nasty piece of rubbish
> that doesn't run on any of my browsers. As far as I'm concerned, I'd
> rather download a Word doc, because at least I can open that in
> OpenOffice or Abiword and read it. Something in Google Docs might as well
> be locked in a safe as far as I'm concerned.


I go the opposite way. Google Docs works fine in my web browser, but
if it's a Word doc, I need to hunt down something that can read it.
I've yet to find any browser that can't handle a GDocs "publish" page,
but I have plenty of computers that don't have any
{Open|Libre|Liber|Libra|whatever the next generation is}-Office
installed.

Best is to put the information into your email/post. Next best is to
have a link to the information. Definitely worst is to force people to
download your file and try to read it.

ChrisA
 
Reply With Quote
 
BartC
Guest
Posts: n/a
 
      08-03-2012
"Eric S. Johansson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 7/30/2012 9:54 PM, Steven D'Aprano wrote:


> It would please me greatly if you would be willing to try an experiment.
> live my life for a while. Sit in a chair and tell somebody what to type
> and where to move the mouse without moving your hands. keep your hands
> gripping the arms or the sides of the chair. The rule is you can't touch
> the keyboard you can't touch the mice, you can't point at the screen. I
> suspect you would have a hard time surviving half a day with these
> limitations. no embarrassment in that, most people wouldn't make it as far
> as a half a day.


Just using speech? Probably more people than you might think have had such
experiences: anyone who's done software support over the telephone for a
start! And in that scenario, they are effectively 'blind' too.

--
Bartc

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: simplified Python parsing question Laszlo Nagy Python 0 07-30-2012 02:59 PM
Re: simplified Python parsing question Eric S. Johansson Python 0 07-30-2012 09:57 AM
Re: simplified Python parsing question Dieter Maurer Python 0 07-30-2012 09:11 AM
simplified Python parsing question Eric S. Johansson Python 2 07-30-2012 06:17 AM
Cisco Networking Simplified - book review and a sample chapter Michael Cisco 0 11-19-2003 11:09 PM



Advertisments