1. 4
  1.  

  2. 5

    Is this interesting if it doesn’t have any features to be able to process English and extract semantic understanding rather than just have its own new completely fixed syntax that you have to learn? you may as well just learn the thing you’re trying to do directly instead of the betty syntax…

    here is how it matches if you want to count something.

    match = command.match(/^count\s+(?:the\s+)?(?:total\s+)?(?:number\s+of\s+)?(words?|lines?|char(?:acter)?s?)\s+in\s+(.+)$/i) ||
            command.match(/^how\s+many\s+(words?|lines?|char(?:acter)?s?)\s+are(?:\s+there)?\s+in\s+(.+)$/i)
    

    .. so with any other natural English syntax other than the fixed ones it’s programmed for, it won’t work.

    1. 4

      Makes me think of old adventure games.

      “Get ye flask.” “You cannot get ye flask”

      ..but I agree. It would make more sense to try and use something like NLTK or ParseyMcParseFace. Maybe an idea for future versions?

      1. 0

        Regex and yacc are the new NLP.

      2. 2

        That code snippet immediately disappointed me in Betty. I thought it was using a service like https://api.ai/ to match patterns. Could’ve beaten looking up a command on stackoverflow for one-off jobs.

        1. 1

          Uhm… Would you like to have a tool send all commands to remote host? I agree that the simple text approach is not much different from stackoverflow.com search but sending everything I type to some web service would be a lot worse for me.

          1. 2

            sending everything I type to some web service

            That is what you’re doing when you’re searching on stackoverflow.

            1. 2

              The other key is “everything I type”. I sanitize my queries to the outside internet pretty thoroughly at my work.

              1. 1

                The key is “some web service”. I trust stackoverflow.com with programming questions, and even if I don’t there is a dump of all answers available.

          2. 1

            Even if it did use some kind of NLP, why would I want this? “OK, Google” misinterprets what I want maybe 25% of the time. Why would I want that kind of ambiguity on the command line. That’s literally why I use a command line, because there is no ambiguity, when I type X, Y happens. Every. Single. Time.