-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support detecting a language from content only #2
Comments
Thank you for the suggestion! Do you have an example in mind, how do you think this should work with the CLI interface? |
Providing a simple CLI option and providing the code through either a file or stdin (or allowing both). |
Yes it seems it doesn't support https://github.com/go-enry/go-enry/#by-text . Actually I guess currently only guessing by extension is supported by the tool. |
Note that the CLI version of enry (https://github.com/go-enry/enry) does not currently support determining the language of a file based on the file content only (go-enry/enry#2). Therefore I used a private build of the enry CLI (jeremy-jameson/enry@b7a5521). To get my "preferred" language names (e.g. "C#" instead of "csharp"), I added a "mapping" class to ReverseMarkdown (jeremy-jameson/reversemarkdown-net@09ee8e3).
I was looking at your change at jeremy-jameson@b7a5521 since I also need to detect by text. I ended up testing your build on Windows, and it's almost working for my purposes. However, I need to add a few more languages to your list, and I'm struggling to understand how to build it. Any pointers would be much appreciated. |
Usually, running |
Looks like the CLI version doesn't support detecting a language from just content, but the main repo does.
The text was updated successfully, but these errors were encountered: