Re: simplified Python parsing question

Discussion in 'Python' started by Eric S. Johansson, Jul 30, 2012.

  1. 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. :)
    >
    >
    Eric S. Johansson, Jul 30, 2012
    #1
    1. Advertising

  2. 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
    Steven D'Aprano, Jul 31, 2012
    #2
    1. Advertising

  3. 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
    Eric S. Johansson, Jul 31, 2012
    #3
  4. Eric S. Johansson

    Tim Chase Guest

    OT: accessibility (was "Re: simplified Python parsing question")

    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/
    Tim Chase, Jul 31, 2012
    #4
  5. Eric S. Johansson

    Ian Kelly Guest

    Re: OT: accessibility (was "Re: simplified Python parsing question")

    On Mon, Jul 30, 2012 at 8:54 PM, Tim Chase
    <> 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.
    Ian Kelly, Jul 31, 2012
    #5
  6. On Tue, Jul 31, 2012 at 11:54 AM, Steven D'Aprano
    <> 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
    Chris Angelico, Jul 31, 2012
    #6
  7. Eric S. Johansson

    BartC Guest

    "Eric S. Johansson" <> wrote in message
    news:...
    > 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
    BartC, Aug 3, 2012
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey

    simplified chinese encoding

    Grey, Apr 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    500
  2. Eric S. Johansson

    simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    2
    Views:
    186
    Eric S. Johansson
    Jul 30, 2012
  3. Dieter Maurer

    Re: simplified Python parsing question

    Dieter Maurer, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    119
    Dieter Maurer
    Jul 30, 2012
  4. Eric S. Johansson

    Re: simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    148
    Eric S. Johansson
    Jul 30, 2012
  5. Laszlo Nagy

    Re: simplified Python parsing question

    Laszlo Nagy, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    186
    Laszlo Nagy
    Jul 30, 2012
Loading...

Share This Page