Skip to content
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

Try to guess the language by file content #910

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

gandarez
Copy link
Member

This PR adds a fallback that will try to guess the language by the content of a file. It also fixes fileHead function to read the first 512 bytes and do not fill the entire array with null characters making false-positives in some circunstances.

Fixes #821

@gandarez gandarez self-assigned this Aug 16, 2023
@gandarez gandarez changed the title Try to guess language by file content Try to guess the language by file content Aug 16, 2023
@gandarez gandarez force-pushed the feature/language-detection branch 2 times, most recently from 745e27b to 4e69981 Compare August 16, 2023 17:19
Copy link
Member

@alanhamlett alanhamlett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@alanhamlett alanhamlett merged commit 8c2a82d into develop Aug 16, 2023
17 checks passed
@alanhamlett alanhamlett deleted the feature/language-detection branch August 16, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language detection for files with no extension
2 participants