reasonable facsimile, noun
: a copy that is not exact but is fairly close
The house is a reasonable facsimile of his original home.
—sometimes used in a joking way
I can speak French, or at least a reasonable facsimile of French.
On Fedora, RHEL, or CentOS, install this program from the Copr repository:
Enable the repository:
```
```
Install the package:
```
```
On macOS, use the Homebrew package manager:
Install the Homebrew package manager as described at https://brew.sh/.
Install the package:
$ brew install msuchane/repo/near-facsimile
To install from source on any system, use the Cargo package manager:
Install Cargo as described at https://rustup.rs/.
Install the package:
$ cargo install near-facsimile
Recursively examine a directory of text files:
dir-with-text]$ near-facsimile
The program continually prints out file information to the terminal.
Finally, it saves all statistics sorted by file similarity to the comparisons.csv
and comparisons.json
files in the current directory.
The following options are available:
$ near-facsimile --path <path-to-directory>
$ near-facsimile --csv <path-to-new-file>
The tool only reports files that are similar over a certain threshold. By default, the threshold is 85.0, or 85% similar.
$ near-facsimile --threshold=<85.0>
You can configure the file comparison such that it skips all lines that match your regular expressions. The comparison is the calculated from teh remaining lines, which match none of the regular expressions.
For example, skip all lines that start with //
:
$ near-facsimile --skip-lines '^//'
By default, the tool uses the Levenshtein metric, which is accurate but rather slow. You can instead compare files using the Jaro metric, which finishes in around half the time, but produces less accurate statistics.
$ near-facsimile --fast
If you specify the --fast
option twice (-ff
), the tool uses the relatively rudimentary but very fast trigram comparison instead:
$ near-facsimile --fast --fast