documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Point to enry and github/linguist

Open smola opened this issue 7 years ago • 7 comments

From @ajnavarro yesterday (more):

  • I have the necessity of know the language of the file before hand to use bblfsh
    • talk about enry on bblfsh documentation to fill that necessity

Somewhere in the documentation we should clarify that when we choose language keys, we use github/linguist as reference (languages.yml) and both enry in Go and linguist in Ruby will do the job if language detection is needed before passing to Babelfish.

smola avatar Aug 14 '18 09:08 smola

This is actually not true that you need to know the language to parse files. Bblfshd will autodetect it if it's empty. Need to clarify this.

dennwc avatar Aug 14 '18 10:08 dennwc

@dennwc Sure, but when you specify a language, we use language names as defined in enry.

smola avatar Oct 04 '18 10:10 smola

when you specify a language, we use language names as defined in enry.

This is actually not true (currently) for Bash: https://github.com/bblfsh/bash-driver/issues/39#issuecomment-411044197

smola avatar Oct 19 '18 15:10 smola

Could somebody please help me understand, what are the action items here now?

If that is to mention the language auto-detection + usage of enry/linguist language names on client API level - would https://docs.sourced.tech/babelfish/using-babelfish/clients be a good place for adding a new section on language detection? (Open to any other suggestions as well)

bzz avatar Nov 20 '18 14:11 bzz

@bzz IMHO it would be mentioning how the language field works in requests:

  • if empty, it autodetects using src-d/enry.
  • it can be any language as defined in drivers: point to https://docs.sourced.tech/babelfish/languages ?

Not sure if it belongs to client or to the protocol description. Or even both.

smola avatar Nov 23 '18 09:11 smola

@smola I see! But could you please help me understand how is that different from what we have in https://docs.sourced.tech/babelfish/using-babelfish/babelfish-protocol#parserequest ?

the client must provide ... the programming language in the language field (which must be one of the languages currently supported) or empty to enable auto-detection)

From what I can see, it's:

  • the link to Enry is missing
  • field Key from https://docs.sourced.tech/babelfish/languages is not mentioned

If that is all that's needed - will be happy to add it asap.

bzz avatar Dec 12 '18 17:12 bzz

@bzz Yeah, a mention to the key would be enough I guess. Also, mention what's the behaviour regarding case sensitiveness (or lack of it).

smola avatar Dec 13 '18 10:12 smola