PrestoSoft Blog :: Home

Wednesday, January 04, 2023

ExamDiff Pro 14.0: Automatic Programming Language Detection

ExamDiff Pro 14.0 will introduce a much-requested feature: automatically detecting document types based on file content. In other words, ExamDiff Pro will now automatically detect programming languages for source code files, in turn enabling features like syntax highlighting and the scope bar. This feature works for all built-in document types in ExamDiff Pro and is powered by the the open-source Guesslang machine-learning library.

Automatic document type detection is turned on by default and can be toggled in Options | Document types:

Now, if we paste some TypeScript code into a blank comparison window and it will automatically get detected as TypeScript, with syntax highlighting and scope bar features enabled:

More precisely, auto-detection will happen in the following situations (when the Automatically detect file type for unknown extensions option is enabled):
  • a file is compared either without a extension or with an extension that doesn't correspond to any known ExamDiff Pro doctype
  • a comparison is initiated from clipboard contents
  • text is pasted into a comparison window from the clipboard
Note that plain-text files (or any other files that Guesslang isn't sure about) will be auto-detected as the Default/Plain Text doctype, which disables features like syntax highlighting. This means that for files that aren't source code, ExamDiff Pro will continue to work as usual even with doctype auto-detection turned on.

Even if you have disabled the Automatically detect file type for unknown extensions option, you can also manually trigger doctype auto-detection at any time by selecting Set Document Type | Auto Detect from the context menu.

Lastly, note that this feature is already enabled in DiffNow, our free online file comparison tool powered by ExamDiff Pro. Simply paste any source code into it and DiffNow will auto-detect the doctype during comparison.

Labels: , , ,

0 Comments:

Post a Comment

<< Home