Skip to content

are Signalcommands the only commands where package name != command name? #60

Open

Description

@floswald

Hi lars,

I wanted to implement your stata scanner without having to deploy stata, i.e. just read the source code and go through a list of keywords. is this a futile approach?

trying to understand whether this list here

is what one would use to pick up stata commands which do not bear the name of their package.

suppose I get

ssc hot, n(1000)

Could I reasonably assume (yes there will some errors, but fine) that for the 1000-20 (files in that list) I can confront a user's code with my list of 980 patterns, and say if I match binscatter, I could claim that you are using the binscatter package (see net describe binscatter, from(http://fmwww.bc.edu/RePEc/bocode/b))

thanks!

Activity

  1. larsvilhuber commented on May 23, 2025

    @larsvilhuber
    Member

    Background on the Stata scanner:

    So the right place to fix this is in https://github.com/labordynamicsinstitute/ssc-mirror/, to there generate a list of keyword-package crosswalks as an output, and store it in the releases branch.

    Some of this has been addressed (as a dead-end branch) in the stats branch of that repo https://github.com/labordynamicsinstitute/ssc-mirror/tree/stats

  2. larsvilhuber commented on May 23, 2025

    @larsvilhuber
    Member

    A further note on the Stata scanner:

    • the reason the Stata scanner is programmed in Stata was so that it would be easy to use for the target audience (classic Stata users)
    • It absolutely makes sense to use Python to do the same kind of parsing
    • I would use a "bag of words" approach, which are pre-cooked tools to parse all the words by their frequency, and possibly context.
    • You should be able to implement the logic behind the Stata Package search into Python easily.
  3. floswald commented on May 23, 2025

    @floswald
    Author

    ok i see - that's what I thought/hoped. I'm looking into this right now. Not sure I understand why one needs the bag of word approach here, can you explain? Is it because some package/command names are plain english words which you would also find in a sentence? My idea was that I only look at the code files, so I don't have to worry about english prose and can forget about the context of the word. So then, if I find binscatter I can be sure that this a stata command and not an english word (well let's assume that word existed).
    I'm implemeting this in julia, there's plenty of tools around as well.

  4. larsvilhuber commented on May 23, 2025

    @larsvilhuber
    Member

    There are signal words that are plain english word (table, etc.) because people have chosen that for ado files.

    IMHO, Julia is not the right tool for something that is pure text processing, but knock yourself out.

  5. larsvilhuber commented on Jan 19, 2026

    @larsvilhuber
    Member

    @floswald Did you do this in a way that I could pull into this workflow?

  6. floswald commented on Jan 19, 2026

    @floswald
    Author

    nope sorry...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions