This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rank alias candidates by "alias" distance, then prefer initialisms
Where "alias distance" is defined as the number of insertions between the first and last character of an alias necessary to create a front-anchored subsequence of the candidate string. This is meant to favor matching single-letter or straight subsequence aliases, even when other candidates are shorter. Two common examples include: s/replace should prefer clojure.string, not clojure.core st/join should prefer clojure.string, not clojure.set Currently, dashes are not recognized as word separators, although they arguably should: (alias-distance "fbz" "foo-bar-zab") ; 6 (alias-distance "fbz" "frobnobz") ; 5 It's clear that the intent is to alias foo-bar-zab; we should be able to address this in the future. A somewhat common convention for aliases are initialisms: juc -> java.util.concurrent cji -> clojure.java.io We try to detect these as a last resort before falling to the default case.
- Loading branch information
Showing
4 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters